Pin an image by digest and rename it

Pin the image to an immutable digest; you can also set newName and digest in the images: block

kustomize edit set image app=registry.example.com/app@sha256:<id>

tool
kustomize23 commands
tags
kustomizegitopssecurityk8s

More kustomize commands

  • cat <<'EOF' >> kustomization.yaml secretGenerator: - name: db-creds literals: [PASSWORD=s3cr3t] generatorOptions: disableNameSuffixHash: true EOF

    disableNameSuffixHash keeps the name stable, but pods no longer roll out when the secret changes

  • cat <<'EOF' >> kustomization.yaml openapi: path: crd-schema.json EOF

    Teach kustomize the merge rules of your CRDs, so patches merge correctly

  • kustomize build ./overlays/prod

    Render all manifests of an overlay to stdout

  • kubectl apply -k ./overlays/prod

    Build and apply kustomization in one step via kubectl

  • kubectl diff -k ./overlays/prod

    Show what will change before you apply

all 23 kustomize commands