K8SPSMDB-1014: update cert-manager certs and issuers#1383
Merged
Conversation
tplavcic
previously approved these changes
Apr 3, 2024
nmarukovich
previously approved these changes
Apr 10, 2024
inelpandzic
reviewed
Apr 16, 2024
e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1160.yml
Show resolved
Hide resolved
inelpandzic
previously approved these changes
Apr 16, 2024
egegunes
previously approved these changes
Apr 16, 2024
Contributor
Author
|
It seems that the https://docs.percona.com/percona-operator-for-mongodb/TLS.html#update-certificates-without-downtime approach doesn't work with mongos. After the final recreation of secrets (step 12), the operator updates the cfg pods with new secrets. After all cfg pods have been updated, all mongos pods become unready with the following error in the logs: This is why I removed lines in this discussion: #1383 (comment). We shouldn't remove them. But we also need to find a way to update mongos correctly. My guess is that mongos only accepts the first part of the CA. |
Contributor
Author
|
The issue mentioned here: #1383 (comment) has been fixed in 8264390 Description has been updated. |
inelpandzic
reviewed
Apr 22, 2024
egegunes
previously approved these changes
Apr 22, 2024
inelpandzic
approved these changes
Apr 23, 2024
Collaborator
commit: f7f2d8d |
tplavcic
approved these changes
Apr 23, 2024
hors
approved these changes
Apr 23, 2024
11 tasks
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.
https://jira.percona.com/browse/K8SPSMDB-1014
DESCRIPTION
Problem:
After the update from
crVersion1.14.0to1.15.0, after certificate renewal, the operator is stuck failing when.spec.updateStrategyis set toSmartUpdate.When
updateStrategyis set toSmartUpdateand the cluster is updated from version1.14.0to1.15.0, after the certificate renewal cluster is stuck on smart update.Cause:
In version 1.15.0 we switched to the new certificate schema. For more info check the description of this PR: #1287. In this PR we didn't implement the update to the new certificate schema.
Certificates are not updated and we will still have the same problem we had in https://jira.percona.com/browse/K8SPSMDB-956.
Solution:
First of all, the operator should update the certificates. To do that, we should check if the cert-manager is installed. If it is, we should try to apply our changes.
After the changes, the operator will still face issues with smartUpdate, so it is recommended to create a migration mechanism as described in this guide if there are any changes made to the CA.: https://docs.percona.com/percona-operator-for-mongodb/TLS.html#update-certificates-without-downtime.
So, the migration will consist of the following actions:
cluster1-sslandcluster1-ssl-internalsecrets namedcluster1-ssl-oldandcluster1-ssl-internal-old.ca.crtfrom both old secrets and merge them into new secrets. Set values oftls.keyandtls.crtfrom old secrets to the new ones.ca.crtwas merged from old secrets.ca.crtof current secrets with theca.crtfromcluster1-ca-cert.percona.com/update-mongos-firstannotation to the cluster and recreate the secrets by deleting them. Cert-manager will recreate them.The
percona.com/update-mongos-firstannotation has been added to force the next smart update to be applied to mongos before mongod.This is necessary because mongos pods only accept the first part of the CA. After the secret recreation, all mongod pods will have the last part of the CA, and mongos won't be able to connect to them. So we should update the mongos pods before the mongod pods.
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
compare/*-oc.yml)?Config/Logging/Testability