fix: replace deprecated CNPG enablePodMonitor with manual PodMonitor #104
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-platform!104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "103-fix-replace-deprecated-cnpg-enablepodmon"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
enablePodMonitor = truefrom CNPG cluster spec (deprecated in 1.28)PodMonitorkubernetes_manifest resource with proper selector labelsChanges
terraform/main.tf-- CNPG cluster monitoring section:enablePodMonitorset tofalseterraform/main.tf-- Newkubernetes_manifest.woodpecker_postgres_podmonitorresource with PodMonitor spectofu plan Output
No plan output available in worktree (no kubeconfig). Expected changes:
Test Plan
tofu fmt -check -recursivepasseskubectl get podmonitor -n woodpeckershows woodpecker-dbReview Checklist
Related
todo-cnpg-metrics-exporterReview: PASS
Scope: 1 file, 35 additions, 1 deletion -- tightly scoped to CNPG monitoring.
Findings:
enablePodMonitorcorrectly set tofalse(disables deprecated auto-generated PodMonitor)kubernetes_manifest.woodpecker_postgres_podmonitorresource has correct apiVersion (monitoring.coreos.com/v1), selector labels (cnpg.io/cluster,cnpg.io/podRole), anddepends_onwoodpecker_postgresandwoodpecker_postgres_scheduled_backuptofu fmt -check -recursivepassesMinor nit (non-blocking): Code comment says "Manual PodMonitor with TLS config" but the PodMonitor uses plain HTTP. This documents the investigation history but could be clarified in a future pass.
No fixes needed. Ready for merge.
PR #104 Stale PR Audit
FINDINGS
Both changes proposed by this PR are NOT yet in main and are still needed:
1.
enablePodMonitor = false-- Main still hasenablePodMonitor = trueatterraform/main.tfline 1549. The PR's change tofalsehas not landed.2. Manual PodMonitor resource -- The
kubernetes_manifest.woodpecker_postgres_podmonitorresource does not exist anywhere in main. This is net-new infrastructure that replaces the deprecated CNPG auto-generated PodMonitor.The PR is marked
mergeable: true(clean merge possible against main).DOMAIN REVIEW (Terraform/k8s)
The PodMonitor spec looks correct:
monitoring.coreos.com/v1apiVersioncnpg.io/clusterandcnpg.io/podRolelabels for precise targetingmetricsmatches CNPG's built-in metrics exporter port namedepends_oncorrectly references the parent CNPG cluster resourcekubernetes_namespace_v1.woodpeckerOne observation: the PR description mentions "TLS config" in the comment block, but the actual PodMonitor spec does not include any TLS/scheme configuration in
podMetricsEndpoints. This is likely fine if CNPG exposes metrics over plain HTTP on port 9187, but worth confirming during apply validation.BLOCKERS
None. This is a clean, focused infrastructure fix.
NITS
RECOMMENDATION
REBASE and MERGE this PR. The changes are still needed, the branch merges cleanly, and the fix addresses the deprecated
enablePodMonitorpattern correctly.SOP COMPLIANCE
VERDICT: APPROVED