In part 1 of this post, have explained how we can Install Helm package to a kubernetes cluster.
In part 2, we will cover how to create Helm Chart, how to upgrade our Helm Chart.
thor@jump_host
~$ helm version WARNING: Kubernetes configuration file is
group-readable. This is insecure. Location: /home/thor/.kube/config version.BuildInfo{Version:"v3.5.0",
GitCommit:"32c22239423b3b4ba6706d450bd044baffdcf9e6",
GitTreeState:"clean", GoVersion:"go1.15.6"} thor@jump_host
~$ |
thor@jump_host
~$ chmod o-r /home/thor/.kube/config |
thor@jump_host ~$ helm version version.BuildInfo{Version:"v3.5.0", GitCommit:"32c22239423b3b4ba6706d450bd044baffdcf9e6", GitTreeState:"clean", GoVersion:"go1.15.6"} thor@jump_host ~$ |
thor@jump_host
~$ helm create helloworld Creating
helloworld thor@jump_host
~$ |
thor@jump_host
~$ ll total 4 drwxr-xr-x 4
thor thor 4096 Jan 14 15:26 helloworld thor@jump_host
~$ thor@jump_host
~$ tree helloworld/ helloworld/ ├── charts ├── Chart.yaml >>> It containes ├── templates │ ├── deployment.yaml │ ├── _helpers.tpl │ ├── hpa.yaml │ ├── ingress.yaml │ ├── NOTES.txt │ ├── serviceaccount.yaml │ ├── service.yaml │ └── tests │ └── test-connection.yaml └── values.yaml 3 directories, 10 files thor@jump_host
~$ |
thor@jump_host
~$ helm install myfirstchart helloworld NAME:
myfirstchart LAST DEPLOYED:
Fri Jan 14 15:29:19 2022 NAMESPACE:
default STATUS: deployed REVISION: 1 NOTES: 1. Get the
application URL by running these commands: export POD_NAME=$(kubectl get pods
--namespace default -l
"app.kubernetes.io/name=helloworld,app.kubernetes.io/instance=myfirstchart"
-o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod
--namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to
use your application" kubectl --namespace default port-forward
$POD_NAME 8080:$CONTAINER_PORT thor@jump_host
~$ |
thor@jump_host
~$ helm list -a NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION myfirstchart default 1 2022-01-14 15:29:19.611092128
+0000 UTC deployed
helloworld-0.1.0 1.16.0 thor@jump_host
~$ |
thor@jump_host
~$ kubectl get all NAME
READY STATUS RESTARTS
AGE pod/myfirstchart-helloworld-648bc4c7f6-dzqlp 1/1
Running 0 29s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
AGE service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 46m service/myfirstchart-helloworld ClusterIP
10.96.213.17 <none> 80/TCP 29s
NAME READY UP-TO-DATE AVAILABLE
AGE deployment.apps/myfirstchart-helloworld 1/1
1 1 29s
NAME
DESIRED CURRENT READY
AGE replicaset.apps/myfirstchart-helloworld-648bc4c7f6 1
1 1 29s thor@jump_host
~$ |
thor@jump_host
~$ vi helloworld/values.yaml |
Happy Learning!!!!
Apart from this if you need more clarity, I have made a tutorial video on this, please go through and share your comments. Like and share the knowledge
0 Comments