feat(stack): surface api-keys service env in self-managed stack - #1396
feat(stack): surface api-keys service env in self-managed stack#1396sparve-nv wants to merge 1 commit into
Conversation
Add a dig-based apikeys.env passthrough in global.yaml.gotmpl mirroring the existing podDisruptionBudget/startupProbe passthroughs, so operator config such as NVCF_NCA_ID set in environments/<env>.yaml reaches the api-keys release instead of being silently dropped. Helm deep-merges over the chart default env (AWS_REGION / SPRING_PROFILES_ACTIVE); unset renders byte-identical. Document the knob in base.yaml and add tests/apikeys-env-wiring.sh. Closes NVIDIA#1356 Signed-off-by: sparve <sparve@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 WalkthroughWalkthroughThe self-managed stack now passes optional ChangesSelf-managed api-keys environment overrides
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change allows operators to pass optional api-keys environment settings through the self-managed stack while preserving existing defaults when unset; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Surface the
api-keysservice environment (apikeys.env, e.g.NVCF_NCA_ID) in the self-managed stack so it can be set fromenvironments/<env>.yaml, instead of only via the secrets file or a patchedglobal.yaml.gotmpl. Whenapikeys.envis unset the stack emits nothing, so existing deployments are unchanged.Additional Details
The
api-keysrelease only receives../global.yaml.gotmpl+../secrets/<env>-secrets.yamlas chart values; the plain environment file reaches a release only whereglobal.yaml.gotmplre-emits it viadig … .Values. Theapikeys:block wiresimage,podDisruptionBudget, andstartupProbebut had no passthrough forapikeys.env, soapikeys.env.NVCF_NCA_IDset inenvironments/<env>.yamlwas read into.Valuesbut silently dropped.NVCF_NCA_IDis deployment-specific config an operator running the stack for their own tenant must set (it is the NCA the api-keys service authorizes keys against).This adds the missing stack passthrough. No chart change.
deploy/stacks/self-managed/global.yaml.gotmpl— add adig-basedapikeys.envpassthrough in theapikeys:block, mirroring the existingpodDisruptionBudget/startupProbepassthroughs.deploy/stacks/self-managed/environments/base.yaml— document the knob with a commentedapikeys.envexample.Example — set the operator's NCA:
Helm deep-merges the release values over the chart's
values.yaml, soNVCF_NCA_IDlands in the env ConfigMap alongside the chart defaults (AWS_REGION/SPRING_PROFILES_ACTIVE) without clobbering them.For the Reviewer
with dig "apikeys" "env" dict .Valuesemits nothing when unset, so an unset flag renders byte-identical and the chart default env still applies.dig … .Valuesshape already used in the sameapikeys:block forpodDisruptionBudgetandstartupProbe— add the knob, forward only when the operator supplies it.For QA
Automated test (
make test). Addeddeploy/stacks/self-managed/tests/apikeys-env-wiring.sh, wired into the offlinemake testtarget next toapi-env-wiring.sh. It follows the existing value-wiring pattern (pdb-value-wiring.sh/api-env-wiring.sh): it renders theapi-keysrelease values withhelmfile write-valuesand asserts, viayq, that (a)apikeys.envis absent by default (no override emitted), and (b)apikeys.env.NVCF_NCA_ID(plus an arbitraryCUSTOM_APIKEYS_ENVkey) is threaded through when the environment file setsapikeys.env.*.Manual render. Also rendered the real
api-keyschart env ConfigMap withhelm template … --show-only templates/configmap-env.yaml:apikeys.envunset): the ConfigMap carries the chart defaults only —AWS_REGION+SPRING_PROFILES_ACTIVE— confirming byte-identical behavior when the knob is unset.apikeys.env.NVCF_NCA_IDset): the ConfigMap carriesAWS_REGION+SPRING_PROFILES_ACTIVE+NVCF_NCA_ID, confirming the deep-merge adds the operator value without clobbering the defaults (and changes thechecksum/config-envannotation so the pod rolls on change).Issues
Fixes #1356
Checklist