Helm not initializing

10/17/2019

I am trying to initialize the helm chart using "helm init" command and also with "helm init --wait". But when I am running the command , I am only getting the message that,

$HELM_HOME has been configured at /home/docker/.helm.
Error: error installing: the server could not find the requested resource

Result of "helm version" command is like following,

Client: &version.Version{SemVer:"v2.14.3", 
GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Error: could not find tiller

Updates On Running Commands for Trubleshooting

kubectl -n kube-system get pods

NAME                                       READY   STATUS    RESTARTS   AGE
calico-kube-controllers-6c9c86c88b-5wngt   1/1     Running   0          42h
calico-node-cvbdb                          1/1     Running   1          42h
calico-node-rpt9v                          1/1     Running   0          42h
coredns-58687784f9-nnq6g                   1/1     Running   5          42h
coredns-58687784f9-sc6p5                   1/1     Running   8          42h
dns-autoscaler-79599df498-wv7cp            1/1     Running   0          42h
kube-apiserver-mildevkub030                1/1     Running   0          42h
kube-controller-manager-mildevkub030       1/1     Running   3          42h
kube-proxy-wb7gp                           1/1     Running   0          42h
kube-proxy-xll9c                           1/1     Running   0          42h
kube-scheduler-mildevkub030                1/1     Running   0          42h
kubernetes-dashboard-556b9ff8f8-6kls9      1/1     Running   0          42h
nginx-proxy-mildevkub040                   1/1     Running   0          42h
nodelocaldns-kfrlm                         1/1     Running   0          42h
nodelocaldns-tvclh                         1/1     Running   0          42h
tiller-deploy-77855d9dcf-l4l85             1/1     Running   0          100m

kubectl -n kube-system get deployments

NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
calico-kube-controllers   1/1     1            1           42h
coredns                   2/2     2            2           42h
dns-autoscaler            1/1     1            1           42h
kubernetes-dashboard      1/1     1            1           42h
tiller-deploy             1/1     1            1           21h 

kubectl -n kube-system describe deployment tiller-deploy

Name:                   tiller-deploy
Namespace:              kube-system
CreationTimestamp:      Thu, 17 Oct 2019 07:43:17 -0400
Labels:                 app=helm
                    name=tiller
Annotations:            deployment.kubernetes.io/revision: 1
                    kubectl.kubernetes.io/last-applied-configuration:

{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations": 
{},"creationTimestamp":null,"labels":{"app":"helm","name":"tiller"},...
Selector:               app=helm,name=tiller
Replicas:               1 desired | 1 updated | 1 total | 1 available | 0 
unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  25% max unavailable, 25% max surge
Pod Template:
  Labels:           app=helm
                name=tiller
  Service Account:  tiller
Containers:
tiller:
 Image:       gcr.io/kubernetes-helm/tiller:v2.14.3
 Ports:       44134/TCP, 44135/TCP
 Host Ports:  0/TCP, 0/TCP
 Liveness:    http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
Readiness:   http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
  Environment:
   TILLER_NAMESPACE:    kube-system
   TILLER_HISTORY_MAX:  0
 Mounts:                <none>
Volumes:                 <none>
Conditions:
 Type           Status  Reason
 ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    True    NewReplicaSetAvailable
 OldReplicaSets:  <none>
NewReplicaSet:   tiller-deploy-77855d9dcf (1/1 replicas created)
Events:          <none>
-- Jacob
kubernetes-helm

1 Answer

10/17/2019
  1. Reset helm:
helm reset --force
  1. Create service account for RBAC enabled cluster.

    In rbac-config.yaml:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: tiller
    namespace: kube-system
$ kubectl create -f rbac-config.yaml
serviceaccount "tiller" created
clusterrolebinding "tiller" created
  1. Initialize helm:

Try the first command, if it doesn't work, try 2nd one.

$ helm init --service-account tiller --history-max 200
$ helm init --service-account tiller --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -
-- Kamol Hasan
Source: StackOverflow