Skip to content

feat(apisix)!: require authentication for bundled etcd - #1068

Open
moonming wants to merge 8 commits into
apache:masterfrom
moonming:feat/default-etcd-rbac
Open

moonming wants to merge 8 commits into
apache:masterfrom
moonming:feat/default-etcd-rbac

Conversation

@moonming

@moonming moonming commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Enable RBAC authentication for the bundled etcd by default and bump the APISIX chart to 4.0.0.
  • Reuse the etcd chart's generated Secret: APISIX reads the same root password through secretKeyRef as APISIX_ETCD_PASSWORD and connects as root.
  • Wait for an authenticated etcd read on the default bundled HTTP path before starting APISIX, so init_etcd cannot race etcd's authentication setup.
  • Document the required upgrade migration, GitOps behavior, fullCustomConfig credentials, and rollback precautions.

Fixes #1032. NetworkPolicy remains a separate layer: even a pod with a forged client label cannot write to etcd without credentials.

Upgrade notes

Fresh installations generate a random password without additional configuration. Existing releases must create a password Secret before upgrading and set etcd.auth.rbac.existingSecret; an upgrade that enables authentication without it fails instead of silently changing or losing credentials. When reusing old values with --reuse-values or --reset-then-reuse-values, set etcd.auth.rbac.create=true explicitly so the previous false value is not retained. The README includes the exact commands and explains the temporary Admin API write interruption while authentication is enabled.

This change is limited to password authentication and does not change the existing TLS configuration.

Verification

  • Render tests pass with both Helm 3.22.1 and 4.2.4:
    • test/render/admin-credentials.sh: 100 assertions.
    • test/render/etcd-access.sh: 102 assertions, including authenticated startup checks, image pull secrets, and rendering the fullCustomConfig example extracted from the generated README.
    • test/render/data-encryption.sh: 59 assertions.
  • ct lint --skip-helm-dependencies --validate-maintainers=false passes for the APISIX, dashboard, and ingress-controller charts, using the dependency versions pinned in Chart.lock.
  • Real Kubernetes 1.37.0 / Helm 3.22.1 E2E:
    • test/e2e/etcd-access.sh: 51 assertions pass, including a default three-replica startup with zero APISIX restarts, authenticated fresh installs, rejection of anonymous reads and forged-label writes, password preservation across upgrades, and migration from chart 2.18.2 with a pre-created Secret.
    • test/e2e/data-encryption.sh: 53 assertions pass, including reads from unauthenticated old releases, authenticated reads and explicit anonymous-read rejection after migration, --reuse-values migration from chart 3.0.0 with an explicitly saved create=false, and encryption-key rotation.

Verification note

A local default three-replica startup smoke test could not complete because Docker's 59 GB virtual disk reached 100% usage. The equivalent GitHub CI jobs on Kubernetes 1.22/1.23 and Kubernetes 1.37 have now passed on the final revision, completing the required real-cluster verification.

@moonming
moonming marked this pull request as draft November 24, 2026 13:31
@moonming
moonming marked this pull request as ready for review November 24, 2026 15:17

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundled etcd runs without authentication and accepts connections from any pod, so the gateway configuration can be changed without the Admin API key

1 participant