Skip to content

K8SPG-944 delete pmm2#1692

Open
nmarukovich wants to merge 6 commits into
mainfrom
K8SPG-944_delete_pmm2
Open

K8SPG-944 delete pmm2#1692
nmarukovich wants to merge 6 commits into
mainfrom
K8SPG-944_delete_pmm2

Conversation

@nmarukovich

@nmarukovich nmarukovich commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

  • 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?
  • Are all needed new/changed options added to the Helm Chart?
  • 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?

@@ -1,24 +0,0 @@
apiVersion: kuttl.dev/v1beta1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

these 2 tests are not identical

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I moved monitoring-pmm3 test to monitoring test.

Comment thread percona/pmm/pmm.go
}

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread percona/pmm/pmm_test.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread deploy/secrets.yaml
stringData:
PMM_SERVER_KEY: ""
#PMM_SERVER_TOKEN: ""
PMM_SERVER_TOKEN: ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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:

log.Info(fmt.Sprintf("Can't enable PMM: %s", err.Error()))

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🤔

@nmarukovich nmarukovich changed the title K8 spg 944 delete pmm2 K8SPG-944 delete pmm2 Jul 21, 2026
@mayankshah1607
mayankshah1607 requested a review from Copilot July 22, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_KEY enablement path; PMM now enables only when PMM_SERVER_TOKEN is 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-pmm3 suite.

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.

Comment thread percona/pmm/pmm.go
}

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)
@JNKPercona

Copy link
Copy Markdown
Collaborator
Test Name Result Time
backup-enable-disable passed 00:00:00
builtin-extensions passed 00:00:00
cert-manager-tls passed 00:00:00
custom-envs passed 00:00:00
custom-tls passed 00:00:00
database-init-sql passed 00:00:00
demand-backup passed 00:00:00
demand-backup-offline-snapshot passed 00:00:00
dynamic-configuration passed 00:00:00
finalizers passed 00:00:00
init-deploy passed 00:00:00
huge-pages passed 00:00:00
major-upgrade-14-to-15 passed 00:00:00
major-upgrade-15-to-16 passed 00:00:00
major-upgrade-16-to-17 passed 00:00:00
major-upgrade-17-to-18 passed 00:00:00
ldap passed 00:00:00
ldap-tls passed 00:00:00
monitoring passed 00:00:00
one-pod passed 00:00:00
operator-self-healing passed 00:00:00
pgbouncer-mtls passed 00:00:00
pitr passed 00:00:00
scaling passed 00:00:00
scheduled-backup passed 00:00:00
self-healing passed 00:00:00
sidecars passed 00:00:00
standby-pgbackrest passed 00:00:00
standby-streaming passed 00:00:00
start-from-backup passed 00:00:00
tablespaces passed 00:00:00
telemetry-transfer passed 00:00:00
upgrade-consistency passed 00:00:00
upgrade-minor passed 00:00:00
users passed 00:00:00
migration-from-crunchy-standby passed 00:00:00
migration-from-crunchy-pv passed 00:00:00
migration-from-crunchy-backup-restore passed 00:00:00
Summary Value
Tests Run 38/38
Job Duration 00:05:53
Total Test Time N/A

commit: 5cd0100
image: perconalab/percona-postgresql-operator:PR-1692-5cd01006e

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.

5 participants