当前位置: 首页 > article >正文

kubernetes部署dashboard

下载dashboard资源清单文件

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

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

修改recommended.yaml文件

image-20241114233521656

创建pod
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

image-20241114234003523

token从下面步骤中生成填写

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

token生成如下
[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


http://www.kler.cn/a/395400.html

相关文章:

  • C#从入门到放弃
  • 基于STM32设计的矿山环境监测系统(NBIOT)_262
  • C语言打印时间精确到毫秒
  • CCI3.0-HQ:用于预训练大型语言模型的高质量大规模中文数据集
  • CTF攻防世界小白刷题自学笔记13
  • 【算法一周目】双指针(2)
  • Ceph client 写入osd 数据的两种方式librbd 和kernel rbd
  • vxe-vxe-colgroup后端返回数据 对数据进行处理 动态合并分组表头(v-if控制表格渲染(数据请求完成后渲染))
  • 动态规划技巧点
  • C# 教程总结概括
  • Flink中自定义Source和Sink的使用
  • LeetCode297.二叉树的序列化和反序列化
  • 计算机网络前三章计算题总结
  • C++基础:Pimpl设计模式的实现
  • 【Pikachu】目录遍历实战
  • 论文解析:计算能力资源的可信共享:利益驱动的异构网络服务提供机制
  • 群控系统服务端开发模式-应用开发-前端角色功能开发
  • 解决Oracle DECODE函数字符串截断问题的深度剖析20241113
  • Ubuntu相关指令
  • 数据结构Python版
  • sqoop import将Oracle数据加载至hive,数据量变少,只能导入一个mapper的数据量
  • 【GPTs】MJ Prompt Creator:轻松生成创意Midjourney提示词
  • 【Git从入门到精通】——Git分支介绍与GitHub相关知识总结
  • Spring Boot与工程认证:计算机课程管理的新纪元
  • Spring Boot框架:电商系统的设计与实现
  • 037 RabbitMQ集群