Skip to content

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.

Terminal window
# From the kdef root
git clone https://github.com/gsid-nl/kdef.git
cd kdef
make build
cp kdef argocd-plugin/
cd argocd-plugin
docker build -t your-registry/kdef-argocd-plugin:latest .
docker push your-registry/kdef-argocd-plugin:latest

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.

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: argocd
spec:
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: true

ArgoCD auto-detects .kdef files in path and invokes the plugin to produce manifests.

Pass an env through plugin parameters:

source:
plugin:
name: kdef
env:
- name: KDEF_ENV
value: production

And 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 list generator is the cleanest way to deploy the same kdef project to multiple environments. Point each generated Application at a different KDEF_ENV.
  • Variable overrides — extend the generate command with --set for simple scalars, or use a values/*.json file 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.

Both work. If you already run one, use that one. If you’re choosing:

  • Flux + kdef’s KdefRelease CR 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.