docs
GitOps workflow
What is in Git is what runs. No kubectl apply by hand.
YOUR REPO
- cluster.yamlyour settings, every chart
- helm/platform/the platform components
- helm/apps/your apps, one folder each
- argocd/the app of apps
ArgoCD reads your repo
ArgoCD
It creates one Application per component and per app
- Platform componentan entry in appset.yaml
- Your appa folder in helm/apps/
Repo layout
- cluster.yamlYour settings, passed to every chart.
- helm/platform/One folder per platform component: a Helm chart wrapping the upstream chart, with its
values.yaml. - helm/apps/Your apps, one folder each.
- argocd/The app-of-apps and two ApplicationSets. You only touch it to turn a platform component on or off.
App of apps
argocd/app-of-apps.yaml points ArgoCD at two ApplicationSets in argocd/applications/. They work differently:
- Platform components: a list
platform/appset.yamlholds a list of entries, each a component inhelm/platform/and its namespace. ArgoCD creates one Application per entry. To disable a component, comment out its entry and push: ArgoCD removes it. The first entries are marked required: the other components and your apps depend on them. To enable an optional one, uncomment its entry. A folder inhelm/platform/with no entry is not deployed. - Your apps: one folder each
apps/appset.yamlcreates one Application per folder inhelm/apps/. Add a folder and push, it is deployed. Delete it, it is removed.
Deploy your own app
Copy the example
Copy
helm/apps/hellotohelm/apps/<app>. The folder name is the Application name and the namespace. It uses app-template, a generic chart: Deployment, Service, HTTPRoute, secrets, all from one values file.Set the image
In
values.yaml, point to your container image and port. The route'sbackendRefsport must match the service port.Expose it
Two changes, both needed. First, add
<app>toglobal.gatewayHostsincluster.yaml. This creates the HTTPS listenerhttps-<app>and the certificate for<app>.<domain>.Then, in your
values.yaml, rename the route'ssectionNametohttps-<app>. The copy still sayshttps-hello: left as is, your route attaches to hello's listener, not to<app>.<domain>.# helm/apps/<app>/values.yaml app-template: route: main: parentRefs: - group: gateway.networking.k8s.io kind: Gateway name: traefik namespace: traefik sectionName: https-<app> # was https-helloPush
Commit the new folder and
cluster.yamltogether. ArgoCD deploys the app athttps://<app>.<domain>.
Secrets
Secret values never go in Git. Yours live in Infisical, which Community installs in your cluster. External Secrets copies them into Kubernetes Secrets for your apps.
Infisical comes installed and connected, so there is nothing to set up: add your secrets in its web app, then declare them in your app with one block. See Secrets with Infisical.
Removing deletes data
When you delete an app folder or comment out a platform entry, ArgoCD deletes every resource of that Application. A CloudNativePG database in it is deleted too, with its volume. Dump the database first. For an app with the cnpg-cluster chart:
kubectl -n <app> exec <app>-cluster-1 -c postgres -- pg_dump -Fc -d <app> > <app>.dump