Inline patch with target selector kustomize
JSON6902 patch applied to all matching targets, no separate file
cat <<'EOF' >> kustomization.yaml
patches:
- target: {kind: Deployment, labelSelector: app=api}
patch: |-
- op: replace
path: /spec/replicas
value: 3
EOF
more kustomize
all 23 commands →
Pin image by digest and rename
kustomize edit set image app=registry.example.com/app@sha256:<id>
Secret generator without hash suffix
cat <<'EOF' >> kustomization.yaml
secretGenerator:
- name: db-creds
literals: [PASSWORD=s3cr3t]
generatorOptions:
disableNameSuffixHash: true
EOF
Register CRD OpenAPI for merge keys
cat <<'EOF' >> kustomization.yaml
openapi:
path: crd-schema.json
EOF
Build kustomization
kustomize build ./overlays/prod
Apply kustomization
kubectl apply -k ./overlays/prod