Add an inline patch with a target selector
Apply a JSON6902 patch to all matching resources, no separate file needed
cat <<'EOF' >> kustomization.yaml
patches:
- target: {kind: Deployment, labelSelector: app=api}
patch: |-
- op: replace
path: /spec/replicas
value: 3
EOF
- tool
- kustomize23 commands
More kustomize commands
-
kustomize edit set image app=registry.example.com/app@sha256:<id>Pin the image to an immutable digest; you can also set newName and digest in the images: block
-
cat <<'EOF' >> kustomization.yaml secretGenerator: - name: db-creds literals: [PASSWORD=s3cr3t] generatorOptions: disableNameSuffixHash: true EOFdisableNameSuffixHash keeps the name stable, but pods no longer roll out when the secret changes
-
cat <<'EOF' >> kustomization.yaml openapi: path: crd-schema.json EOFTeach kustomize the merge rules of your CRDs, so patches merge correctly
-
kustomize build ./overlays/prodRender all manifests of an overlay to stdout
-
kubectl apply -k ./overlays/prodBuild and apply kustomization in one step via kubectl