- Published on
Helm learning notes
- Authors
- Name
- sinhnt
- @sinhnt
Why deploy k8s using Helm
Normal:
- Your app -> hard-code yaml (deployment/service/ingress) -> Kubectl -> AKS => Use Helm to simplify the application deployment process and avoid hardcoded deployment variables and settings. => Repeatable, reliable, manageable, resuable across mutil teams and env
New:
- Your app -> Helm chart -> AKS
Helm components:
- Client: is where helm was installed and responsible for creating and submitting the manifest files required to deploy aks application. (Communicate between user and k8s cluster)
- Charts: file to describe how the application deployed (chart/value/template)
- Releases: The application or a group of application deployed using Chart
- Repositories: discoverability and reusability of helm pacakges
Concept
If 2 component depends on each other, try to use 1 chart and set the dependency If 2 component are independent, create 1 chart for each component (Easier for bugfix and upgrade)
Commands
Work with repos
To install a chart (This similar to kubectl apply
command)
Run helm install
to install a chart from:
- Chart folder:
helm install <release-name> ./drone-webapp
- A packaged
.tgz
tar archive chart:helm install <release-name> ./drone-webapp.tgz
- A Helm repository:
helm install <release-name> azure-marketplace/aspnet-core
Lets install aspnet
Write a custom chart or extends it
Template and function
To display the value as a string, you use {{ quote .Values.ingress.enabled }}
or {{ .Values.ingress.enabled | quote }}
Chaning mutiple function: {{ .Values.ingress.enabled | upper | quote }}
Helm chart template support ~60 built-in function