Templated fields

Skaffold config allows for certain fields to have values injected that are either environment variables or calculated by Skaffold. For example:

build:
  tagPolicy:
    envTemplate:
      template: "{{.IMAGE_NAME}}:{{.FOO}}"
  artifacts:
  - image: gcr.io/k8s-skaffold/example

Suppose the value of the FOO environment variable is v1, the image built will be gcr.io/k8s-skaffold/example:v1.

List of fields that support templating:

List of variables that are available for templating:

  • all environment variables passed to the Skaffold process at startup
  • IMAGE_NAME - the artifacts’ image name - the image name rewriting acts after the template is calculated