Helm is the popular package manager for Kubernetes application deployment, not new to me as I had tried many charts previously with Kafka, and Redis helm charts installation, today I am going to explore how to build my own helm chart for this zack blog, also deep dive into the chart development for advanced templating, together with helm release management and version control, finally integrate my own chart with CI/CD for GitOps.
Common Helm command
helm list -A # list releases across all namespaces
helm pull bitnami/postgresql-ha –untar # untar the chart after pull online chart
helm repo add bitnami https://charts.bitnami.com/bitnami # add a repo
helm create zackblog-helm # create a new chart
helm install zackblog-helm ~/zackblog-helm -n NAMESPACE -f dev-values.yaml # define ns and override with a new value file
helm upgrade zackblog-helm ~/zackblog-helm –set image.repository= --set image.tag= # --set to upgrade chart with override a new value
helm lint ~/zackblog-helm # lint syntax
helm rollback zackblog-helm 2 # rollback to revision 2 of a release
helm uninstall zackblog-helm -n Production # uninstall a chart from a ns
Start with own chart
create a new helm chart
Lint chart syntacx before install
Customize vaule.yaml by change replica and image tag
Override values.yaml by -f and deploy same chart to different environments
Advanced templating to add pvc into chart
CICD integration to deploy chart with ArgoCD
Now commit and upload “zackblog-helm” folder into github repo, create ArgoCD application manifest to sync with from path of own helm chart
Conclusion
Finally, I had a chance to go over helm, it makes package management easier and more convenient, through charts, k8s deployment can be more flexible with values and templates that can be deployed and reusable into different environments, it provides versioning and rollbacks, also allow customization of the template. however using on-line chart can also be risky in a production environment with quality, dependency and security risks.
Overall I think helm chart is a very good way to start deployment into k8s.