Templated Fields beta
Skaffold allows for certain fields in the config to be templated with values either from environment variables, or certain special values computed by Skaffold.
build:
tagPolicy:
envTemplate:
template: "{{.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:
build.artifacts.[].docker.buildArgs
(see builders)build.tagPolicy.envTemplate.template
(see envTemplate tagger)deploy.helm.releases.setValueTemplates
(see Deploying with helm)deploy.helm.releases.name
(see Deploying with helm)deploy.helm.releases.namespace
(see Deploying with helm)deploy.kubectl.defaultNamespace
deploy.kustomize.defaultNamespace
Please note, this list is not exhaustive.
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
Last modified April 14, 2021: release: v1.22.0 (4e67ac7)