Skip to content
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-956: fix problems with TLS certificate renewal #1287

Merged
merged 18 commits into from
Sep 11, 2023
Merged

Conversation

pooknull
Copy link
Contributor

@pooknull pooknull commented Aug 11, 2023

K8SPSMDB-956 Powered by Pull Request Badge

https://jira.percona.com/browse/K8SPSMDB-956

DESCRIPTION

Problem:
Certificate rotation brings the sharded cluster down.

Cause:
Cert-Manager detects certs would expire soon and triggers certificate rotation. The operator starts smartUpdate, which fails and leaves the mongos in the CrashLoopBackoff state.

Solution:
We should switch from self-signed certificates to CA-signed ones. The operator should create a self-signed issuer, a self-signed certificate, and use that certificate to create a CA issuer, which will be used to create certificates.

Additional fixes:

  • Updated github.com/jetstack/cert-manager v1.6.1 to github.com/cert-manager/cert-manager v1.12.3
  • Added tls-issue-cert-manager test
  • Removed isCA: true from mongo certificates

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are the manifests (crd/bundle) regenerated if needed?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

@pull-request-size pull-request-size bot added the size/L 100-499 lines label Aug 11, 2023
. "${test_dir}/../functions"
set_debug


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[shfmt] reported by reviewdog 🐶

Suggested change

@pull-request-size pull-request-size bot added size/XL 500-999 lines and removed size/L 100-499 lines labels Aug 18, 2023
@pooknull pooknull marked this pull request as ready for review August 31, 2023 09:27
inelpandzic
inelpandzic previously approved these changes Sep 5, 2023
Copy link
Collaborator

@hors hors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pooknull please check tls-issue-cert-manager test

@hors hors self-requested a review September 8, 2023 10:55
deploy/rbac.yaml Outdated
@@ -100,6 +100,7 @@ rules:
resources:
- issuers
- certificates
- certificates/status
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also update the bundle.yaml

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not have it at all. It is needed only for test.

e2e-tests/functions Outdated Show resolved Hide resolved
@hors hors requested review from hors and egegunes September 8, 2023 18:51
@JNKPercona
Copy link
Collaborator

Test name Status
arbiter passed
balancer passed
cross-site-sharded passed
data-at-rest-encryption passed
data-sharded passed
demand-backup passed
demand-backup-eks-credentials passed
demand-backup-physical passed
demand-backup-physical-sharded passed
demand-backup-sharded passed
expose-sharded passed
ignore-labels-annotations passed
init-deploy passed
finalizer passed
limits passed
liveness passed
mongod-major-upgrade passed
mongod-major-upgrade-sharded passed
monitoring-2-0 passed
multi-cluster-service passed
non-voting passed
one-pod passed
operator-self-healing-chaos passed
pitr passed
pitr-sharded passed
pitr-physical passed
recover-no-primary passed
rs-shard-migration passed
scaling passed
scheduled-backup passed
security-context passed
self-healing-chaos passed
service-per-pod passed
serviceless-external-nodes passed
smart-update passed
storage passed
tls-issue-cert-manager passed
upgrade passed
upgrade-consistency passed
upgrade-consistency-sharded passed
upgrade-sharded passed
users passed
version-service passed
We run 43 out of 43

commit: 021f368
image: perconalab/percona-server-mongodb-operator:PR-1287-021f368c

@hors hors merged commit a76717b into main Sep 11, 2023
8 checks passed
@hors hors deleted the dev/K8SPSMDB-956 branch September 11, 2023 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL 500-999 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants