KUBE-141: Remove stale mms.https.PEMKeyFile from Ops Manager config when TLS is disabled#1389
Open
Julien-Ben wants to merge 2 commits into
Open
KUBE-141: Remove stale mms.https.PEMKeyFile from Ops Manager config when TLS is disabled#1389Julien-Ben wants to merge 2 commits into
Julien-Ben wants to merge 2 commits into
Conversation
The mmsconfiguration binary only ever overwrote or appended OM_PROP_* properties in conf-mms.properties. When the conf directory outlives the container (e.g. a PVC mounted over /mongodb-ops-manager/conf), a property the operator stopped setting stayed in the file forever. Disabling TLS left mms.https.PEMKeyFile pointing at a secret that is no longer mounted, and Ops Manager could never start again (KUBE-141). Properties that are not already present in the file are now written in a BEGIN/END-delimited block that is stripped and rewritten on every container start, the same way custom JVM params are already handled.
The om_ops_manager_https suite now runs with a PVC mounted over /mongodb-ops-manager/conf and ends by removing spec.security, asserting Ops Manager comes back up on plain HTTP. This is the KUBE-141 topology, where a stale mms.https.PEMKeyFile used to crash-loop Ops Manager.
Contributor
MCK 1.10.0 Release NotesNew Features
Bug Fixes
|
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
Disabling TLS on a running Ops Manager (removing
spec.security) left the instance unable to start whenever the conf directory outlives the container — most commonly a user PVC mounted over/mongodb-ops-manager/conf, which the operator supports as a StatefulSet override (HELP-84463). The operator builds the new StatefulSet correctly, but themmsconfigurationbinary in the init-ops-manager image only ever overwrote or appendedOM_PROP_*properties inconf-mms.properties, never deleting one it stopped setting. The stalemms.https.PEMKeyFilethen points at a certificate secret that is no longer mounted and Ops Manager crash-loops in preflight. With the default emptyDir layout the conf directory is recreated on every rollout, which is why this never reproduced on kind.Solution: Operator-set properties not already present in the file are now written inside a BEGIN/END-delimited block that is stripped and rewritten on every container start, the same way custom JVM params are already handled in this binary. A property the operator stops setting disappears from the file instead of lingering forever.
A note for reviewers: this is admittedly a bit manual — operator-owned properties are tracked with custom BEGIN/END comment markers and rewritten by string manipulation, mirroring the existing JVM-params handling. The approach deserves a careful look; happy to discuss alternatives.
Deployments already broken by an older image have the stale property as a plain line outside any block; those still need the existing workaround (remove the line, or delete the conf PVC). The fix prevents the state from the first start on a fixed image.
Proof of Work
om_ops_manager_httpse2e now runs with a PVC mounted over the conf directory and ends with a disable-TLS stage:Checklist
skip-changeloglabel if not needed