NetworkPolicy: allow pal-enterprises to Postgres and Keycloak #359
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
ldraney/pal-e-platform!359
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "357-networkpolicy-pal-enterprises"
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
pal-enterprisesnamespace to the Postgres and Keycloak NetworkPolicy ingress allowlistsChanges
terraform/network-policies.tf: addedpal-enterprisesnamespace tonetpol_keycloakingress rulesterraform/network-policies.tf: addedpal-enterprisesnamespace tonetpol_postgresingress rulestofu plan Output
Unable to run
tofu planlocally (requirestofu initwith backend credentials). The diff is two lines, following the exact pattern used by every other service in the file. Runtofu plan -lock=falsebefore applying.Test Plan
tofu plan -lock=falseand confirm only two new namespace entries appearReview Checklist
Related Notes
project-pal-enterprises— service onboarding step 4QA Review
Scope: 1 file changed, 2 lines added (
terraform/network-policies.tf)Findings
Pattern compliance: Both entries follow the exact same structure as every other namespace in the file --
namespaceSelectorwithkubernetes.io/metadata.namelabel match. No deviation from convention.Placement:
pal-enterprisesis inserted beforemonitoringin both policies, keepingmonitoringas the last entry (consistent with the ordering pattern in other policies where monitoring is always last).Keycloak policy (line 151): Added between
westside-ai-assistantandmonitoring. Correct -- pal-enterprises needs Keycloak for OIDC auth.Postgres policy (line 175): Added between
basketball-apiandcnpg-system. Correct -- pal-enterprises needs Postgres for its database.No unrelated changes: The branch commit (
eea81ef) only touchesnetwork-policies.tf. The Forgejo diff also showsdocs/superpowers/specs/2026-04-10-westside-admin-design.mdbut that is a pre-existing commit onmain(7f5f627) -- not introduced by this branch.Formatting:
tofu fmtwas run. No formatting drift.Checklist
Note
tofu plan -lock=falsecould not be run (requires initialized backend with credentials). Recommend running plan before merge to confirm only twokubernetes_manifestresources show an in-place update.VERDICT: PASS
PR #359 Review
DOMAIN REVIEW
Tech stack: Terraform / Kubernetes NetworkPolicy
The core change is two single-line additions to
terraform/network-policies.tf, adding thepal-enterprisesnamespace to the Keycloak and Postgres NetworkPolicy ingress allowlists. Both lines follow the exact same pattern used by every other namespace entry in the file:Terraform checks:
basketball-api,westside-ai-assistant,pal-e-app).monitoring(last entry). Postgres entry is inserted beforecnpg-system. Both maintain the existing ordering convention (services first, infrastructure last).tofu fmtcompliance: The indentation and spacing match the surrounding code exactly.k8s security checks:
pal-enterprisesnamespace to Keycloak and Postgres. This is the minimum required for a Rails app using OIDC auth and a Postgres database. No overly broad selectors.BLOCKERS
1. Scope creep: unrelated design spec document (183 lines)
The diff includes a brand-new file
docs/superpowers/specs/2026-04-10-westside-admin-design.md(183 additions) that has nothing to do with issue #357 ("Add pal-enterprises to NetworkPolicy allowlist"). This is a full design specification for awestside-adminapplication -- a completely separate project. It covers SvelteKit architecture, Keycloak SSO, basketball-api endpoints, Playwright tests, and deployment topology.This file:
terraform/network-policies.tf)pal-enterprisesnamespace or its NetworkPolicy accessThis is a clear scope-creep violation. The design spec should be committed in its own PR or in whatever issue tracks the westside-admin project.
Verdict on blockers: The Terraform changes themselves are clean and correct. The scope creep is the only blocker. Remove the unrelated design spec from this PR, or document why it belongs here.
NITS
The PR body says "changed_files" implies only
terraform/network-policies.tf, but the actual Changes section does not mention the design spec at all. If the spec is intentionally included, the Changes section should list it.The PR body's Test Plan is solid for the Terraform changes. The note about being unable to run
tofu planlocally is honest and acceptable -- the pattern is two lines and mechanically verifiable from the diff alone.The Keycloak NetworkPolicy currently allows
basketball-api,westside-ai-assistant, and nowpal-enterprises. Consider whetherwestside-admin(referenced in the included design spec) will also need Keycloak access soon -- that would be a separate issue/PR, but worth noting for sequencing.SOP COMPLIANCE
357-networkpolicy-pal-enterprisesfollows{issue-number}-{kebab-case-purpose}project-pal-enterprisesPROCESS OBSERVATIONS
tofu plan -lock=falseshould be run before applying. This is the right pre-apply verification step.VERDICT: NOT APPROVED
The two Terraform lines are correct and follow established patterns. The single blocker is the unrelated
docs/superpowers/specs/2026-04-10-westside-admin-design.mdfile (183 lines) included in a PR scoped to NetworkPolicy changes for pal-enterprises. Remove it from this branch and the PR is clean to merge.