error installing helm chart in kubernates

9/24/2019

I am trying to install helm chart on kubernates cluster. When i try to initialize the helm using init command, it is throwing error as "error installing: the server could not find the requested resource"

provider.helm v2.14.3

provider.kubernetes v1.16

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
$ helm version
Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Error: could not find tiller
$ helm init
Creating /home/cloud_admin/.helm
Creating /home/cloud_admin/.helm/repository
Creating /home/cloud_admin/.helm/repository/cache
Creating /home/cloud_admin/.helm/repository/local
Creating /home/cloud_admin/.helm/plugins
Creating /home/cloud_admin/.helm/starters
Creating /home/cloud_admin/.helm/cache/archive
Creating /home/cloud_admin/.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 /home/cloud_admin/.helm.
Error: error installing: the server could not find the requested resource
$ kubectl get node -n kube-system
NAME               STATUS   ROLES    AGE     VERSION
openamvmimsload0   Ready    master   5h11m   v1.16.0
openamvmimsload1   Ready    <none>   5h1m    v1.16.0
$ kubectl config get-clusters
NAME
kubernetes
$ kubectl cluster-info
Kubernetes master is running at https://172.16.128.40:6443
KubeDNS is running at https://172.16.128.40:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
$ kubectl get svc
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   5h15m
-- Debiprasanna Mallia
kubeadm
kubectl
kubernetes
kubernetes-helm

1 Answer

9/24/2019

This seems to be a bug with Helm 2.14.3 (and previous) and Kubernetes 1.16 Helm init fails on Kubernetes 1.16.0 bug report on GitHub.

The ticket lists some workarounds - the simplest one is:

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 -

or with RBAC enabled and tiller service account:

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 -
-- koe
Source: StackOverflow