This is the 4th part in our $65 Kubernetes Cluster on DigitalOcean series, you can goto Part I to read on how to setup your cluster if you haven't done so yet.
There's also a video tutorial here for those who prefer to watch instead of read.
Helm Charts is the ultimate package manager for kubernetes apps. Imagine as homebrew is to macOS and yarn/npm is to node, this is what Helm is to kubernetes.
Helm Charts helps to automate the installation of applications to our kubernetes cluster and can quickly help us bootstrap, configure and install repeatable production ready apps .
Let's say we wanted to install a mongodb deployment, typically we would have to prepare our manifests files, which would normally include a deployment, service, configmaps, secrets and maybe ingress config. But with helm, all we would have to do would be run something like
helm install stable/mongodb and helm would install and configure mongodb on our behalf. Fun isn't it?? :)
Step 1 - Installation
Installing helm is as easy as
brew install kubernetes-helm (macOS/homebrew). For other platforms, check out the installation guide. This will install the cli tool.
Step 2 - Initialisation
Once the cli tool has been installed, we will need to the install Tiller server to our cluster and also the create the service account that will be used.
Save file as
kubectl apply -f ./helm-rbac-config.yaml
Once the service account has been created, run the following command:
Note: Make sure you are in the right kubernetes cluster-context before you proceed
helm init --service-account tiller
Step 3 - Example MongoDB Installation
The easiest way to install an application (also referred to as a chart), is by using the official stable channel.
To install mongodb for example and give the release a name simpledb, run the following:
helm install --name simpledb stable/mongodb
Once a chart is installed, a new release is created so as to enable us reuse the same chart over and over in our cluster. To get more information about our current simpledb mongodb deployment run:
helm status simpledb
That will print information on how to connect to your mongodb deployment.
So there we have it, our example mongodb installation should be up and running. You can find out more about using helm from the official docs here.
I hope this was helpful.