c-06, c-07, c-08 - #127
Merged
Merged
Conversation
alix-graylog
marked this pull request as ready for review
July 28, 2026 15:43
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.
Summary
Makes the chart highly available by default (soft pod anti-affinity on all three tiers, PodDisruptionBudgets enabled, MongoDB switched to a production topology) and fixes two root-password bugs that made the admin credentials unusable after the first release.
Details
HA defaults (C-08)
podAntiAffinity(preferredDuringSchedulingIgnoredDuringExecution,topologyKey: kubernetes.io/hostname) on Graylog, Data Node and MongoDB. Soft rather than hard so single-node clusters still schedule. Settinggraylog.affinity/datanode.affinityreplaces the default.app: <crName>-svc, the only label the MongoDB Community operator applies to its pods. Selecting on the chart's own labels matches zero pods and silently disables spreading.enabled: true. Added the missingdatanode.enabledguard to the Data Node PDB.MongoDB topology (C-07)
replicas: 3, arbiters: 0. PSA (2 data + 1 arbiter) stallsw:majoritywrites when a data member is down; it remains available as a documented cost-optimized opt-in.NOTES.txt(gt 1 $mongoReplicaCount) that was true only atreplicas: 0, so the topology description never rendered-Secondary. The same argument-order bug in the odd-member warning is fixed too.Root password (new)
NOTES.txtprinted a freshly generated password on every upgrade whilesecrets.yamlkept the stored hash, so from revision 2 onward the chart displayed a password that had never worked.graylog.config.rootPasswordwas ignored on upgrade — the restore overwrote the SHA unconditionally, leaving no working way to change the root password on an existing release.graylog.storedRootPasswordShahelper: it returns the stored hash, or""when a password is explicitly configured orlookupfinds nothing.secrets.yamluses it as the single restore source andNOTES.txtconsults it before displaying anything. Corrected the ADDITIONAL NOTES text that claimed a generated password "will NOT persist across upgrades" — untrue since the hash is restored.External secret guard (C-06)
failwhenglobal.existingSecretNameis combined withmongodb.communityResource.enabled=true. That pairing skips backup-secret creation while the MongoDB CR still references it, so the operator hangs forever with no clear error.examples/values-existing-secret-external-mongodb.yaml.Docs
elasticsearch_replicasand index-set replicas, since with 0-replica index sets a single Data Node loss is permanent data loss rather than an outage.Linked issues
This fixes #116 (C-06) and partially addresses #14 (C-08 anti-affinity and PDB defaults).
#126 C-07 and the root-password bugs have no issue open yet.
PR Checklist
Please check the items that apply to your change.
Testing Checklist
Static Validation
helm lint ./charts/grayloghelm template graylog ./charts/graylog --validateInstallation
helm install graylog ./charts/graylogkubectl rollout status statefulset/grayloghelm test graylogFunctional (if applicable)
Upgrade (if applicable)
Specific to this PR
helm unittest charts/graylog— 144 tests across 17 suites, all passing. Newtests/affinity_test.yamlasserts each anti-affinity selector against the pod labels in the same rendered document, which is the check that catches a selector matching nothing. Newtests/graylog_secret_test.yamlcovers root-password rotation and the C-06 guard.app: <crName>-svc, with none of the chart's labels present) — the anti-affinity selector was written against labels that do not exist on those pods.helm upgrade --dry-run=serveragainst a live release: upgrade with no explicit password preserves the stored hash; upgrade withgraylog.config.rootPasswordrotates it; the pepper and MongoDB URI are unchanged on both paths.origin/mainin a clean worktree, so they are pre-existing rather than introduced here.helm test, and UI login. Thelookup-based restore branch cannot be reached from a unit test, so the live upgrade check is the only coverage for it and should be repeated before merge.Notes for reviewers
Behaviour changes for existing users — worth calling out in the release notes:
minAvailable; that is the intended protection, but it changes drain behaviour on small clusters.graylog.config.rootPasswordnow takes effect on upgrade. Anyone who previously set it and saw no change should expect the password to actually rotate on their next upgrade.