fix: allow basketball-api ingress to postgres namespace (#187) #212
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!212
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "187-migrate-basketball-api-postgres-to-cnpg"
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
basketball-apinamespace to the CNPG postgres namespace network policy ingress allow listpal-e-postgres-rw.postgres.svc.cluster.localChanges
terraform/network-policies.tf-- addbasketball-apito thenetpol_postgresingress rules (1 line addition, follows existing pattern)tofu plan Output
Test Plan
tofu fmtpassestofu applythis change first (network policy must be in place before basketball-api connects to CNPG)kubectl get networkpolicy -n postgres -o yamlshowsbasketball-apiin ingress rulesReview Checklist
Related Notes
forgejo_admin/pal-e-deploymentsbranch187-migrate-basketball-api-postgres-to-cnpgpal-e-services#33(CNPG cluster manifest restored to source control)project-westside-basketball-- the project this work belongs toQA Review
Diff: 1 file changed, 1 insertion, 0 deletions.
Findings
netpol_postgres. No syntax issues.basketball-apimatches the namespace used in other network policies (e.g.,netpol_keycloakline 149 already referencesbasketball-apias an ingress source).pal-e-docs(app consumer) andcnpg-system(infrastructure), consistent with the grouping pattern in this block.Plan: 0 to add, 1 to change, 0 to destroy.Updates the existingnetpol_postgresresource in-place.Nits
None.
VERDICT: APPROVE
PR #212 Review
DOMAIN REVIEW
Tech stack: Terraform (OpenTofu) -- Kubernetes NetworkPolicy manifest via
kubernetes_manifestresource.Pattern compliance: The change adds one ingress rule to
netpol_postgresallowing thebasketball-apinamespace to reach pods in thepostgresnamespace. The syntax exactly matches the existing pattern used bypal-e-docs,cnpg-system, andmonitoringentries in the same resource. Indentation, brace structure, andnamespaceSelector.matchLabelsusage are identical to all other netpol resources in the file.Insertion position:
basketball-apiis inserted betweenpal-e-docsandcnpg-system. Alphabetical ordering is not enforced across the file (other netpol resources don't sort alphabetically either), so this is fine. The grouping is logical -- application namespaces first, then system namespaces.Terraform style: The change is
tofu fmtcompliant -- uses 2-space indentation consistent with the rest ofnetwork-policies.tf. No variable naming or module structure changes.k8s security: The policy follows least-privilege -- only
basketball-apinamespace is being granted ingress, not a broad wildcard. ThenamespaceSelectorwithmatchLabelsonkubernetes.io/metadata.nameis the correct, specific selector. No privileged access, no RBAC changes.State safety:
tofu planoutput in the PR body shows0 to add, 1 to change, 0 to destroy-- in-place update to the existingnetpol_postgresresource. No state-breaking changes.Scope: The change is exactly 1 line in 1 file. No scope creep. The PR correctly identifies this as a prerequisite for the companion
pal-e-deploymentsPR that will switch the connection string.Observation (not a blocker): Issues #189 (mcd-tracker) and #190 (pal-e-mail) are both closed, implying those services were migrated to CNPG. However, neither
mcd-trackernorpal-e-mailappear in thenetpol_postgresingress list. If they connect to CNPG via the postgres namespace, they would need similar netpol entries. This may already be tracked or handled differently (e.g., they might use a different connection path), but worth verifying.BLOCKERS
None.
NITS
None. The change is minimal, correct, and follows the established pattern precisely.
SOP COMPLIANCE
187-migrate-basketball-api-postgres-to-cnpgreferences #187)tofu planoutput included (per repo PR conventions)tofu fmtpasses (per Test Plan checklist)PROCESS OBSERVATIONS
tofu planoutput confirms no resource creation or destruction. Rollback is trivial (remove the line).tofu applymust happen before the companion PR switches the connection string. The verification step (kubectl get networkpolicy -n postgres -o yaml) is appropriate.VERDICT: APPROVED