This example bootstraps the full stack from one ApplicationSet.
The generated Argo CD Application uses multiple sources to deploy:
- CloudNativePG operator (Helm chart)
coder-k8soperator stack (config/crd/bases,config/rbac,deploy)- CloudNativePG PostgreSQL
Cluster CoderControlPlane
- A Kubernetes cluster
kubectlconfigured for that cluster- Argo CD installed (including the ApplicationSet controller)
- Argo CD v2.6+ (required for
spec.sourcesin the generated Application)
kubectl apply -f https://raw.githubusercontent.com/coder/coder-k8s/main/examples/argocd/applicationset.yamlThat creates:
ApplicationSetcoder-k8s-stack- generated
Applicationcoder-k8s-stack
This setup avoids app-of-apps ordering ambiguity by using a single generated Application with multiple sources.
Resource-level sync waves provide dependency ordering for workload resources:
examples/argocd/resources/00-coder-system-namespace.yamluseswave -1examples/cloudnativepg/00-namespace.yamluseswave 0examples/cloudnativepg/cnpg-cluster.yamluseswave 1examples/cloudnativepg/codercontrolplane.yamluseswave 2
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.gitatmain. UpdaterepoURLandtargetRevisioninexamples/argocd/applicationset.yamlif you want to pin to a tag or use a fork. - The CloudNativePG chart version is configurable with
cloudnativepgChartVersion. Pin it to an explicit chart version for reproducible environments.
kubectl -n argocd delete applicationset coder-k8s-stackThe generated Application includes resources-finalizer.argocd.argoproj.io so deleting the ApplicationSet cascades cleanup of managed resources. Depending on your storage class reclaim policy, PVCs from PostgreSQL may remain after cleanup.