helm: Helm init fails on Kubernetes 1.16.0
Output of helm version: v2.14.3
Output of kubectl version: client: v1.15.3, server: v1.16.0-rc.1
Cloud Provider/Platform (AKS, GKE, Minikube etc.): IBM Cloud Kubernetes Service
$ helm init --service-account tiller
$HELM_HOME has been configured at /Users/xxxx/.helm.
Error: error installing: the server could not find the requested resource
$ helm init --debug --service-account tiller
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: helm
name: tiller
name: tiller-deploy
namespace: kube-system
spec:
.
.
.
Looks like helm is trying to create tiller Deployment with: apiVersion: extensions/v1beta1
According to: https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16
that is no longer supported.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 64
- Comments: 83 (6 by maintainers)
Links to this issue
Commits related to this issue
- make: fix helm installation - Helm is still creating the Tiller deployment as `apiVersion: extensions/v1beta1`, which has been deprecated in Kubernetes 1.16 see more here https://kubernetes.io/... — committed to diegodelemos/reana by deleted user 5 years ago
- make: fix helm installation - Helm is still creating the Tiller deployment as `apiVersion: extensions/v1beta1`, which has been deprecated in Kubernetes 1.16 see more here https://kubernetes.io/... — committed to diegodelemos/reana by deleted user 5 years ago
- make: fix helm installation - Helm is still creating the Tiller deployment as `apiVersion: extensions/v1beta1`, which has been deprecated in Kubernetes 1.16. See more here https://kubernetes.io... — committed to diegodelemos/reana by deleted user 5 years ago
- make: fix helm installation - Helm is still creating the Tiller deployment as `apiVersion: extensions/v1beta1`, which has been deprecated in Kubernetes 1.16. See more here https://kubernetes.io... — committed to diegodelemos/reana by deleted user 5 years ago
- Fix helm for Kubernetes 1.16.2 Since upgrading k8s beyond 1.16.0 version, helm init does no longer work with helm < 2.16.0 due to https://github.com/helm/helm/issues/6374 This PR closes issue #5331 — committed to BjoernT/kubespray by BjoernT 5 years ago
- Fix helm for Kubernetes 1.16.2 (#5332) Since upgrading k8s beyond 1.16.0 version, helm init does no longer work with helm < 2.16.0 due to https://github.com/helm/helm/issues/6374 This PR closes issu... — committed to kubernetes-sigs/kubespray by BjoernT 5 years ago
- Fix helm for Kubernetes 1.16.2 (#5332) Since upgrading k8s beyond 1.16.0 version, helm init does no longer work with helm < 2.16.0 due to https://github.com/helm/helm/issues/6374 This PR closes issu... — committed to southbridgeio/kubespray by BjoernT 5 years ago
- Update init-master.bash updating helm initialization with kubernetes 1.17: https://github.com/helm/helm/issues/6374#issuecomment-533186177 — committed to neurolibre/kubeadm-bootstrap by ltetrel 4 years ago
If you want to use one less sed 😃
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 -Thanks!
The following sed works-for-me:
The issue with @mattymo solution (using kubectl patch --local) is that is seems to not work when its input contains multiple resource (here a Deployment and a Service).
current workaround seems to be something like this:
helm init --output yaml > tiller.yaml and update the tiller.yaml:
Kubernetes 1.16.0 was release yesterday: 9/18/2018.
Helm is broken on this latest Kubernetes release unless the above work around is used.
When will this issue be fixed and when will
Helm 2.15.0be released ?As a helm n00b who is using minikube, I was able to get around this issue by setting a kubernetes version like so:
Hope it helps!
#6462 has been merged and will be available in the next release (2.15.0). For now, feel free to use the workarounds provided above or use the canary release.
Thanks everyone!
This has been fixed in Helm 2.16.0.
@puww1010 I just redirected the output in a file, and then used VIM to change it. Below commands as reference.
Slight correction
Today I met the same issue, I changed the label by myself. I change the label to
apps/v1and addselectorpart,as of now it perform great, below is my yaml file:We’ve avoided updating tiller to apps/v1 in the past due to complexity with having
helm init --upgradereconciling bothextensions/v1beta1andapps/v1tiller Deployments. It looks like once we start supporting Kubernetes 1.16.0 we will have to handle that case going forward and migrate to the newer apiVersion.After successful init you won’t be able to install a chart package from repository until replacing extensions/v1beta1 in it as well. Here is how to adapt any chart from repository for k8s v1.16.0 The example is based on prometheus chart.
Replace extensions/v1beta1 to policy/v1beta1 PodSecurityPolicy:
NetworkPolicy apiVersion is handled well by _helpers.tpl for those charts where it is used.
Replace extensions/v1beta1 to apps/v1 in Deployment, StatefulSet, ReplicaSet, DaemonSet
Create a new package:
Install it:
helm install /home/vagrant/charts/stable/prometheus-9.1.1.tgzBased on https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/
P.S. For some charts with dependencies you might need to use
helm dependency updateand replace dependent tgz with patched ones if applicable.Here’s a short-term workaround:
Actually, it’s not good enough. I still get an error:
This can be patched in with:
Workaround, using
jq:helm init -o json | jq '(select(.apiVersion == "extensions/v1beta1") .apiVersion = "apps/v1")' | jq '(select(.kind == "Deployment") .spec.selector.matchLabels.app = "helm")' | jq '(select(.kind == "Deployment") .spec.selector.matchLabels.name = "tiller")' | kubectl create -f -+1
@DanielIvaylov
Just a side note to @PierreF’s and @mihivagyok’s solution. Those did not work for me when I use private helm repos.
I guess that happens because helm init is not run, just generates yaml file. I fixed that by running
helm init -cas an extra.I’m also getting the error:
I’m trying a solution proposed in this issue, particularly this one. However, after modifying the tiller.yaml file accordingly, I’m not able to update the configuration. I’m trying the following command in order to apply the changes/update the configuration:
But then, if I run:
The tiller2.yaml file shows:
Basically, the changes are not reflected. So I assume that I’m not updating the configuration properly. What would be the correct way to do it?
EDIT: I managed to get it running. I’m using Minikube, and in order to get it running, first I downgraded the Kubernetes version to 1.15.4.
Then, I was using a proxy, so I had to add Minikube’s IP to the NO_PROXY list:
192.168.99.101in my case. See: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/Note: After some further testing, perhaps the downgrade is not necessary, and maybe all I was missing was the NO_PROXY step. I added all
192.168.99.0/24,192.168.39.0/24and10.96.0.0/12to the NO_PROXY setting and now it seems to work fine.@cyrilthank if it’s minikube,
minikube config set kubernetes-version v1.15.4If you have applied the workaround mentioned above when working with
helm init, and still get the following error when trying things likehelm version, it’s because thehelmdeploymentcannot be found.You need to run
kubectl get events --all-namespaces | grep -i tillerto know why it’s not ready.For example, my issue is simply as below, because I don’t need
serviceaccount "tiller"withmicrok8s.So I did the workaournd without the service account
Yes, but his crazy sed hacks I can copy & paste, whereas this
helm init --override "apiVersion"="apps/v1"just does not work. Ok, the sed hack does not work either.It’s works, since kubernetes change apiVersion apps/v1 to for Deployment, there is one thing need to be change is we need to add selector matchLabels for spec
Its worked for me, Thank you so much
Thanks @UmamaheshMaxwell for your patient reply
I have an existing kubernetes 1.16 setup can you please confirm if I can try running these steps?
Thanks @MrSimonEmms mine is not mini I think I will have to go with @UmamaheshMaxwell 's steps
Canary image still produces the same error unless it doesn’t have this merge yet,
This solved my problem!
I tried doing this. After editing the file in VIM i use the
kubectl applycommand, but it doesn’t seem to do anything. When I runhelm init --service-account tiller --tiller-namespace kube-system --debug >> helm-init.yamlagain orhelm init --output yamlthe changes haven’t been applied. Anyone else experience this?@cyrilthank It seems the tiller error is because there is no tiller deployment running, try running this command to install tiller:
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 -helm version -sshould return the server (tiller) version if its up and running properly@gm12367 Yes, I can see the print but just output. So, what command I can change the output?