This command will work on osx, linux-32bit and linux-64bit
curl https://srossross.github.io/template/get.sh | sh
It will install a single executable file template into /usr/local/bin
Optionally you can set the version os and arch and install prefix
export TEMPLATE_VERSION=v1.0.0 \
TEMPLATE_ARCH=arm64 \
TEMPLATE_OS=linux \
TEMPLATE_INSTALL_PREFIX=/usr/local/bin
curl srossross.github.io/template/get.sh | bash
FROM ...
ENV TEMPLATE_VERSION v1.0.0
RUN curl srossross.github.io/template/get.sh | sh
Check out the examples directory for a list of examples.
The template command exposes the go template language
And adds functions from sprig
This leans heavily from the templates commands of Kubernetes Helm https://docs.helm.sh
# mytemplate.tpl
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.Name }}
data:
myvalue: "Hello World"
You can run this example like this:
$ template render --set Name=SomeConfig - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.Name }}
data:
myvalue: "Hello World"
EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: SomeConfig
data:
myvalue: "Hello World"
-f flag (template render -f myvals.yaml ./mytemplate.tpl)--set (such as template render --set foo=bar ./mytemplate.tpl)Each -f can be overridden by more user-supplied values files, which can in turn be overridden by --set parameters.
Values files are plain YAML files. Let’s edit values.yaml and then edit our ConfigMap template.
TODO
TODO
TODO
TODO