dashboard安装

#我这里使用的时nodePort方式来暴露端口,所以先把yaml文件下载下来方便修改
wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-c7/aio/deploy/recommended.yaml

#修改文件,内容大致如下
vim recommended.yaml

...................................
kind: Service
apiVersion: v1
metadata:
  labels:
    k8s-app: kubernetes-dashboard
  name: kubernetes-dashboard
  namespace: kubernetes-dashboard
spec:
  ports:
    - port: 443
      targetPort: 8443
      nodePort: 30001
  selector:
    k8s-app: kubernetes-dashboard
  type: NodePort
......................................

#然后使用浏览器访问集群任一节点ip加端口进行访问,注:一定要以https的方式去访问。(最好用火狐浏览器访问)
https://IP:30001

#网页选择令牌登陆,然后去到集群上查看 token ,复制粘贴过去即可
kubectl -n kube-system describe $(kubectl -n kube-system get secret -n kube-system -o name | grep namespace) | grep token
Last modification:April 20th, 2020 at 09:49 am
如果觉得我的文章对你有用,请随意赞赏