Helm
Complete Helm Chart Tutorial: From Beginner to Expert Guide
Introduction
Helm is the best way to find, share, and use software built for Kubernetes.
How to install helm ?
- for MasOS:
brew install helm
How Helm Chart help us to manage k8s?
- from
1
2
3
4
5
6
7kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
kubectl apply -f ingress.yaml
kubectl delete -f deployment.yaml
kubectl delete -f service.yaml
kubectl delete -f ingress.yaml - to
1
2
3helm install my-app ./my-chart
helm uninstall my-app
Architecture
Helm Demo
demo code link: https://github.com/mjd507/helm-demo
Create a helm chart.
1
helm create helm-demo
check the directorys
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16➜ cd helm-demo
➜ tree
.
├── Chart.yaml
├── charts
├── templates
│ ├── NOTES.txt
│ ├── _helpers.tpl
│ ├── deployment.yaml
│ ├── hpa.yaml
│ ├── ingress.yaml
│ ├── service.yaml
│ ├── serviceaccount.yaml
│ └── tests
│ └── test-connection.yaml
└── values.yamlchange the service type to NodePort in value.yaml
install chart to k8s
1
2cd ..
helm install my-helm-demo helm-demoverify helm install command
1
2
3
4
5helm list -a
output:
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
my-helm-demo default 1 2024-02-16 14:46:06.11394 +0800 CST deployed helm-demo-0.1.0 1.16.0check the service/pod in k8s
1
2
3
4
5
6
7
8
9
10
11kubectl get service
output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
...
my-helm-demo NodePort 10.101.215.130 <none> 80:31348/TCP 2m28s
kubectl get pods
output:
NAME READY STATUS RESTARTS AGE
...
my-helm-demo-5b77995cb9-q4cz9 1/1 Running 0 2m39scheck within the broswer
since I use minikube to build a local k8s cluster, I can use minikube commands to verify the pod/service. it will open the page with my default broswer.1
minikube service my-helm-demo
remove from k8s
1
helm uninstall my-helm-demo
Title: Helm
Author: mjd507
Date: 2024-02-16
Last Update: 2024-02-16
Blog Link: https://mjd507.github.io/2024/02/16/Helm/
Copyright Declaration: This station is mainly used to sort out incomprehensible knowledge. I have not fully mastered most of the content. Please refer carefully.