ArgoCD
kdef ships as an ArgoCD Config Management Plugin (CMP). Drop the sidecar into your argocd-repo-server, point an Application at a .kdef directory, and ArgoCD renders and deploys it.
1. Build the sidecar image
Section titled “1. Build the sidecar image”# From the kdef rootgit clone https://github.com/gsid-nl/kdef.gitcd kdef
make buildcp kdef argocd-plugin/cd argocd-plugindocker build -t your-registry/kdef-argocd-plugin:latest .docker push your-registry/kdef-argocd-plugin:latest2. Add the sidecar to argocd-repo-server
Section titled “2. Add the sidecar to argocd-repo-server”In your ArgoCD Helm values (or patch the repo-server Deployment directly):
repoServer: extraContainers: - name: kdef image: your-registry/kdef-argocd-plugin:latest command: ["/var/run/argocd/argocd-cmp-server"] securityContext: runAsNonRoot: true runAsUser: 999 volumeMounts: - { mountPath: /var/run/argocd, name: var-files } - { mountPath: /home/argocd/cmp-server/plugins, name: plugins } - { mountPath: /tmp, name: cmp-tmp } volumes: - name: cmp-tmp emptyDir: {}The plugin manifest (plugin.yaml) inside the sidecar image tells ArgoCD how to detect kdef projects (presence of *.kdef files) and run kdef render.
3. Point an Application at it
Section titled “3. Point an Application at it”apiVersion: argoproj.io/v1alpha1kind: Applicationmetadata: name: my-app namespace: argocdspec: project: default source: repoURL: https://github.com/example/my-app-k8s.git path: k8s/ plugin: name: kdef destination: server: https://kubernetes.default.svc namespace: production syncPolicy: automated: prune: true selfHeal: trueArgoCD auto-detects .kdef files in path and invokes the plugin to produce manifests.
Environment overrides
Section titled “Environment overrides”Pass an env through plugin parameters:
source: plugin: name: kdef env: - name: KDEF_ENV value: productionAnd update plugin.yaml inside the sidecar image to honor it:
generate: command: ["sh", "-c", "kdef render --dir . --env ${KDEF_ENV:-staging}"]- Cluster generators — ApplicationSet + the
listgenerator is the cleanest way to deploy the same kdef project to multiple environments. Point each generated Application at a differentKDEF_ENV. - Variable overrides — extend the
generatecommand with--setfor simple scalars, or use avalues/*.jsonfile committed alongside your kdef project. - Validation — kdef exits non-zero on validation failures, so ArgoCD’s sync will fail fast instead of applying broken manifests.
When Flux and when ArgoCD?
Section titled “When Flux and when ArgoCD?”Both work. If you already run one, use that one. If you’re choosing:
- Flux + kdef’s
KdefReleaseCR is the lighter-weight option — fewer moving parts, CRD-first UX. - ArgoCD + CMP sidecar gives you ArgoCD’s UI and its multi-cluster / multi-project story out of the box.