-
Notifications
You must be signed in to change notification settings - Fork 207
PMM-14989 Retain state on client pod restart #954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ademidoff
wants to merge
21
commits into
PMM-HA-GA
from
PMM-14989-retain-state-on-client-pod-restart
+17
−4
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
7216cca
chore: add PMM_HA_NAMESPACE to statefulset
fabio-silva 5f72753
chore: use Downward API to expose namespace to pods
fabio-silva d61f8b3
Merge pull request #924 from percona/PMM-13860-finalize-ha-overview-d…
fabio-silva 71e656d
Merge pull request #925 from percona/PMM-15309-add-ch-datasource-user
ademidoff 331ccf5
Merge remote-tracking branch 'origin/main' into PMM-HA-GA
ademidoff c94c0ef
Update secret retrieval command in values.yaml
ademidoff 0766844
PMM-14665 Mark the PMM PostgreSQL cluster nodes as internal (#913)
ademidoff 267b0b7
Fix typo in PMM Client section of values.yaml
ademidoff f6089a6
docs: clarify pmmClient replica guidance
Copilot 3f0694e
PMM-15441 Fit the pmm-ha CI install back onto the Kind node (#946)
theTibi e15035d
PMM-15151: make PG and ClickHouse operators watch all namespaces (#868)
theTibi 1832c26
PMM-15149: support installing PMM-HA into multiple namespaces (#865)
theTibi 88ca133
PMM-14403 Finalize the HA resource limitations (#935)
theTibi 924116e
PMM-15394 Let HAProxy start without waiting for every PMM replica (#937)
theTibi bd385e9
PMM-15393 Let HAProxy scale beyond the worker-node count (#938)
theTibi 1b3de77
PMM-15301 Disable QAN for PMM HA's bundled PostgreSQL cluster (#940)
theTibi f37bb12
PMM-14989 Document the PMM Client chart parameters
ademidoff 6d80155
PMM-14989 Document the PMM Client chart parameters
ademidoff 683312b
Enhance pmmClient.forceRegistration description
ademidoff eee5963
PMM-14899 Refactor initContainer registration logic for PMM Client to…
ademidoff fa4dfac
Merge branch 'PMM-14989-retain-state-on-client-pod-restart' of ssh://…
ademidoff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These four lines are what make a client pod restart survivable — removing them regresses the case the PR title names.
With the default forceRegistration: false, the init container now runs pmm-agent setup on every pod recreation (a helm upgrade touching the pod template, node drain, eviction, scale down-and-up). The node name$(POD_NAMESPACE)-$ (POD_NAME) is stable and the PVC is retained, so pmm-managed returns AlreadyExists (managed/services/management/node.go:45-47) and setup calls os.Exit(1) (agent/commands/setup.go:163-164). The pod sets no restartPolicy, so kubelet retries the init container forever: Init:CrashLoopBackOff, the pmm-client container never starts, every Service on that Node goes dark.
forceRegistration: true isn't an escape — this gate ran before that flag was consulted, which is what confined it to the lost-volume recovery case it documents. Without it, Reregister: true makes pmm-managed run models.RemoveNode(..., models.RemoveCascade) (node.go:48) on every pod start, dropping the Node with every Service and Agent on it. So neither value works: false wedges the pod, true silently discards the delegated services.
The pinned image can't cover for it either: values.yaml:157 pins tag: "3.9.1", and v3.9.1:agent/commands/setup.go still has the bare if !cfg.Setup.SkipRegistration { register(cfg, l) }. PMM-15260 is unmerged.
Suggest restoring the gate and landing the removal separately, against a release that carries PMM-15260 with pmmClient.image.tag bumped to match. Note that PMM_AGENT_SETUP_SKIP_REGISTRATION=1 isn't a safe substitute: the admin→service_token swap happens inside register() and env overrides the stored file, so skipping it persists server.username: admin plus the admin password in plaintext to the volume.
Also worth updating in the same commit, since they document the behavior this removes: the comment at lines 44-48 ("only happens when the configuration file is missing") and values.yaml:166-167 ("a restarted pod keeps its Node and the Services configured on it"). And the PR body says "No template, value or default is changed here", which doesn't match this hunk.