apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: vibecarbon

resources:
  - namespace.yaml
  - network-policies.yaml
  # `config/` holds the vibecarbon-config ConfigMap (non-secret runtime
  # settings — service URLs, retention days, etc.). The previous
  # `secrets/` dir which bundled a Secret alongside the ConfigMap is
  # gone — the Secret is now applied at deploy time by either the
  # vibecarbon CLI or the .github/workflows/deploy.yml GitHub Action,
  # with field-manager=github-actions-deploy so Flux doesn't touch it.
  - config/
  # Note: hetzner-ccm and hetzner-csi are installed via cloud-init (master-init.sh)
  # Note: cert-manager is installed separately via infra/ kustomization
  # `db/` is the Postgres StatefulSet. It carries deploy-time placeholders
  # (image, wal-g prefix, S3 endpoint and region, StorageClass, the
  # wal-archive ConfigMap sha), so the deploy applies a rendered copy of this
  # tree (renderK8sBase in src/lib/deploy/k8s/k3s.js). The wal-g role is not
  # one of them: it is a file on the db volume, set from the CLI-owned
  # vibecarbon-db-role ConfigMap.
  - db/
  - app/
  - backup/
  # `registry/` runs a disk-backed image registry on the master node
  # (hostPort 5000 bound to the master's private IP, rendered by
  # renderK8sBase; Flux strips the Deployment, see flux/clusters/*). Sideload
  # remains primary for static workers, but cluster-autoscaler-spawned
  # workers don't exist at sideload time — they pull from this registry on
  # first schedule via the registries.yaml mirror config laid down in
  # cloud-init.
  - registry/
  # Note: cluster-autoscaler is installed separately by applyK3sManifests
  # (Phase 5) because it lives in `kube-system`, not `vibecarbon` — listing
  # it here would let this kustomization's `namespace: vibecarbon`
  # transformer rewrite its ServiceAccount/Role/RoleBinding/Deployment
  # into the wrong namespace. Apply with:
  #   kubectl apply -k carbon/k8s/base/cluster-autoscaler/
  # Mirrors the CCM/CSI pattern above.
  - traefik/

labels:
  - pairs:
      app.kubernetes.io/part-of: vibecarbon
