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

[亡魂溺海] 提交于 2020-01-25 09:34:06

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/48164369/kubernetes-1-8-dashboard-configurations-fails-with-error-no-kind-role-is-regi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!