Skip to content

K8SPG-553: Allow setting root CA manually #876

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

Merged
merged 15 commits into from
Sep 6, 2024
Merged

K8SPG-553: Allow setting root CA manually #876

merged 15 commits into from
Sep 6, 2024

Conversation

pooknull
Copy link
Contributor

@pooknull pooknull commented Aug 27, 2024

K8SPG-553 Powered by Pull Request Badge

https://perconadev.atlassian.net/browse/K8SPG-553
https://perconadev.atlassian.net/browse/K8SPG-555

DESCRIPTION

K8SPG-555: The operator will create a different ca secret per cluster with the name <cluster-name>-cluster-ca-cert instead of pgo-root-cacert

K8SPG-553: Add a .spec.secrets.customRootCATLSSecret field, which is used to specify data about the CA secret to be used by a cluster.

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?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • 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 PG version?
  • Does the change support oldest and newest supported Kubernetes version?

kubectl create namespace cert-manager || :
kubectl label namespace cert-manager certmanager.k8s.io/disable-validation=true || :
kubectl apply -f "https://github.com/jetstack/cert-manager/releases/download/v${CERT_MANAGER_VER}/cert-manager.yaml" --validate=false || : 2>/dev/null
if [ "$OPENSHIFT" == "4.10" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we do not support OPENSHIFT 4.10 long time ago

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pooknull pooknull marked this pull request as ready for review August 27, 2024 11:11
@pooknull pooknull requested a review from hors August 27, 2024 11:14
Copy link
Contributor

@egegunes egegunes left a comment

Choose a reason for hiding this comment

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

I don't see the results of new test (custom-tls), we need to add it to csv files

@pooknull pooknull requested a review from egegunes August 29, 2024 14:56
inelpandzic
inelpandzic previously approved these changes Sep 4, 2024
// The secret containing the root CA certificate and key for
// secure connections to the PostgreSQL server. It will need to contain the
// CA TLS certificate and CA TLS key with the data keys set to
// root.crt and root.key, respectively.
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't forget to have this in our docs as well I think. @fiowro

egegunes
egegunes previously approved these changes Sep 4, 2024
// RootCertSecret is the default root certificate secret name
RootCertSecret = "pgo-root-cacert" /* #nosec */
// RootCertSecret = "pgo-root-cacert" /* #nosec */
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we commented it. Should we delete it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We comment unused crunchy code to simplify the merge process, as seen here:

// K8SPG-330: Keep this commented in case of conflicts.
// We don't want to delete TLS secrets on cluster deletion.
// if err == nil {
// err = errors.WithStack(r.setControllerReference(cluster, intent))
// }

@JNKPercona
Copy link
Collaborator

Test name Status
custom-extensions passed
custom-tls passed
demand-backup passed
finalizers passed
init-deploy passed
major-upgrade passed
monitoring passed
one-pod passed
operator-self-healing passed
pitr passed
scaling passed
scheduled-backup passed
self-healing passed
start-from-backup passed
tablespaces passed
telemetry-transfer passed
upgrade-consistency passed
upgrade-minor passed
users passed
We run 19 out of 19

commit: 4db807a
image: perconalab/percona-postgresql-operator:PR-876-4db807af8

@hors hors merged commit 269e31b into main Sep 6, 2024
26 checks passed
@hors hors deleted the dev/K8SPG-553 branch September 6, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants