The tech-log tenant needs objects inside platform namespaces: its database and role, ingress to Postgres and AIStor, blackbox probes, alert rules, a dashboard and two observability NetworkPolicies. They were only ever applied with kubectl and no repository holds them, so a deleted object cannot be recreated and a platform re-apply can drop tech-log access without anyone noticing. Declare them in services/tenants/techlog, copied from each object's last-applied configuration. The dashboard follows the repository's dashboard pattern (JSON file + configMapGenerator, same name, same labels). The hyeonworks-prod Namespace moves here as the tenant boundary and gets PSA enforce=baseline, warn/audit=restricted. Rejected: enforce=restricted now. A server dry-run shows all three tech-log pods would violate it; baseline has zero violations. Risk: the render matches the live objects exactly except the added PSA labels. The pg_hba rules and the Secret stay out of this root (Cluster owner and Git policy). Verification (desktop): - render-tenants-and-policies.sh passes. - kubectl diff of the render shows only the Namespace PSA labels. - kubectl label --dry-run=server enforce=baseline: no warnings.
56 lines
1.1 KiB
YAML
56 lines
1.1 KiB
YAML
apiVersion: postgresql.cnpg.io/v1
|
|
kind: Database
|
|
metadata:
|
|
name: platform-postgres-techlog
|
|
namespace: platform-data
|
|
spec:
|
|
cluster:
|
|
name: platform-postgres
|
|
databaseReclaimPolicy: retain
|
|
ensure: present
|
|
name: techlog
|
|
owner: techlog
|
|
---
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
kind: DatabaseRole
|
|
metadata:
|
|
name: platform-postgres-techlog
|
|
namespace: platform-data
|
|
spec:
|
|
bypassrls: false
|
|
cluster:
|
|
name: platform-postgres
|
|
connectionLimit: 30
|
|
createdb: false
|
|
createrole: false
|
|
databaseRoleReclaimPolicy: retain
|
|
login: true
|
|
name: techlog
|
|
passwordSecret:
|
|
name: techlog-db-credentials
|
|
replication: false
|
|
superuser: false
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: allow-techlog-backend
|
|
namespace: platform-data
|
|
spec:
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: hyeonworks-prod
|
|
podSelector:
|
|
matchLabels:
|
|
app: techlog-backend
|
|
ports:
|
|
- port: 5432
|
|
protocol: TCP
|
|
podSelector:
|
|
matchLabels:
|
|
cnpg.io/cluster: platform-postgres
|
|
policyTypes:
|
|
- Ingress
|