Search code examples
kuberneteskubernetes-helmkubernetes-dashboard

Installing kubernetes-dashboard with helm fails


I've just created a new kubernetes cluster. The only thing I have done beyond set up the cluster is install Tiller using helm init and install kubernetes dashboard through helm install stable/kubernetes-dashboard.

The helm install command seems to be successful and helm ls outputs:

NAME                    REVISION        UPDATED                         STATUS          CHART                           APP VERSION     NAMESPACE
exhaling-ladybug        1               Thu Oct 24 16:56:49 2019        DEPLOYED        kubernetes-dashboard-1.10.0     1.10.1          default  

However after waiting a few minutes the deployment is still not ready.

Running kubectl get pods shows that the pod's status as CrashLoopBackOff.

NAME                                    READY   STATUS             RESTARTS   AGE
exhaling-ladybug-kubernetes-dashboard   0/1     CrashLoopBackOff   10         31m

The description for the pod shows the following events:

Events:
  Type     Reason     Age                   From                 Message
  ----     ------     ----                  ----                 -------
  Normal   Scheduled  31m                   default-scheduler    Successfully assigned default/exhaling-ladybug-kubernetes-dashboard to nodes-1
  Normal   Pulling    31m                   kubelet, nodes-1     Pulling image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1"
  Normal   Pulled     31m                   kubelet, nodes-1     Successfully pulled image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1"
  Normal   Started    30m (x4 over 31m)     kubelet, nodes-1     Started container kubernetes-dashboard
  Normal   Pulled     30m (x4 over 31m)     kubelet, nodes-1     Container image "k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1" already present on machine
  Normal   Created    30m (x5 over 31m)     kubelet, nodes-1     Created container kubernetes-dashboard
  Warning  BackOff    107s (x141 over 31m)  kubelet, nodes-1     Back-off restarting failed container

And the logs show the following panic message

panic: secrets is forbidden: User "system:serviceaccount:default:exhaling-ladybug-kubernetes-dashboard" cannot create resource "secrets" in API group "" in the namespace "kube-system"

Am I doing something wrong? Why is it trying to create a secret somewhere it cannot?

Is it possible to setup without giving the dashboard account cluster-admin permissions?


Solution

  • Check this out mate:

    https://akomljen.com/installing-kubernetes-dashboard-per-namespace/

    You can create your own roles if you want to.