Search code examples
azurekubernetes-helmazure-aks

Getting the Error: could not find the tiller while checking the helm version


I am trying to install the helm in the kubernetes, I have installed the helm successfully. When I check the helm version it is showing the below error

`helm version
Client: $version .version{SemVer:V2XXX",Git commit:"XXXXXXXXXXXXXXXXX",GitTreeState:  "clean"}
Error:could not find the tiller`

When I executed the Init command it is showing Tiller is already installed in the cluster

helm init --history-max 200 --service-account tiller

$HELM_HOME has been configured at home/user/.helm
warning: Tiller is already installed in the cluster

When I check the logs for the pod I am able to see below error

`Type Reason Age From Message


Waring: FailedCreate 11m (x25 over 132m) replicaset-controller error creating: pod "tiller-deploy-xxxxx" is forbidden: errorlooking up service account :tiller not found"`

How to resolve this issue any idea?


Solution

  • I tried to reproduce the same issue in my environment and got the below results

    When I check the helm version I got the same Error

    enter image description here

    When I do the init command it is showing the same error like its already exist

    helm init --history-max 200 --service-account tiller
    

    enter image description here

    I am getting this error because of I am not having the service account To resolve this issue I have created the yaml file with service account as shown

    I have created the service account using below script, this script i have taken from the SO link and made the changes as per requirements

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      annotations:
        kubectl.kubernetes.io/last-applied-configuration: |
          {"apiVersion":"rbac.authorization.k8s.io/v1","kind":"ClusterRoleBinding","metadata":{"annotations":{},"name":"tiller"},"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"ClusterRole","name":"cluster-admin"},"subjects":[{"kind":"ServiceAccount","name":"tiller","namespace":"kube-system"}]}
      creationTimestamp: "XXXXXXX"
      name: tiller
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: cluster-admin
    subjects:
    - kind: ServiceAccount
      name: tiller
      namespace: kube-system
    

    I have deployed this service account using below command

    kubectl apply -f filename.yaml
    

    enter image description here

    Deleted the replica set and recreated new replica sets again

    kubectl  -n kube-system delete replicaset replica-name
    

    After deleting the replica set it automatically recreates the new one

    kubectl -n kube-system get replicaset
    

    enter image description here

    When I check the helm version I am able to see as shown below

    enter image description here