简体   繁体   English

kubernetes:部署仪表板(ui)时出错

[英]kubernetes: Error deploying dashboard (ui)

I have successfully set up a kubernetes cluster on AWS using kops and the following commands: 我已经使用kops和以下命令在AWS上成功设置了kubernetes集群:

$ kops create cluster --name=<my_cluster_name> --state=s3://<my-state-bucket> --zones=eu-west-1a --node-count=2 --node-size=t2.micro --master-size=t2.small --dns-zone=<my-cluster-dns>

$ kops update cluster <my-cluster-name> --yes

The cluster has 1 master and 2 slaves. 集群有1个主节点和2个从节点。

I am trying to deploy the dashboard using the following command, as per these guidelines : 我正在按照以下准则使用以下命令部署仪表板:

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

1 . 1

I get the following error: 我收到以下错误:

secret "kubernetes-dashboard-certs" created
serviceaccount "kubernetes-dashboard" created
error: error validating "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml": error validating data: unknown object type schema.GroupVersionKind{Group:"rbac.authorization.k8s.io", Version:"v1", Kind:"Role"}; if you choose to ignore these errors, turn validation off with --validate=false

2 . 2

My dashboard is not accessible via https://<my_master_node_public_ip>/ui 无法通过https://<my_master_node_public_ip>/ui访问我的仪表板

Instead, I get the following: 相反,我得到以下信息:

kind    "Status"
apiVersion  "v1"
metadata    {}
status  "Failure"
message "endpoints \"kubernetes-dashboard\" not found"
reason  "NotFound"
details 
name    "kubernetes-dashboard"
kind    "endpoints"
code    404

3 . 3

After running 跑步后

kubectl proxy

and trying to access the dashboard via: 并尝试通过以下方式访问仪表板:

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

as instructed by the relevant guidelines, I have the exact same problem. 按照相关准则的指示,我有完全相同的问题。

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.1", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"clean", BuildDate:"2017-10-11T23:27:35Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.11", GitCommit:"b13f2fd682d56eab7a6a2b5a1cab1a3d2c8bdd55", GitTreeState:"clean", BuildDate:"2017-11-25T17:51:39Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

edit : here is the outcome when turning validation errors off: 编辑 :这是关闭验证错误时的结果:

$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml --validate=false
secret "kubernetes-dashboard-certs" configured
serviceaccount "kubernetes-dashboard" configured
service "kubernetes-dashboard" created
Error from server (BadRequest): error when creating "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml": Role in version "v1" cannot be handled as a Role: no kind "Role" is registered for version "rbac.authorization.k8s.io/v1"
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"
Error from server (BadRequest): error when creating "https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml": Deployment in version "v1beta2" cannot be handled as a Deployment: no kind "Deployment" is registered for version "apps/v1beta2"

The problem is that you're provisioning a Kubernetes 1.7 cluster with kops and using a dashboard manifest file for Kubernetes 1.8 so try the following (nuke the current deployment first), then: 问题是您要使用kops设置Kubernetes 1.7集群,并为Kubernetes 1.8使用仪表板清单文件,因此请尝试以下操作(首先破坏当前部署),然后再执行以下操作:

$ kops create cluster --kubernetes-version="1.8.1" --name=<my_cluster_name> --state=s3://<my-state-bucket> --zones=eu-west-1a --node-count=2 --node-size=t2.micro --master-size=t2.small --dns-zone=<my-cluster-dns>

As pointed out by pkaramol , alternatively to above you can upgrade kops to 1.8 and it should also work. 正如pkaramol指出的那样 ,您也可以将kops升级到1.8以上,它也应该可以使用。

Note that in any case, in order to get to the dashboard, do: 请注意,无论如何,为了进入仪表板,请执行以下操作:

$ kubectl proxy

... and then the dashboard should be accessible via http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/ ...然后应该可以通过http:// localhost:8001 / api / v1 / namespaces / kube-system / services / https:kubernetes-dashboard:/ proxy /访问仪表板

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM