kubernetes部署dashboard

下载dashboard资源清单文件

wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml

下载不了直接访问网址复制粘贴

修改recommended.yaml文件
创建pod
shell 复制代码
kubectl create -f recommended.yaml

[root@k8s-master dashboard]# kubectl get svc -n kubernetes-dashboard
NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE
dashboard-metrics-scraper   ClusterIP   10.110.7.250   <none>        8000/TCP        131m
kubernetes-dashboard        NodePort    10.99.209.27   <none>        443:30001/TCP   131m
网页打开

https://nodeip:30001

token从下面步骤中生成填写

eyJhbGciOiJSUzI1NiIsImtpZCI6IjB2MExlc1ZWMm8wZGstU09OTlZLc1U4aDF6MGx6alBYN1BLWVdWQkhINE0ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkYXNoYm9hcmQtYWRtaW4tdG9rZW4tbGhiOGwiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGFzaGJvYXJkLWFkbWluIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiZDU1ZjUxMDUtMWI3MC00NDFmLWE4YjgtOTMxZTRjY2ExMzFjIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmVybmV0ZXMtZGFzaGJvYXJkOmRhc2hib2FyZC1hZG1pbiJ9.zLdWBB9-lEDWyyUzyprh2Yab6FfZycEA2zoqehSDkGGyxx9dXEHMNxuJWIT2rrioo3q0Kpr8LZv0Vn2afVW3satyw4p_AxRvufnFjMlEJNfhT1P6ar6Jf7rSXUPotBl7DV0kH_PXL4zNpSZ4bt5P55OyRlUbmDZ161nwz3tZNQ8ePNRN-50Tw0MpJEM9LE4jB7eAxRRMYwXVmmA8hIxnDNC9faHaiBS-VFEWXC74LY9N5Jn9QqcPMvanjKmwF-TYPewiupKBgN0HQAnefN148PlzgAcEiXUF1DJHayxrY8R7ln2n-XX0hv6rKV8A_-CaUqImjQ4n2m8qvN6aAm4LOg

token生成如下
shell 复制代码
[root@k8s-master dashboard]# kubectl create serviceaccount admin-user -n kubernetes-dashboard
serviceaccount/admin-user created
[root@k8s-master dashboard]# kubectl create clusterrolebinding admin-user --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:admin-user
clusterrolebinding.rbac.authorization.k8s.io/admin-user created


[root@k8s-master dashboard]# kubectl -n kubernetes-dashboard get secrets
NAME                               TYPE                                  DATA   AGE
admin-user-token-q8l2j             kubernetes.io/service-account-token   3      115m
dashboard-admin-token-lhb8l        kubernetes.io/service-account-token   3      106m
default-token-bcjt2                kubernetes.io/service-account-token   3      117m
kubernetes-dashboard-certs         Opaque                                0      117m
kubernetes-dashboard-csrf          Opaque                                1      117m
kubernetes-dashboard-key-holder    Opaque                                2      117m
kubernetes-dashboard-token-wfp8z   kubernetes.io/service-account-token   3      117m

#选择dashboard-admin-token-lhb8l

[root@k8s-master dashboard]# kubectl -n kubernetes-dashboard describe secrets dashboard-admin-token-lhb8l | grep token | awk '{print $2}'
dashboard-admin-token-lhb8l
kubernetes.io/service-account-token
eyJhbGciOiJSUzI1NiIsImtpZCI6IjB2MExlc1ZWMm8wZGstU09OTlZLc1U4aDF6MGx6alBYN1BLWVdWQkhINE0ifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlcm5ldGVzLWRhc2hib2FyZCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkYXNoYm9hcmQtYWRtaW4tdG9rZW4tbGhiOGwiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGFzaGJvYXJkLWFkbWluIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiZDU1ZjUxMDUtMWI3MC00NDFmLWE4YjgtOTMxZTRjY2ExMzFjIiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Omt1YmVybmV0ZXMtZGFzaGJvYXJkOmRhc2hib2FyZC1hZG1pbiJ9.zLdWBB9-lEDWyyUzyprh2Yab6FfZycEA2zoqehSDkGGyxx9dXEHMNxuJWIT2rrioo3q0Kpr8LZv0Vn2afVW3satyw4p_AxRvufnFjMlEJNfhT1P6ar6Jf7rSXUPotBl7DV0kH_PXL4zNpSZ4bt5P55OyRlUbmDZ161nwz3tZNQ8ePNRN-50Tw0MpJEM9LE4jB7eAxRRMYwXVmmA8hIxnDNC9faHaiBS-VFEWXC74LY9N5Jn9QqcPMvanjKmwF-TYPewiupKBgN0HQAnefN148PlzgAcEiXUF1DJHayxrY8R7ln2n-XX0hv6rKV8A_-CaUqImjQ4n2m8qvN6aAm4LOg
相关推荐
阿里云云原生3 小时前
LLM 不断提升智能下限,MCP 不断提升创意上限
云原生
阿里云云原生3 小时前
GraalVM 24 正式发布阿里巴巴贡献重要特性 —— 支持 Java Agent 插桩
云原生
云上艺旅6 小时前
K8S学习之基础七十四:部署在线书店bookinfo
学习·云原生·容器·kubernetes
c无序7 小时前
【Docker-7】Docker是什么+Docker版本+Docker架构+Docker生态
docker·容器·架构
FixBug_Nick7 小时前
使用Docker安装及使用最新版本的Jenkins
docker·容器·jenkins
ghostwritten9 小时前
Run Milvus in Kubernetes with Milvus Operator
容器·kubernetes·milvus
Zero_to_zero12349 小时前
解决docker的ubuntu系统中文乱码问题
ubuntu·docker·容器
@郭小茶9 小时前
docker-compose方式部署docker项目
运维·docker·容器
duration~10 小时前
K8S自定义CRD
容器·贪心算法·kubernetes
ghostwritten12 小时前
Docker Registry Clean
运维·docker·容器