-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathhelmlab.txt
More file actions
83 lines (53 loc) · 1.96 KB
/
helmlab.txt
File metadata and controls
83 lines (53 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
helm installation
wget https://get.helm.sh/helm-v3.10.2-linux-amd64.tar.gz
tar -zxvf helm-v3.10.2-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
helm version
helm env
#To list repo
helm repo list
#To add a repo
#helm repo add <repo> url
helm repo add stable https://charts.helm.sh/stable
#Search a repo
helm search repo mysql
-----------
#create helm chart
1) helm create testchart
2) cd testchart
3) ls
4) #Cleanup all the files inside templates directory so that we will start from scratch
rm -rf templates/*
5)# Create deployment file
kubectl create deployment nginx --image=nginx --dry-run=client -o yaml >> templates/deployment.yaml
6) #create a deployment to expose service
kubectl create deployment nginx --image=nginx
kubectl expose deploy nginx --port 80 --type NodePort --dry-run=client -o yaml > templates/service.yaml
7) #define only the required values inside Chart.yaml
cat Chart.yaml
8)#One more additional file, need to create is NOTES.txt inside templates directory
echo "This is first helm chart and it will deploy nginx application" >>templates/NOTES.txt
9)#cleanup rest of the files and directory to draw the clean slate
cd ..
10)#It always a good idea to run linter before deploying your chart to make sure there is no syntax error or your are following all the best practices
helm lint ./testchart
11) #delete the deployment
kubectl delete deployment nginx
kubectl delete svc nginx
12)#Do the dry run
helm install testchart ./testchart --dry-run
13) #install
helm install testchart ./testchart
#Check service and deployment
kubectl get deployment
kubectl get svc
14) #check
helm list
15) #package
helm package testchart/
#Successfully packaged chart and saved it to: /root/testchart-0.1.0.tgz
16) #Uninstall
helm uninstall testchart
#Check service and deployment
kubectl get svc
kubectl get deployment