CptDolphin
CptDolphin

Reputation: 474

Install helm 2.13.0 on Minikube server (1.6.2) could not find tiller

Hey I'm installing fresh minikube and try to init helm on it no in 3.x.x but 2.13.0 version.

$ minikube start
šŸ˜„  minikube v1.6.2 on Darwin 10.14.6
āœØ  Automatically selected the 'hyperkit' driver (alternates: [virtualbox])
šŸ”„  Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
šŸ³  Preparing Kubernetes v1.17.0 on Docker '19.03.5' ...
šŸšœ  Pulling images ...
šŸš€  Launching Kubernetes ...
āŒ›  Waiting for cluster to come online ...
šŸ„  Done! kubectl is now configured to use "minikube"

$ kubectl -n kube-system create serviceaccount tiller
serviceaccount/tiller created

$ kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller created

$ helm init --service-account tiller
$HELM_HOME has been configured at /Users/<user>/.helm.
Error: error installing: the server could not find the requested resource

$ 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 -

deployment.apps/tiller-deploy created
service/tiller-deploy created

$ helm init --service-account tiller
 59 ### ALIASES
$HELM_HOME has been configured at /Users/<user>/.helm.
Error: error installing: the server could not find the requested resource

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Error: could not find tiller

I try to do same on some random other ns, and with no result:

$ kubectl create ns deployment-stuff
namespace/deployment-stuff created

$ kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin \
        --user=$(gcloud config get-value account)

clusterrolebinding.rbac.authorization.k8s.io/cluster-admin-binding created

$ kubectl create serviceaccount tiller --namespace deployment-stuff
kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin \
    --serviceaccount=deployment-stuff:tiller

serviceaccount/tiller created
clusterrolebinding.rbac.authorization.k8s.io/tiller-admin-binding created

$ helm init --service-account=tiller --tiller-namespace=deployment-stuff

Creating /Users/<user>/.helm
Creating /Users/<user>/.helm/repository
Creating /Users/<user>/.helm/repository/cache
Creating /Users/<user>/.helm/repository/local
Creating /Users/<user>/.helm/plugins
Creating /Users/<user>/.helm/starters
Creating /Users/<user>/.helm/cache/archive
Creating /Users/<user>/.helm/repository/repositories.yaml
Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /Users/<user>/.helm.
Error: error installing: the server could not find the requested resource

$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. āŽˆ Happy Helming!āŽˆ

$ helm list
Error: could not find tiller

$ helm list --tiller-namespace=kube-system
Error: could not find tiller

$ helm list --tiller-namespace=deployment-stuff
Error: could not find tiller

Same error everywhere Error: error installing: the server could not find the requested resource any ideas how to approach it ?

I installed helm with those commands and works fine with my gcp clusters, helm list returns full list of helms.

wget -c https://get.helm.sh/helm-v2.13.0-darwin-amd64.tar.gz
tar -zxvf helm-v2.13.0-darwin-amd64.tar.gz
mv darwin-amd64/helm /usr/local/bin/helm

tbh I have no idea what's going on, sometimes it works fine on minikube sometimes I get these errors.

Upvotes: 2

Views: 1253

Answers (2)

Son H. Nguyen
Son H. Nguyen

Reputation: 396

Check logs of error tiller pod by:

kc -n kube-system describe pod tiller-deploy-*

You'll see following error:

Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.15.1": rpc error: code = Unknown desc = Error response from daemon: Head "https://gcr.io/v2/kubernetes-helm/tiller/manifests/v2.15.1": unknown: Project 'project:kubernetes-helm' not found or deleted.

The reason is they changed the image location, so the old version of helm couldn't pull it. Pull the image manually by:

docker pull ghcr.io/helm/tiller:v2.15.1

Tag the pulled image to the version that helm needed at the first place

docker tag ghcr.io/helm/tiller:v2.15.1 gcr.io/kubernetes-helm/tiller:v2.15.1

Re-init tiller (helm server):

helm init

and you'll see the tiller deploy is running.

Upvotes: 0

Piotr Malec
Piotr Malec

Reputation: 3647

This can be fixed by deleting the tiller deployment and service and rerunning the helm init --override command after first helm init.

So after running commands You listed:

$ kubectl -n kube-system create serviceaccount tiller
serviceaccount/tiller created

$ kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller created

$ helm init --service-account tiller

And then finding out that tiller could not be found.

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Error: could not find tiller

Run the following commands:

1.

$ kubectl delete service tiller-deploy -n kube-system

2.

$ kubectl delete deployment tiller-deploy -n kube-system

3.

helm init --override spec.selector.matchLabels.'name'='tiller',spec.selector.matchLabels.'app'='helm' --output yaml | sed 's@apiVersion: extensions/v1beta1@apiVersion: apps/v1@' | kubectl apply -f -

After that You can verify if it worked with:

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Error: could not find a ready tiller pod

This one needs little more time, give it few seconds.

$ helm version
Client: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.0", GitCommit:"79d07943b03aea2b76c12644b4b54733bc5958d6", GitTreeState:"clean"}

Tell me if it worked.

Upvotes: 3

Related Questions