Kubernete-dashboard is not deploying

12/7/2017

I am trying to install kubernete-dashboard on my cluster. I am running the below command:-

kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml

Error:-

Error from server (BadRequest): error when creating "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml": RoleBinding in version "v1" cannot be handled as a RoleBinding: no kind "RoleBinding" is registered for version "rbac.authorization.k8s.io/v1"

Any suggestion ?

-- sanjay
kubernetes

1 Answer

2/20/2019

You can try to create a Service account in your cluster and a user administrator: Use this file...

apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kube-system

Create user

Create sample user (if using RBAC - on by default on new installs with kops / kubeadm):

kubectl create -f sample-user.yaml

Get login token:

kubectl -n kube-system get secret | grep admin-user
kubectl -n kube-system describe secret admin-user-token-<id displayed by previous command>

Login to dashboard

Apply kubectl proxy

Go to http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/login

Login with user and pass

kubectl config view

Login: admin Password: the password that is listed in ~/.kube/config (open file in editor and look for "password: ..."

Choose for login token and enter the login token from the previous step

Login with minikube

minikube dashboard --url

-- Anthony Chavarria Cespedes
Source: StackOverflow