github.com/GoogleContainerTools/skaffold/v2@v2.13.2/docs-v1/content/en/docs/environment/templating.md (about) 1 --- 2 title: "Templated Fields" 3 linkTitle: "Templated Fields" 4 weight: 90 5 featureId: templating 6 aliases: [/docs/how-tos/templating] 7 --- 8 9 Skaffold allows for certain fields in the config to be templated with values either from environment variables, or certain special values computed by Skaffold. 10 11 {{% readfile file="samples/templating/env.yaml" %}} 12 13 Suppose the value of the `FOO` environment variable is `v1`, the image built 14 will be `gcr.io/k8s-skaffold/example:v1`. 15 16 List of fields that support templating: 17 18 * `build.artifacts.[].docker.buildArgs` (see [builders]({{< relref "/docs/pipeline-stages/builders" >}})) 19 * `build.artifacts.[].ko.{env,flags,labels,ldflags}` (see [`ko` builder]({{< relref "/docs/pipeline-stages/builders/ko" >}})) 20 * `build.tagPolicy.envTemplate.template` (see [envTemplate tagger]({{< relref "/docs/pipeline-stages/taggers#envtemplate-using-values-of-environment-variables-as-tags)" >}})) 21 * `deploy.helm.releases.setValueTemplates` (see [Deploying with helm]({{< relref "/docs/pipeline-stages/deployers#deploying-with-helm)" >}})) 22 * `deploy.helm.releases.name` (see [Deploying with helm]({{< relref "/docs/pipeline-stages/deployers#deploying-with-helm)" >}})) 23 * `deploy.helm.releases.namespace` (see [Deploying with helm]({{< relref "/docs/pipeline-stages/deployers#deploying-with-helm)" >}})) 24 * `deploy.helm.releases[].repo` (see [Deploying with helm]({{< relref "/docs/pipeline-stages/deployers#deploying-with-helm)" >}})) 25 * `deploy.helm.releases.version` (see [Deploying with helm]({{< relref "/docs/pipeline-stages/deployers#deploying-with-helm)" >}})) 26 * `deploy.helm.releases.valuesFiles` (see [Deploying with helm]({{< relref "/docs/pipeline-stages/deployers#deploying-with-helm)" >}})) 27 * `deploy.kubectl.defaultNamespace` 28 * `deploy.kustomize.defaultNamespace` 29 * `deploy.kustomize.paths.[]` 30 * `portForward.namespace` 31 * `portForward.resourceName` 32 33 _Please note, this list is not exhaustive._ 34 35 List of variables that are available for templating: 36 37 * all environment variables passed to the Skaffold process at startup 38 * For the `envTemplate` tagger: 39 * `IMAGE_NAME` - the artifact's image name - the [image name rewriting]({{< relref "/docs/environment/image-registries.md" >}}) acts after the template is calculated 40 * For Helm deployments: 41 * `IMAGE_NAME`, `IMAGE_TAG`, `IMAGE_DIGEST` - the first (by order of declaration in `build.artifacts`) artifact's image name, tag, and sha256 digest. Note: the [image name rewriting]({{< relref "/docs/environment/image-registries.md" >}}) acts after the template is calculated. 42 * `IMAGE_NAME2`, `IMAGE_TAG2`, `IMAGE_DIGEST2` - the 2nd artifact's image name, tag, and sha256 digest 43 * `IMAGE_NAMEN`, `IMAGE_TAGN`, `IMAGE_DIGESTN` - the Nth artifact's image name, tag, and sha256 digest