1# ============================================================================= 2# AI Software Factory — kustomization (cluster-local deployment) 3# 4# Usage: 5# kubectl apply -k infrastructure/kubernetes/ 6# 7# Changing the image tag: 8# The image tag is a single variable in the `images:` block below (all four 9# images share the same tag, matching the release pipeline). Bump it by 10# editing `newTag` here (or in CI: `kustomize edit set image ...` / a 11# small script), then re-apply. The manifests themselves always say 12# `:TAG` and kustomize substitutes the value here — that is the single 13# source of truth for the deployed tag. 14# 15# Secrets: 16# `factory-secrets` and `factory-db` are NOT defined here. Create them 17# before the first apply (see secret.example.yaml for the strategy). 18# The apply of this directory will fail on envFrom references until they 19# exist — by design, so a half-configured cluster never runs. 20# ============================================================================= 21apiVersion: kustomize.config.k8s.io/v1beta1 22kind: Kustomization 23 24namespace: factory 25 26commonLabels: 27 app.kubernetes.io/part-of: ai-software-factory 28 29resources: 30 - namespace.yaml 31 - configmap.yaml 32 # ---- PostgreSQL + PITR / backup (TASK-0135) ------------------------------ 33 - postgres/statefulset.yaml # StatefulSet postgres + Service factory-db 34 - postgres/configmap.yaml # PITR config: archive_command, wal-g shims 35 - postgres/cronjob-backup.yaml # daily base backup, 05:00 UTC (wal-g) 36 - postgres/cronjob-opensearch-snapshot.yaml # daily OS snapshot, 05:30 UTC 37 - postgres/pgbouncer.yaml # transaction-mode pooler (per-app pool_size) 38 - postgres/replica.yaml # read replica (hot standby) for db.read() 39 # NOT a k8s object (do not add): postgres/walg-iam-policy.yaml — the IAM 40 # policy document for the backup identity (see its header). 41 # ------------------------------------------------------------------------- 42 - redis.yaml 43 - api.yaml 44 - web.yaml 45 - worker.yaml 46 - realtime.yaml 47 - ingress.yaml 48 - pdb.yaml 49 # ---- Observability (TASK-0135, phase-15) ---------------------------------- 50 # NetworkPolicy lives in `factory` (the apps' namespace) → appended here. 51 # The monitoring STACK (observability/) is a STANDALONE APPLY ROOT — it must 52 # live in namespace `monitoring`, and this file's `namespace: factory` 53 # transformer would override the stack's pinned namespace onto `factory` 54 # (verified, kustomize v5.3.0), breaking the FQDN the factory-config 55 # configmap already points the apps' OTLP exporter at 56 # (otel-collector.monitoring.svc.cluster.local). Conflict recorded in the 57 # TASK-0135 report (AGENTS rule 29). Apply it separately: 58 # kubectl apply -k infrastructure/kubernetes/observability/ 59 - networkpolicy.yaml 60 # - secret.example.yaml # NEVER add this — see its header. Create real 61 # # secrets via SealedSecrets/SOPS/ExternalSecrets. 62 63# Single source of truth for the deployed image tag (see header). 64# CI (workflows/release.yml) renders this value from the git tag. 65images: 66 - name: ghcr.io/ai-software-factory/api 67 newTag: v0.1.0 68 - name: ghcr.io/ai-software-factory/web 69 newTag: v0.1.0 70 - name: ghcr.io/ai-software-factory/worker 71 newTag: v0.1.0 72 - name: ghcr.io/ai-software-factory/realtime 73 newTag: v0.1.0 74 75# Pod-template annotations are intentionally kept simple; per-resource label 76# overrides can be added here if you adopt a stricter label policy. 77