To begin, we have created a very simple Helm chart, which we have stored in a GitRepo source repository:
Chart.yml
apiVersion: v1 appVersion: "1.0" description: A Helm chart for Kubernetes name: simplehelm version: 0.1.0
We use a companion values.yml
file to specify the details, including information that identifies which Docker image to deploy.
values.yml
replicaCount: 1 image: repository: ${res_simplehelmDockerImage_imageName} tag: ${res_simplehelmDockerImage_imageTag} pullPolicy: IfNotPresent port: 80 ....
The repository
and tag
fields that identify the Docker image name and tag are set to environment variables. These reference the imageName
and imageTag
properties of the Image resource for the Docker image.
When our pipeline runs, the HelmDeploy step will automatically replace these environment variable reference with their values from the Image resource, so that the correct Docker image is deployed through Helm.
For more information on creating Helm charts, see the Helm Chart Template Guide.