fix: add monitoring ingress to postgres NetworkPolicy #95
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!95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "94-re-enable-netpol-fix-postgres"
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
Postgres NetworkPolicy was missing
monitoringnamespace ingress, causing Prometheus to lose the postgres scrape target after NetworkPolicy re-enablement (37/38 UP, 1 DOWN). All other 8 namespace policies already had monitoring ingress.Changes
terraform/network-policies.tf— addmonitoringnamespace tonetpol_postgresingress rules (1 line)Test Plan
tofu planshows only postgres NetworkPolicy changingReview Checklist
tofu fmt -checkpassestofu validatepassesRelated
bug-kube-router-ipset-empty— root investigationsop-network-security— three-layer security architectureTofu Plan Output
PR #95 Review
DOMAIN REVIEW
Tech stack: Terraform (OpenTofu) / Kubernetes NetworkPolicies
Correctness: The one-line addition adds
monitoringnamespace ingress tonetpol_postgres, following the exact same HCL pattern used across all other policies in this file. The syntax matches perfectly --namespaceSelectorwithmatchLabelsonkubernetes.io/metadata.name.Consistency audit: I reviewed all 9 NetworkPolicy resources in
terraform/network-policies.tf. After this PR, 7 of 9 policies include monitoring ingress. The two that do not are:netpol_keycloak(line 119) -- no monitoring ingressnetpol_ollama(line 159) -- no monitoring ingressIf Prometheus has scrape targets in either of those namespaces, they would exhibit the same symptom (target DOWN). This is out of scope for this bug fix but worth noting as discovered scope.
Terraform style: The line follows
tofu fmtconventions (consistent indentation, trailing comma). PR body confirmstofu fmt -checkandtofu validateboth pass.k8s security: The change correctly scopes ingress to only the
monitoringnamespace via label selector -- no overly broad selectors, no{}podSelector on the source side. This is the right pattern.BLOCKERS
None.
This is infrastructure-as-code with no application logic, no user input handling, no secrets, and no auth paths. The single-line change is a NetworkPolicy ingress rule addition that matches the established pattern exactly. No BLOCKER criteria are triggered.
NITS
netpol_keycloakandnetpol_ollamalack monitoring ingress. If either namespace has Prometheus scrape targets, a follow-up issue should be filed. Not blocking this PR since the fix is correctly scoped to the reported symptom (postgres target DOWN).SOP COMPLIANCE
94-re-enable-netpol-fix-postgresreferences issue #94)bug-kube-router-ipset-empty) and SOP (sop-network-security)fix: add monitoring ingress to postgres NetworkPolicy)PROCESS OBSERVATIONS
VERDICT: APPROVED