• 开启Kubernetes服务

  • 本地配置dashboard服务
# 查看本地配置
kubectl config get-contexts

# 使用本地docker-for-desktop
kubectl config use-context docker-for-desktop

# 部署k8s-dashboard服务
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

# 修改type: ClusterIP修改为type: NodePort,本地使用NodePort访问
kubectl -n kube-system edit service kubernetes-dashboard

# 获取dashboard服务暴露的访问端口
kubectl -n kube-system get service kubernetes-dashboard

# 查看登录token
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep kubernetes-dashboard-token|awk '{print $1}')|grep token:|awk '{print $2}'

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐