Files
platform-core/services/platform-postgres/base/cluster.yaml
T
DongHyeonka 1c4ef9affd fix(platform-postgres): keep the tech-log pg_hba rules the cluster uses
The live platform-postgres Cluster has two pg_hba rules for the techlog
role that the repository does not declare. They were added outside the
repository for hyeonworks.com. Applying the current render would remove
them and the production backend could no longer reach its database.

Declare the same two rules, in the same position after the Keycloak
pair, and pin them with render invariants like the Gitea and Keycloak
pairs. The techlog DatabaseRole, Database, Secret and NetworkPolicies
stay outside this build root; where they belong is an owner decision
recorded in the 2026-11-11 maturity review.

Risk: none for the live cluster. The rendered Cluster now matches the
live object. A fresh install without the tech-log tenant gets two
rules for a role that does not exist, which PostgreSQL ignores.

Verification (desktop, Helm 3.19.4, Kustomize 5.8.1):
- render-phase1.sh with the old cluster.yaml and the new invariants
  fails: "the tech-log role must authenticate only to the tech-log
  database"; with the new cluster.yaml it passes.
- kubectl diff of the new render against the live cluster shows no
  Cluster change; only the pre-existing DatabaseRole default fields.
2026-11-11 23:39:58 +09:00

49 lines
1023 B
YAML

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: platform-postgres
labels:
app.kubernetes.io/name: platform-postgres
app.kubernetes.io/component: database
spec:
description: Shared platform PostgreSQL instance initialized for Gitea
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:17.9-standard-trixie
bootstrap:
initdb:
dataChecksums: true
database: gitea
owner: gitea
secret:
name: gitea-db-credentials
postgresql:
pg_hba:
- host gitea gitea all scram-sha-256
- host all gitea all reject
- host keycloak keycloak all scram-sha-256
- host all keycloak all reject
- host techlog techlog all scram-sha-256
- host all techlog all reject
storage:
size: 20Gi
managed:
services:
disabledDefaultServices:
- ro
- r
affinity:
enablePodAntiAffinity: false
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: "2"
memory: 4Gi