kustomize commands
23 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 23 shown
-
kustomize build ./overlays/prodRender all manifests for an overlay to stdout
-
kubectl apply -k ./overlays/prodBuild and apply kustomization in one step via kubectl
-
kubectl diff -k ./overlays/prodShow what changes before applying
-
kustomize edit add resource ./deployment.yamlAppend a resource file to kustomization.yaml
-
kustomize edit set image myapp=registry/myapp:v2.0.0Update image tag in kustomization.yaml
-
kustomize edit set namespace productionOverride namespace for all resources in the overlay
-
kustomize edit add label env:productionInject a common label into all generated resources
-
kustomize edit add patch --path patch.yaml --kind Deployment --name <name>Register a strategic merge patch in kustomization.yaml
-
kustomize cfg list-setters .List all settable fields in the kustomization
-
kubectl apply -k ./overlays/prodBuild kustomize overlay and apply directly to cluster
-
kubectl kustomize ./overlays/prod | head -100Render kustomize output without applying
-
kustomize edit set image myapp=myapp:v1.2.3Update image tag in kustomization.yaml
-
kustomize edit add configmap my-config --from-literal=key=valueAdd a ConfigMap generator entry to kustomization.yaml
-
kustomize build ./overlays/prod | grep "^kind:"Quickly list all resource kinds in a kustomize build
-
# Add patchesStrategicMerge in kustomization.yamlUse patchesStrategicMerge to partially override base resources
-
cat > patch.yaml <<EOF apiVersion: apps/v1 kind: Deployment metadata: name: myapp spec: replicas: 3 template: spec: containers: - name: myapp resources: limits: memory: 512Mi EOF echo 'patches:\n- path: patch.yaml' >> kustomization.yamlCreate a strategic merge patch and register it in kustomization.yaml
-
kustomize build --enable-helm ./overlayRender helmCharts: block to manifests; note: needs helm in PATH
-
cat <<'EOF' >> kustomization.yaml components: - ../../components/monitoring EOFMixin reusable patches/resources via components: (Kustomize v4+)
-
cat <<'EOF' >> kustomization.yaml replacements: - source: {kind: ConfigMap, name: cfg, fieldPath: data.host} targets: - select: {kind: Deployment} fieldPaths: [spec.template.spec.containers.0.env.0.value] EOFmodern: replacements: copies a field cross-resource, replaces deprecated vars:
-
cat <<'EOF' >> kustomization.yaml patches: - target: {kind: Deployment, labelSelector: app=api} patch: |- - op: replace path: /spec/replicas value: 3 EOFJSON6902 patch applied to all matching targets, no separate file
-
kustomize edit set image app=registry.example.com/app@sha256:<id>Pin by immutable digest; newName+digest also settable in images: block
-
cat <<'EOF' >> kustomization.yaml secretGenerator: - name: db-creds literals: [PASSWORD=s3cr3t] generatorOptions: disableNameSuffixHash: true EOFnote: disableNameSuffixHash keeps stable name but breaks rollout-on-change
-
cat <<'EOF' >> kustomization.yaml openapi: path: crd-schema.json EOFTeach kustomize CRD merge/list semantics so patches merge correctly
no commands match — try a different search