feat: add extraContainers, extraVolumes, extraVolumeMounts on alpha and zero#138
Open
krdabrowski wants to merge 1 commit into
Open
feat: add extraContainers, extraVolumes, extraVolumeMounts on alpha and zero#138krdabrowski wants to merge 1 commit into
krdabrowski wants to merge 1 commit into
Conversation
…nd zero Adds three optional values on both alpha and zero, all defaulting to []. Backward-compatible: helm template output is identical when the new keys are not set. Rendering convention matches the existing alpha.extraInitContainers: `tpl (toYaml .) $ | nindent <n>`, so Helm template expressions inside sidecar specs resolve at render time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #137.
What
Adds three optional values on both
alphaandzero, all defaulting to[]:extraContainers— sidecar containers, rendered into the pod spec after the primary Dgraph container.extraVolumes— pod-level volumes usable by the primary container and any sidecars.extraVolumeMounts— additional mounts on the primary Dgraph container (for e.g. shared cert/config material that sidecars also need).Rendering convention matches the existing
alpha.extraInitContainers(v25.0.0-preview6):tpl (toYaml .) $ | nindent <n>, which lets Helm template expressions inside sidecar specs resolve at render time.Why
Every non-trivial Dgraph deployment eventually needs a sidecar: log forwarder, mTLS metrics proxy (particularly under
client_auth_type: REQUIREANDVERIFY, where scrapers can't present client certs), local auth translator, mesh helper. Without native extension points users fork the chart or run postrender scripts, both of which drift on upgrades. Established charts (Bitnami, Grafana, kube-prometheus-stack, cert-manager) all exposeextraContainers; this PR aligns Dgraph with that convention.Diff overview
charts/dgraph/values.yaml— three new keys documented under each ofalphaandzero. Zero currently has noextraInitContainers; this PR does not add one to keep scope narrow, but the same convention would apply if wanted in a follow-up.charts/dgraph/templates/alpha/statefulset.yaml— three{{- with }}blocks.extraContainersrenders after the primary container'svolumeMountslist, beforeterminationGracePeriodSeconds.extraVolumeMountsextends the primary container'svolumeMounts.extraVolumesextends the pod'svolumeslist, beforevolumeClaimTemplates.charts/dgraph/templates/zero/statefulset.yaml— same three blocks in the equivalent positions.Total: +51 lines across three files, 0 lines removed.
Backward compatibility
All three values default to
[].helm templateoutput is byte-identical to today when the new keys are not set (verified locally withdiffagainstmain).Verification
helm lint charts/dgraph— passes.helm template charts/dgraphwith all three keys empty — produces the same rendered StatefulSets as before the change (verified viadiff: 0 differences).helm template charts/dgraph --set-json 'alpha.extraContainers=[{"name":"probe","image":"busybox:1.36","command":["sleep","3600"]}]'— renders the sidecar correctly in alpha's pod spec, beforeterminationGracePeriodSeconds.alpha.extraVolumesandalpha.extraVolumeMounts, rendering at the correct positions.zero.*with equivalent results.Not in this PR
zero.extraInitContainers— deferred; separate concern, easy follow-up if wanted.podSpec-level extensions (hostAliases,dnsConfig, etc.) — separate concern.