Helm is a fantastic tool that eases management of k8s apps. You can define, install and upgrade any application despite its complexity, using Helm Charts. For this tutorial, I’m going to show you how to do deployment using Helm. We’ll be doing the deployment to k8s Minikube, though you can also use GCP cluster. Assumption: You have some k8s skills and setup on your local machine.
- Setup k8s Minikube
- Install Helm
- Generate Helm chart
- Deploy chart created in step 3
- Share chart
i. Setup k8s Minikube
If you haven’t installed minikube, you can easily install as shown below:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.23.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.23.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
Confirm installation by typing
minikube version. This should give the version installed.
Next, start minikube by running this command: minikube start. You can start with a specific k8s version by for example,
minikube start — kubernetes-version v1.7.0, which starts a Kubernetes v1.7.0 cluster.
Confirm current context is changed to minikube by running
kubectl config current-context . If the result is not minikube, run
kubectl config set-context minikube .
ii. Install Helm
For OSX. you can install via brew by running the command,
brew install kubernetes-helm . Initialize Helm by running
helm init .
You can also install via curl,
iii. Generate Helm Chart
To generate the chart, run
helm create <your-chart-name>. Provide a chart name of your choice. Various folders and files will be created as shown below:
Chart.yaml— contains information about the chart.
values.yaml — contains default values for the chart
templates— contains templates which will be used to generate k8s manifest values
iv. Deploy chart created in (iii)
We’ll be deploying the default values defined in templates/ folder. You can as well create valid k8s deployment files inside this folder and carry the deployment using you customized templates.
helm install . to deploy. To confirm your deployment, you can check the pods by running
kubectl get po or rather by using k8s dashboard(
kubectl proxy) and view pods, deployments etc.
Finally, to package your chart so that you can share, run
helm package . . This will create a tar package which can be shared.
Note: This is not an exhaustive tutorial about Helm. It’s just a beginner’s guide. For a deeper understanding of it please visit the official documentation.
Excited to read your comment(s)!
Like this article? Follow @delan_hype on Twitter