Skip to content

PMM-15149: support installing PMM-HA into multiple namespaces#865

Open
theTibi wants to merge 6 commits into
percona:mainfrom
theTibi:PMM-15149
Open

PMM-15149: support installing PMM-HA into multiple namespaces#865
theTibi wants to merge 6 commits into
percona:mainfrom
theTibi:PMM-15149

Conversation

@theTibi

@theTibi theTibi commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

The cluster-wide monitoring sub-charts (kube-state-metrics, prometheus-node-exporter) are already conditional on main, which makes it possible to run a second PMM-HA instance in another namespace (e.g. a DR / restore target or an isolated test instance) by disabling them and using a distinct Helm release name. This closes the remaining gaps so that path is clean and documented:

  • vmagent: gate the kube-state-metrics and node-exporter scrape jobs on the same kube-state-metrics.enabled / prometheus-node-exporter.enabled toggles. They were rendered unconditionally, so disabling the sub-charts left dangling scrape configs with no targets. Other jobs (kubelet, cadvisor, kube-apiserver, and the PMM components) are untouched.

  • README: add an "Installing into multiple namespaces" section - operators installed once (cluster-wide), a distinct release name per instance, and monitoring sub-charts disabled on secondary instances (node-exporter uses hostNetwork:9100, so only one set can run per node), plus per-namespace prerequisites (pmm-secret, backup-storage access).

  • .gitignore: ignore local-only value overrides (values-dev.yaml, values-*.local.yaml) so per-environment files containing real bucket/account/IRSA details are never committed.

Backward compatible: both monitoring sub-charts default to enabled, so existing single-namespace installs are unchanged. Verified with helm template (default keeps the jobs; disabled drops only the two gated jobs) and helm lint.

The cluster-wide monitoring sub-charts (kube-state-metrics, prometheus-node-exporter)
are already conditional on main, which makes it possible to run a second PMM-HA instance
in another namespace (e.g. a DR / restore target or an isolated test instance) by
disabling them and using a distinct Helm release name. This closes the remaining gaps so
that path is clean and documented:

- vmagent: gate the kube-state-metrics and node-exporter scrape jobs on the same
  `kube-state-metrics.enabled` / `prometheus-node-exporter.enabled` toggles. They were
  rendered unconditionally, so disabling the sub-charts left dangling scrape configs with
  no targets. Other jobs (kubelet, cadvisor, kube-apiserver, and the PMM components) are
  untouched.

- README: add an "Installing into multiple namespaces" section - operators installed once
  (cluster-wide), a distinct release name per instance, and monitoring sub-charts disabled
  on secondary instances (node-exporter uses hostNetwork:9100, so only one set can run per
  node), plus per-namespace prerequisites (pmm-secret, backup-storage access).

- .gitignore: ignore local-only value overrides (values-dev.yaml, values-*.local.yaml) so
  per-environment files containing real bucket/account/IRSA details are never committed.

Backward compatible: both monitoring sub-charts default to enabled, so existing
single-namespace installs are unchanged. Verified with `helm template` (default keeps the
jobs; disabled drops only the two gated jobs) and `helm lint`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Signed-off-by: theTibi <tkorocz@gmail.com>
@theTibi
theTibi requested review from a team, eleo007, hors, jvpasinatto and nmarukovich as code owners June 12, 2026 08:00
Copilot AI review requested due to automatic review settings June 12, 2026 08:00
@theTibi
theTibi requested a review from valmiranogueira as a code owner June 12, 2026 08:00
@theTibi
theTibi requested review from 4nte and JiriCtvrtka and removed request for a team June 12, 2026 08:01

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 enables running multiple pmm-ha Helm releases across different namespaces in the same Kubernetes cluster by ensuring optional cluster-wide monitoring components can be disabled cleanly, and by documenting the intended installation pattern.

Changes:

  • Gate VMAgent scrape jobs for kube-state-metrics and prometheus-node-exporter on the same *.enabled toggles that control the sub-charts.
  • Add a README section describing how to install multiple PMM-HA instances into different namespaces.
  • Update .gitignore to prevent committing local, environment-specific Helm values override files.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
charts/pmm-ha/templates/vmagent.yaml Conditionally renders kube-state-metrics and node-exporter scrape jobs based on sub-chart enablement flags.
charts/pmm-ha/README.md Documents a multi-namespace installation approach and the need for distinct release names / exporter settings.
.gitignore Ignores common local-only Helm values override files to reduce accidental secret/config commits.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread charts/pmm-ha/README.md
@theTibi
theTibi requested a review from ademidoff June 12, 2026 15:05
Comment thread .gitignore Outdated
Comment thread charts/pmm-ha/README.md Outdated
Comment thread charts/pmm-ha/README.md Outdated
Co-authored-by: Alex Demidoff <a@demidoff.me>
Copilot AI review requested due to automatic review settings June 23, 2026 09:54

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

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

Comment thread charts/pmm-ha/README.md Outdated
theTibi added 2 commits June 23, 2026 13:07
Disabling kube-state-metrics / prometheus-node-exporter on secondary instances does NOT
reuse the first instance's agents: each vmagent's KSM/node-exporter scrape jobs are scoped
to namespaces.names=[.Release.Namespace], so a secondary instance collects no
kube-state-metrics or node-exporter metrics at all (those live only in the first instance's
VictoriaMetrics). Reword the section + code-block comment to say so; note kubelet/cadvisor
(role: node) still provide basic node/container metrics, and that this is fine for a DR target.

Addresses review comments on PR percona#865.

Signed-off-by: theTibi <tkorocz@gmail.com>
…mple

Signed-off-by: theTibi <tkorocz@gmail.com>
Copilot AI review requested due to automatic review settings June 23, 2026 11:17

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

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

Comment thread charts/pmm-ha/templates/vmagent.yaml
Comment thread charts/pmm-ha/templates/vmagent.yaml
@theTibi
theTibi requested a review from ademidoff June 23, 2026 11:55
@theTibi
theTibi requested review from egegunes and pooknull as code owners July 3, 2026 16:09
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.

3 participants