Files
platform-core/services/tenants/techlog
DongHyeonka ebdf33f072 feat(tenants): declare the tech-log objects inside platform namespaces
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.
2026-11-12 00:29:18 +09:00
..

tech-log 테넌트 — 플랫폼 쪽 객체

tech-log(hyeonworks.com 운영)가 플랫폼을 쓰려면 플랫폼 namespace 안에 허용 객체가 있어야 한다. 이 빌드 루트가 그 객체를 소유한다. 앱 자체(Deployment·Service·Ingress·ServiceMonitor·앱 namespace 안의 NetworkPolicy)는 tech-log 저장소의 deploy/가 소유한다.

2026-11-11 점검(docs/reviews/2026-11-11-k3s-maturity-review.md 4.3절) 전까지 이 객체들은 kubectl apply로만 들어가 있었고 어느 저장소에도 없었다. 처음 내용은 라이브 객체의 last-applied-configuration을 그대로 옮겼다. 라이브와 다른 것은 hyeonworks-prod의 PSA 라벨뿐이다.

파일 객체
namespace.yaml Namespace hyeonworks-prod: 관측 대상 라벨, PSA enforce=baseline·warn=restricted·audit=restricted
platform-data.yaml techlog Database와 DatabaseRole(로그인만, 연결 30), Postgres로 들어오는 ingress
object-storage.yaml AIStor 9000으로 들어오는 ingress
observability-probes.yaml blackbox Probe 둘(공개 HTTPS, 내부 readiness)
observability-rules.yaml PrometheusRule techlog 일곱 개
dashboards/techlog-operations.json Grafana 대시보드(grafana-dashboard-techlog ConfigMap으로 생성)
observability-network-policies.yaml blackbox → readiness, Prometheus → management scrape egress

여기에 없는 것

  • platform-data/platform-postgres의 pg_hba techlog 두 줄: Cluster 객체는 services/platform-postgres가 소유한다.
  • Secret: platform-data/techlog-db-credentials(kubernetes.io/basic-auth, username은 정확히 techlog)는 DatabaseRole이 참조한다. 앱 쪽 hyeonworks-prod/hyeonworks-secrets는 tech-log가 소유한다. 둘 다 Git에 두지 않는다.

PSA

enforce=baseline은 2026-11-12에 서버 dry-run(kubectl label --dry-run=server)으로 위반 0을 확인하고 붙였다. restricted로 강제하면 지금 파드 셋(redis, backend, frontend)이 모두 걸린다 (allowPrivilegeEscalation, capabilities, runAsNonRoot, seccomp). tech-log 쪽 securityContext가 고쳐진 뒤 같은 dry-run이 경고 없이 통과하면 enforce를 restricted로 올린다.

렌더·적용

bash scripts/validate/render-tenants-and-policies.sh
kubectl kustomize services/tenants/techlog | kubectl diff -f -
kubectl apply -k services/tenants/techlog

새로 설치할 때는 이 루트를 tech-log deploy/보다 먼저 적용한다(namespace를 여기서 만든다).