Guides

Using Kustomize

Deploy Kustomize overlays with Wardn — implemented

Using Kustomize ✅

Kustomize is implemented — the operator renders overlays (bases, patches, components) inside its reconcile, no kustomize binary needed. manifestType: Auto detects kustomization.yaml automatically.

Repo Structure

A typical Kustomize setup with base + overlays:

my-app/
├── base/
│   ├── kustomization.yaml
│   ├── deployment.yaml
│   └── service.yaml
└── overlays/
    ├── staging/
    │   └── kustomization.yaml
    └── production/
        ├── kustomization.yaml
        └── replica-patch.yaml

base/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - deployment.yaml
  - service.yaml
commonLabels:
  app: my-app

overlays/production/kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - ../../base
patches:
  - path: replica-patch.yaml
images:
  - name: myapp
    newTag: v1.2.4

overlays/production/replica-patch.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 5

App Configuration

Point source.git.path at the overlay directory:

apiVersion: cd.wardn.space/v1alpha1
kind: App
metadata:
  name: my-app-production
  namespace: org-my-org
spec:
  source:
    type: Git
    git:
      repoURL: https://github.com/myorg/my-app
      branch: main
      path: overlays/production
      manifestType: Auto           # detects kustomization.yaml → Kustomize
      kustomize:                   # optional overrides layered on top
        images:
          - ghcr.io/acme/api=v1.2.4
        namePrefix: prod-
        components:
          - ../../components/monitoring
  destination:
    namespace: production
  syncPolicy:
    automated: true
    prune: true

source.git.kustomize applies overrides on top of the tracked kustomization.yaml — you can pin images, prepend a name prefix, or include components without editing the repo.

FieldDescription
imagesnewName=newTag entries — image pin overrides
namePrefixPrepended to every rendered resource name
componentsExtra component paths to include

Image Tags and Promotion

Two promotion paths work:

# Option 1 — commit to the overlay (GitOps way)
cd overlays/production
kustomize edit set image myapp=myapp:v1.2.5
git add kustomization.yaml && git commit -m "Promote v1.2.5 to production" && git push

# Option 2 — edit the App's kustomize.images override (no repo commit)
kubectl --kubeconfig k3s.yaml edit app my-app-production -n org-my-org
# or via POST /apps/{ns}/{name}/deploy for image-source apps

Substitution too

source.git.substitution layers a ${VAR} map over rendered output:

source:
  type: Git
  git:
    path: overlays/production
    substitution:
      ENVIRONMENT: production
      IMAGE_TAG: v1.2.4

Kustomize vs Helm

AspectKustomizeHelm
Status✅ implemented📋 planned
TemplatingNone (patches)Go templates
Values managementPatches and overlaysvalues.yaml files
Package distributionGit onlyChart repositories
Best forSimple customizationsComplex, parameterized apps

On this page