A few notes about devops and automation

Add Helm 2 to MicroK8s

· Read in about 1 min · (210 Words)

Next thing is to install some nice applications on our cluster. Why not use something that’s ready to use? Enter Helm. But I’m old fashioned, I still did not take the plunge and use Helm v3. That’s for a later blogpost.

So let’s enable Helm 2.14 on our MicroK8s cluster.

First step is to enable Helm

microk8s.enable dashboard

Let’s initialize Helm in our cluster.

~  (⎈ microk8s:default)                                                                                                                                                                                                               ⍉
▶ helm init
$HELM_HOME has been configured at /home/jacqueline/.helm.
Error: error installing: the server could not find the requested resource

No fun.

Luckily the answer is right here: https://stackoverflow.com/questions/58075103/error-error-installing-the-server-could-not-find-the-requested-resource-helm-k

So let’s go ahead and run

helm init --service-account tiller --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | sed 's@  replicas: 1@  replicas: 1\n  selector: {"matchLabels": {"app": "helm", "name": "tiller"}}@' | kubectl apply -f -
kubectl -n kube-system create serviceaccount tiller

kubectl create clusterrolebinding tiller \
  --clusterrole=cluster-admin \

Delete the current replicaset

kubectl delete -n kube-system replicaset tiller-deploy-7somechars

And then it works.

~  (⎈ microk8s:kube-system)                                                                                                                                                            
▶ kubectl get pods --all-namespaces                                                                         
NAMESPACE     NAME                                              READY   STATUS    RESTARTS   AGE
kube-system   coredns-7b67f9f8c-jbtxg                           1/1     Running   0          3h55m
kube-system   dashboard-metrics-scraper-687667bb6c-tcfm7        1/1     Running   0          3h55m
kube-system   heapster-v1.5.2-5c58f64f8b-55tgt                  4/4     Running   0          3h55m
kube-system   kubernetes-dashboard-5c848cc544-k6p5b             1/1     Running   0          3h55m
kube-system   monitoring-influxdb-grafana-v4-6d599df6bf-786zc   2/2     Running   0          3h55m
kube-system   tiller-deploy-77855d9dcf-t5wfx                    1/1     Running   0          17m