Repository navigation
feat(apisix): add opt-in read-only runtime support - #1041
NiuBlibing wants to merge 5 commits into
Conversation
|
Recommended merge order to reduce overlapping changes while keeping each PR single-topic: #1039 → #1040 → #1041 → #1042 → #1043 → #1044 → #1045 → #1046 → #1047 The PRs are intentionally all based on |
|
Updated recommended merge order after separating Admin API access policy from Ingress wiring: #1039 → #1040 → #1041 → #1042 → #1043 → #1048 → #1044 → #1045 → #1046 → #1047 Each PR remains based on |
646025f to
0f79934
Compare
|
Updated at d8afa60. The actual APISIX image was inspected and runs as numeric UID/GID 636. Defaults now set numeric IDs for Pod and wait-etcd, preserve writable config/log/temp paths under read-only root, and were validated by Docker startup, /status/ready=200 and nginx -t. ServiceAccount token automount remains false by default. |
d33ea48 to
e4bbd05
Compare
moonming
left a comment
There was a problem hiding this comment.
Thanks for the substantial work here, @NiuBlibing, and for validating the actual image UID/GID and runtime paths. The writable-directory layout looks useful, but there is an upgrade blocker to address first.
The existing #805 workaround uses extraVolumeMounts for /usr/local/apisix/conf, /usr/local/apisix/logs, /tmp, and the nginx temporary directories. With this PR's automatic mounts, those paths are mounted twice. I rendered that configuration and confirmed eight duplicate mountPaths, which Kubernetes rejects.
Could you add a compatibility strategy, such as an opt-in runtime-volume switch, deduplication, or another explicit migration mechanism, together with a regression test?
This PR also changes several defaults: non-root execution, read-only root filesystem, seccomp, dropped capabilities, and ServiceAccount token automount. That needs an explicit versioning and migration decision; the PR currently leaves the chart at 3.1.0. One possible path is to separate optional read-only support from enabling secure defaults in a major release.
Please also wire the render test into CI. The standalone Docker smoke test is useful, but it does not exercise the Helm/Kubernetes volume and ServiceAccount behavior. Thanks again for the detailed validation so far!
# Conflicts: # charts/apisix/templates/deployment.yaml
moonming
left a comment
There was a problem hiding this comment.
Thanks for the update, @NiuBlibing! The previous head's kind E2E was green, and this head's render checks still pass locally.
I noticed that 95ab816 reverts charts/apisix/Chart.yaml from 3.2.0 back to 3.1.0. The chart requires a version increment whenever its templates change, so this head cannot be released as-is.
If the intent is to let #1053 go first, could you keep that ordering in the PR and then rebase and restore the appropriate next minor version? Please don't drop the version increment altogether. Once the final version and the rebased CI are in place, we can proceed with the review. Thanks!
|
@moonming Thanks for pointing out the release-version requirement. I have opened #1067 as a separate, final chart package version PR for my improvement series, rather than assigning release versions to each intermediate topic PR. It currently contains only For clarity, #1041 has no My proposed merge order is:
All 21 topic PRs target This makes the version increment explicit while keeping it separate from the feature diffs. I understand that this coordinated merge/version approach needs maintainer agreement with the repository's per-PR version rule; I am proposing that approach here rather than treating it as already accepted. |
Existing read-only APISIX deployments use custom writable mounts and copy init containers (for example #805). Automatic mounts must not duplicate those paths or change the security and ServiceAccount behavior of existing releases.
This PR adds opt-in
runtimeVolumes.enabledsupport for the eight packaged writable directories. ExplicitextraVolumeMountstake precedence;prepare-runtimecopies only chart-managed config/log directories. Existing Pod, container and wait-etcd security contexts remain empty by default. Token automount defaults tonull, preserving Kubernetes/admission and existing ServiceAccount behavior; explicittrue/falseoverrides remain available. Missing new values are safe when upgrading with--reuse-values.The chart package version increment is tracked separately in #1067, proposed as the final PR after this coordinated topic series and its integration checks.
appVersionremains 3.21.0, unchanged from the current base. The coordinated version approach is subject to maintainer agreement. The README documents the upgrade behavior and provides a complete optional security profile for the official APISIX image. Applying that profile changes Pod permissions and requires a tested rollout; it is not applied to existing releases automatically.Validation:
--reuse-valuesand preserve an external ServiceAccount's disabled token automount; install the optional profile and verify actual writable paths, read-only root filesystem, UID, init exits, token absence and working traffic.