estimated time: 15m
In this tutorial, we will learn how to create a Helm chart for deploying applications to Kubernetes.
Cd to the Lab01 Folder on this Repo
cd Lab01
To create a new Helm chart, run the following command:
helm create demo
-
Open Chart.yaml file and perform the following modifications :
- our App version should be 3.0.0
- our Helm Chart Version is 1.0.9
-
Open value.yaml and change the following :
-
We need 3 replicas of our deployment
-
Change the entire image section to
image: acr: vipublicacr.azurecr.io repository: nginx tag: 1.25 pullPolicy: IfNotPresent
-
-
Change the Chart Accordingly :
Hint
Search the code who is referncing .Values.image.repositorySolution
On Deployment.yaml , line 34 change toimage: "{{ .Values.image.acr }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
-
Remove the test directory , turn on Ingress
Hint
on the ingress.yaml file there is a condition that determines whether ingress should be installed{{- if .Values.ingress.enabled }}
change the values file accordingly
still on your helm-ws\lab01 folder :
helm install demo .\demo --dry-run
Since Install command can only run once , we need a command to do "install or update" so we shall use :
helm upgrade demo ./demo --dry-run --install
- same as above but witout the --dry-run flag
- Inspect all got installed
helm ls -a
kubectl get pods
-
Save The helm Manifest into single File
helm get manifest demo > demo1.ymal