Get hands-on experience with Helm's rollout commands and learn how to manage your Kubernetes applications effectively.
estimated time: 15m
show the current installed chart
helm ls -a
remove the chart
helm delete demo
- Cd to the Lab02 Folder on this Repo
cd Lab02
- To create a new Bitnami Rabbit MQ Chart , using defaults , we will use
helm upgrade my-rabbit oci://registry-1.docker.io/bitnamicharts/rabbitmq --install
NOTE: Helm chart can be installed from remote repositories without donwloading them
- Ensure the Helm is installed correctly
kubectl get pods
-
we shall now add more pods to the statefull set to make it more reliable solution.
-
Create a values.yaml file with the following content :
replicaCount: 3
helm upgrade my-rabbit oci://registry-1.docker.io/bitnamicharts/rabbitmq -f values.yaml --install
NOTE: In order to understand what is the right values.yaml file strucutre, you need to inspect the Helm chart from the publisher. navigate to https://github.com/bitnami/charts/blob/main/bitnami/rabbitmq/values.yaml to view the bitnami rabbitmq values file
- Wait for the 3 Pods to spin up and ensure the Helm is installed correctly
kubectl get pods
- Check the status of the Helm Chart
helm status my-rabbit
- Check the history of the Helm Chart
helm history my-rabbit
you should see 2 versions
- lets assume that for dev environment you want to have 5 replicas with a limit of 1 CPU and 2G for each pod for the Dev Environment.
Solution
Add another values file called dev.values.yaml with the following contentreplicaCount: 5
resources:
limits:
cpu: 1000m
memory: 2Gi
Then run the following command
helm upgrade my-rabbit oci://registry-1.docker.io/bitnamicharts/rabbitmq --values values.yaml --values dev.values.yaml --install
2 . Ensure there is a rollout that was deployed by inspecting the helm history :
helm history my-rabbit
oh no , your previous installation caused many VM's to spin up during the weekend ,causing huge OPEX impact. you are being asked to revert the changes as fast as possible .
- the ask is to go back to the first version , where you had 1 pod.
- You are not allowed to delete the chart -> some customers are using it !
helm rollback my-rabbit 1
we have switched back to version 1 : our first and most reliable version . Note this action is also recored as history action.
helm history my-rabbit
lets try to cleanup the helm chart by running
helm delete my-rabbit
after few moments it seems all is clear , right ?
Wrong
kubectl get pvc
Helm does not delete PVC's and has some serious challanges with CRD's as well .
This will prevent us from doing more updates to the chart unless special hoolks and patterns will be applied.
Run the follwoing command to clean the PVC's
kubectl delete pvc --all --force
🎉 Conclusion Congratulations! You've just learned how to use Helm's rollout commands. Keep practicing and exploring other Helm commands to manage your Kubernetes applications effectively. Happy Helm-ing! 🚀