在play-with-kubernetes中运行仪表板

时间:2017-10-24 09:34:09

标签: kubernetes

我正在尝试在play-with-kubernetes

内启动一个信息中心

我正在运行的命令:

启动管理节点

kubeadm init --apiserver-advertise-address $(hostname -i)

启动网络

kubectl apply -n kube-system -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

允许master保存节点(?)

kubectl taint nodes --all node-role.kubernetes.io/master-

等到dns结束

kubectl get pods --all-namespaces

加入节点(从admin启动复制,而不是从此处复制)

kubeadm join --token 43d52c.d72308004d523ac4 10.0.21.3:6443

下载并运行仪表板

curl -L -s https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml  | sed 's/targetPort: 8443/targetPort: 8443\n  type: NodePort/' | \
    kubectl apply -f -

不幸的仪表板不可用。 我该怎么做才能正确地将它部署到play-with-kubernetes中?

1 个答案:

答案 0 :(得分:3)

您需要使用heapster才能使用仪表板。所以也要执行这些:

kubectl apply -f https://github.com/kubernetes/heapster/raw/master/deploy/kube-config/rbac/heapster-rbac.yaml
kubectl apply -f https://github.com/kubernetes/heapster/raw/master/deploy/kube-config/influxdb/heapster.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/influxdb.yaml

此外,除非您想要进行身份验证,否则您需要使用以下内容授予仪表板管理员权限:

kubectl create clusterrolebinding insecure-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard

最终会出现一个端口链接(30xxx),但您需要将URL方案更改为来自http的https,并说服您的浏览器不关心不安全的证书。

您现在应该有一个工作仪表板。一块蛋糕;)