Search code examples
kuberneteskubectl

Kubernetes 1.8 dashboard configurations fails with error "no kind "Role" is registered for version "rbac.authorization.k8s.io/v1"


I have issue with kubernetes dashboard installation, appreciate your comments and solutions.

ERROR: unable to decode "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard-head.yaml": no kind "Role" is registered for version "rbac.authorization.k8s.io/v1" unable to decode "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard-head.yaml": no kind "RoleBinding" is registered for version "rbac.authorization.k8s.io/v1" unable to decode "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard-head.yaml": no kind "Deployment" is registered for version "apps/v1beta2"

kubectl version Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"269f928217957e7126dc87e6adfa82242bfe5b1e", GitTreeState:"clean", BuildDate:"2017-07-03T15:31:10Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.2", GitCommit:"269f928217957e7126dc87e6adfa82242bfe5b1e", GitTreeState:"clean", BuildDate:"2017-07-03T15:31:10Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}

kubectl api-versions apps/v1beta1 authentication.k8s.io/v1beta1 authorization.k8s.io/v1beta1 autoscaling/v1 batch/v1 certificates.k8s.io/v1alpha1 extensions/v1beta1 policy/v1beta1 rbac.authorization.k8s.io/v1alpha1 storage.k8s.io/v1beta1 v1

Pods Status kube-system kubernetes-dashboard-3725693093-zm11m 0/1 CrashLoopBackOff


Solution

  • If you don't have an RBAC enabled cluster, you won't be able to use RBAC objects, such as Role. That's why when trying to create a Role object, it fails saying it doesn't know anything about Role objects. From the docs

    When specified “RBAC” (Role-Based Access Control) uses the “rbac.authorization.k8s.io” API group to drive authorization decisions, allowing admins to dynamically configure permission policies through the Kubernetes API.

    You also need a more recent kubectl version, as mentioned in this comment. RBAC requires at least kubectl 1.6 and you have 1.5.