This example bootstraps the full stack from one ApplicationSet:
- CloudNativePG operator
coder-k8soperator stack (CRDs + RBAC + deployment)- CloudNativePG PostgreSQL
Cluster CoderControlPlane
- A Kubernetes cluster
kubectlconfigured for that cluster- Argo CD installed (including the ApplicationSet controller)
- Argo CD v2.6+ (required for Application
sourcesinapps/01-coder-k8s-operator.yaml)
kubectl apply -f examples/argocd/applicationset.yamlThat creates:
ApplicationSetcoder-k8s-stack- parent
Applicationcoder-k8s-stack - child Applications in
examples/argocd/apps/
apps/00-cnpg-operator.yaml and apps/01-coder-k8s-operator.yaml are synced in wave 0, and apps/02-coder-cloudnativepg.yaml in wave 1.
The CloudNativePG example manifests (examples/cloudnativepg/) also include resource-level sync waves so PostgreSQL is applied before CoderControlPlane.
kubectl -n argocd get applications
kubectl -n coder wait --for=condition=Ready cluster/coder-db --timeout=10m
kubectl -n coder rollout status deployment/coder --timeout=10mkubectl -n coder port-forward svc/coder 3000:80Open http://localhost:3000/setup and complete the setup flow.
- This example tracks
https://github.com/coder/coder-k8s.gitatmainfor child apps. UpdaterepoURLandtargetRevisioninexamples/argocd/apps/*.yamlif you want to pin to a tag or use a fork. apps/00-cnpg-operator.yamlusestargetRevision: "*"for the CloudNativePG chart. Pin this to a specific chart version for reproducibility.
kubectl -n argocd delete applicationset coder-k8s-stackDepending on your storage class reclaim policy, PVCs from PostgreSQL may remain after cleanup.