I am pushing Docker images to our private registry via Jenkins with the following command:
def dockerImage = docker.build("repo/myapp:${env.BUILD_NUMBER}")
(BUILD_NUMBER
increases after every build.)
Because I am new to using Helm, I could not decide how should I give the tag for images in values.yaml
.
I would like to deploy my app to multiple environments such as:
dev
test
prod
Let's say I was able to deploy my app via Helm to dev
, and the latest BUILD_NUMBER
is:
dev
test
prod
What should be the tag value, then?
image:
repository: registryt/myrepo/image
tag:
You should put "some" tag into your values.yaml
which will act as the default tag
. Each Helm Chart has it, you can check the official Helm Charts here.
Now, you have two options on how to act with the different environments.
While installing your Helm Chart, you can specify the tag name dynamically with --set
. For example:
$ helm install --set image.tag=12345 <your-chart-name>
You can store separate values.yaml
in your repository, like:
values.dev.yaml
values.prod.yaml
Then, update the correct values in your Jenkins pipeline.