Skip to content

fix(apisix): use the bundled etcd chart's Service name for APISIX and wait-etcd - #1053

Open
cvas22 wants to merge 2 commits into
apache:masterfrom
cvas22:fix/etcd-service-name-1049
Open

cvas22 wants to merge 2 commits into
apache:masterfrom
cvas22:fix/etcd-service-name-1049

Conversation

@cvas22

@cvas22 cvas22 commented Nov 19, 2026

Copy link
Copy Markdown

Fixes #1049

The ConfigMap and the wait-etcd init container built the etcd host as <release>-etcd, so etcd.nameOverride, etcd.namespaceOverride or a release name that already has etcd in it pointed APISIX at a Service that doesn't exist. I added an apisix.etcd.host helper that calls the etcd chart's own common.names.fullname and common.names.namespace through .Subcharts.etcd, same as the secret name helper already does. With only etcd.fullnameOverride set the output stays the bare name like before, so those releases don't get a config change.

Notes

I rendered it with helm template for the default release, demo with etcd.nameOverride=store, a release called demo-etcd, fullnameOverride with and without namespaceOverride, and external etcd, and checked the host matched the etcd Service each time. helm lint is clean. Bumped the chart to 2.19.1.

… wait-etcd

The etcd host was built as <release>-etcd, which misses etcd.nameOverride,
etcd.namespaceOverride and release names that already contain etcd. Use the
etcd chart's own name helpers so both point at the Service it creates.

Fixes apache#1049

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@cvas22
cvas22 force-pushed the fix/etcd-service-name-1049 branch from 3d972fc to 6eed6fa Compare November 20, 2026 09:26

@moonming moonming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix, @cvas22! I checked the two original cases with Helm: demo with etcd.nameOverride=store, and a release named demo-etcd. On master, APISIX and wait-etcd use the wrong Service name; with this branch, both point to the Service rendered by the etcd subchart.

Before merging, could you please:

  1. Add regression coverage to test/render/etcd-access.sh for those two cases, asserting that the ConfigMap host and wait-etcd target match the rendered Service name, rather than checking only the NetworkPolicy label.
  2. Update the now-stale APISIX does not find etcd under an etcd.nameOverride error message and its test expectation.

The namespaceOverride DNS change looks reasonable, but this PR does not need to claim complete cross-namespace support: NetworkPolicy and Secret references have separate namespace constraints. We can handle that independently.

The chart 3.1.1 bump looks right. Thanks again!

… error

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@cvas22

cvas22 commented Nov 23, 2026

Copy link
Copy Markdown
Author

Added render tests for both cases (nameOverride=store on demo, and a release named demo-etcd) that compare the ConfigMap host and the wait-etcd target with the Service the etcd subchart renders, and updated the stale error message and its test, in 38b4624. Agreed on leaving the cross-namespace NetworkPolicy and Secret parts for a separate PR. thx

@moonming moonming left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick update, @cvas22! The new tests cover both original cases and compare the ConfigMap and wait-etcd against the actual Service. I ran the full render suite locally: 93 checks passed. Running the new tests against unchanged master produces the expected five failures. CI on 38b4624 is green. Approving.

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.

APISIX uses the wrong bundled etcd Service name with nameOverride or a release name containing etcd

2 participants