-
Notifications
You must be signed in to change notification settings - Fork 149
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
K8SPSMDB-1014: update cert-manager certs and issuers #1383
Conversation
e2e-tests/upgrade-consistency-sharded-tls/compare/statefulset_some-name-rs0-1160.yml
Show resolved
Hide resolved
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. |
The issue mentioned here: #1383 (comment) has been fixed in 8264390 Description has been updated. |
commit: f7f2d8d |
https://jira.percona.com/browse/K8SPSMDB-1014
DESCRIPTION
Problem:
After the update from
crVersion
1.14.0
to1.15.0
, after certificate renewal, the operator is stuck failing when.spec.updateStrategy
is set toSmartUpdate
.When
updateStrategy
is set toSmartUpdate
and the cluster is updated from version1.14.0
to1.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-ssl
andcluster1-ssl-internal
secrets namedcluster1-ssl-old
andcluster1-ssl-internal-old
.ca.crt
from both old secrets and merge them into new secrets. Set values oftls.key
andtls.crt
from old secrets to the new ones.ca.crt
was merged from old secrets.ca.crt
of current secrets with theca.crt
fromcluster1-ca-cert
.percona.com/update-mongos-first
annotation to the cluster and recreate the secrets by deleting them. Cert-manager will recreate them.The
percona.com/update-mongos-first
annotation 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