K8SPG-944 delete pmm2#1692
Conversation
| @@ -1,24 +0,0 @@ | |||
| apiVersion: kuttl.dev/v1beta1 | |||
There was a problem hiding this comment.
why we deleted the pmm3 test, editing the pmm2 to to work for pmm3? We could just delete the pmm2 test and keep the pmm3 test. Am I missing anything?
There was a problem hiding this comment.
these 2 tests are not identical
There was a problem hiding this comment.
I moved monitoring-pmm3 test to monitoring test.
| } | ||
|
|
||
| return corev1.Container{}, errors.Errorf("can't enable PMM: neither %s for PMM3 nor %s for PMM2 exist in the provided secret or they are empty", secretToken, secretKey) | ||
| return corev1.Container{}, errors.Errorf("can't enable PMM: %s doesn't exist in the provided secret or it is empty (PMM2 is no longer supported, migrate to PMM3)", secretToken) |
There was a problem hiding this comment.
This error message does not make much sense. It is not that we are tracking that the PMM2 api key was used to show a message that proposes a migration to PMM3. I recommend we remove the (PMM2 is no longer supported, migrate to PMM3) completely.
There was a problem hiding this comment.
Since we are removing PMM2, PMM_SERVER_KEY is becoming just a random key in the secret. We should drop it from the codebase completely and adjust the test to do some behaviour that makes sense for the new situation. For example, here this test and the pmm3 when only token exists test are doing exactly the same thing now, given that PMM_SERVER_KEY is a random key.
| stringData: | ||
| PMM_SERVER_KEY: "" | ||
| #PMM_SERVER_TOKEN: "" | ||
| PMM_SERVER_TOKEN: "" |
There was a problem hiding this comment.
I was thinking what will happen if someone still has pmm2 which monitors their pg cluster and they upgrade to the new version.
Looks like the monitoring will stop working for them and they will have just an Info level log about PMM misconfiguration:
It's not something introduced in this PR but this PR makes it prominent. So I'm wondering if we should have a status condition or at least a Warn level log message about the misconfiguration🤔
There was a problem hiding this comment.
Pull request overview
This PR removes PMM2 support from the operator and standardizes monitoring on PMM3-only semantics (service token via PMM_SERVER_TOKEN), updating controller/unit/e2e coverage and build/release plumbing accordingly.
Changes:
- Removed PMM2 sidecar/container logic and
PMM_SERVER_KEYenablement path; PMM now enables only whenPMM_SERVER_TOKENis present and non-empty. - Consolidated image variables and related-image wiring to a single “pmm”/PMM3 image stream.
- Updated/merged E2E monitoring scenarios to use PMM server tokens and removed the separate
monitoring-pmm3suite.
Reviewed changes
Copilot reviewed 34 out of 38 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| percona/pmm/pmm.go | Drops PMM2 enablement and keeps only PMM3 sidecar construction using PMM_SERVER_TOKEN. |
| percona/pmm/pmm_test.go | Updates unit tests to reflect PMM2 removal and new helper signatures. |
| percona/controller/pgcluster/controller_test.go | Adjusts controller integration tests so PMM_SERVER_KEY-only secrets no longer enable the sidecar. |
| Makefile | Switches release substitutions and post-release version bumps to PMM3-only IMAGE_PMM_* variables. |
| installers/olm/distributions/redhat.sh | Removes PMM2 related image and renames to a single PMM related image reference. |
| e2e-tests/vars.sh | Removes PMM2 image vars; defaults PMM images to PMM3 tags. |
| e2e-tests/tests/monitoring/10-deleted-from-server-inventory.yaml | Removes an inventory cleanup E2E step. |
| e2e-tests/tests/monitoring/09-check-password-leak.yaml | Re-adds the (currently skipped) password leak check as a later step. |
| e2e-tests/tests/monitoring/08-check-password-leak.yaml | Removes the earlier duplicate of the skipped password leak step. |
| e2e-tests/tests/monitoring/08-check-mountpoint-expose.yaml | Adds an E2E check validating /pgdata mountpoint metrics are exposed in Prometheus. |
| e2e-tests/tests/monitoring/07-enable-pgstatmonitor-query-source.yaml | Tweaks timing for query-source switch validation. |
| e2e-tests/tests/monitoring/05-check-qan.yaml | Switches from API key to service token and expands metric assertions. |
| e2e-tests/tests/monitoring/04-update-pmm-server-token.yaml | Uses the unified token generator and patches the unified PMM secret. |
| e2e-tests/tests/monitoring/04-update-pmm-api-key.yaml | Removes PMM2 API-key update step. |
| e2e-tests/tests/monitoring/03-create-cluster.yaml | Ensures the PMM client image is explicitly set via IMAGE_PMM_CLIENT. |
| e2e-tests/tests/monitoring/02-create-pmm-secret.yaml | Creates the monitoring secret with PMM_SERVER_TOKEN instead of PMM_SERVER_KEY. |
| e2e-tests/tests/monitoring/02-assert.yaml | Minor normalization/formatting for secret assertion. |
| e2e-tests/tests/monitoring/01-assert.yaml | Removes an Event count field from assertions. |
| e2e-tests/tests/monitoring/00-assert.yaml | Minor normalization/formatting for operator deployment assertion. |
| e2e-tests/tests/monitoring-pmm3/99-remove-cluster-gracefully.yaml | Removes PMM3-specific E2E teardown step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/07-enable-pgstatmonitor-query-source.yaml | Removes PMM3-specific query-source test step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/06-check-pgstatstatements-query-source.yaml | Removes PMM3-specific pg_stat_statements verification step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/05-check-qan.yaml | Removes PMM3-specific QAN validation step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/04-assert.yaml | Removes PMM3-specific assertions (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/03-create-cluster.yaml | Removes PMM3-specific cluster creation step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/03-assert.yaml | Removes PMM3-specific cluster assertions (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/02-create-pmm-secret.yaml | Removes PMM3-specific secret creation step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/02-assert.yaml | Removes PMM3-specific secret assertion (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/01-deploy-pmm-server.yaml | Removes PMM3-specific PMM server deploy step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/01-assert.yaml | Removes PMM3-specific PMM server assertions (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/00-deploy-operator.yaml | Removes PMM3-specific operator deploy step (suite deleted). |
| e2e-tests/tests/monitoring-pmm3/00-assert.yaml | Removes PMM3-specific operator assertions (suite deleted). |
| e2e-tests/run-release.csv | Removes monitoring-pmm3 from the release E2E runlist. |
| e2e-tests/run-pr.csv | Removes monitoring-pmm3 from the PR E2E runlist. |
| e2e-tests/release_versions | Removes PMM2 image vars and keeps PMM3-only IMAGE_PMM_* entries. |
| e2e-tests/functions | Removes PMM2 API key generation; standardizes on PMM server token generation and PMM3 install path. |
| deploy/secrets.yaml | Updates example secret to include only PMM_SERVER_TOKEN. |
| .github/workflows/reviewdog.yml | Updates CR image validation to use IMAGE_PMM_CLIENT instead of IMAGE_PMM3_CLIENT. |
| } | ||
|
|
||
| return corev1.Container{}, errors.Errorf("can't enable PMM: neither %s for PMM3 nor %s for PMM2 exist in the provided secret or they are empty", secretToken, secretKey) | ||
| return corev1.Container{}, errors.Errorf("can't enable PMM: %s doesn't exist in the provided secret or it is empty (PMM2 is no longer supported, migrate to PMM3)", secretToken) |
…stgresql-operator into K8SPG-944_delete_pmm2
commit: 5cd0100 |
CHANGE DESCRIPTION
Problem:
Drop PMM2 entirely and make PMM3 the only supported
Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
percona/pmm: removed sidecarContainerV2() and the PMM_SERVER_KEY handling; Container() now only accepts PMM_SERVER_TOKEN. A secret with only PMM_SERVER_KEY no longer enables monitoring — reconciliation continues normally (the database is not affected) and the Operator logs: can't enable PMM: PMM_SERVER_TOKEN doesn't exist in the provided secret or it is empty (PMM2 is no longer supported, migrate to PMM3)
Percona-Lab/jenkins-pipelines#4279
CHECKLIST
Jira
Needs Doc) and QA (Needs QA)?Tests
Config/Logging/Testability