docs

GitOps workflow

What is in Git is what runs. No kubectl apply by hand.

YOUR REPOcluster.yamlyour settings, every charthelm/platform/the platform componentshelm/apps/your apps, one folder eachargocd/the app of appsONE APPLICATION PERPlatform componentan entry in appset.yamlYour appa folder in helm/apps/ArgoCD

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/
Delete an app folder or comment out a platform entry and push: ArgoCD deletes every resource of that Application, its database included.

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 listplatform/appset.yaml holds a list of entries, each a component in helm/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 in helm/platform/ with no entry is not deployed.
  • Your apps: one folder eachapps/appset.yaml creates one Application per folder in helm/apps/. Add a folder and push, it is deployed. Delete it, it is removed.

Deploy your own app

  1. Copy the example

    Copy helm/apps/hello to helm/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.

  2. Set the image

    In values.yaml, point to your container image and port. The route's backendRefs port must match the service port.

  3. Expose it

    Two changes, both needed. First, add <app> to global.gatewayHosts in cluster.yaml. This creates the HTTPS listener https-<app> and the certificate for <app>.<domain>.

    Then, in your values.yaml, rename the route's sectionName to https-<app>. The copy still says https-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-hello
  4. Push

    Commit the new folder and cluster.yaml together. ArgoCD deploys the app at https://<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