debugdockerMinor
helm - cannot get resource "namespaces" in API group
Viewed 0 times
cannotgroupresourcenamespacesgethelmapi
Problem
I installed Kubernetes, helm on the Ubuntu 16.04.6 Box, I want to deploy kubernetes-dashboard using helm but getting below error while installing it
Tools Version:
```
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
$ helm version
Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-kube-controllers-58dc446999-zrwz6 1/1 Running 0 4h41m
kube-system calico-node-wjczq 1/1 Running 0 4h41m
kube-system coredns-fb8b8dccf-fp9gx 1/1 Running 0 4h41m
kube-system coredns-fb8b8dccf-q574t 1/1 Running 0 4h41m
kube-system etcd-ubuntu1 1/1 Running
$ helm install stable/kubernetes-dashboard --name dashboard-demo
Error: release dashboard-demo failed: namespaces "default" is forbidden: User "system:serviceaccount:kube-system:default" cannot get resource "namespaces" in API group "" in the namespace "default"
$ helm list
Error: configmaps is forbidden: User "system:serviceaccount:kube-system:default" cannot list resource "configmaps" in API group "" in the namespace "kube-system"Tools Version:
```
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
$ helm version
Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system calico-kube-controllers-58dc446999-zrwz6 1/1 Running 0 4h41m
kube-system calico-node-wjczq 1/1 Running 0 4h41m
kube-system coredns-fb8b8dccf-fp9gx 1/1 Running 0 4h41m
kube-system coredns-fb8b8dccf-q574t 1/1 Running 0 4h41m
kube-system etcd-ubuntu1 1/1 Running
Solution
Check https://github.com/helm/helm/issues/3130, this might help.
I followed the instruction in the post:
This works for me.
I followed the instruction in the post:
kubectl --namespace kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller --upgradeThis works for me.
Code Snippets
kubectl --namespace kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller --upgradeContext
StackExchange DevOps Q#8047, answer score: 4
Revisions (0)
No revisions yet.