当前位置:网站首页>Kubernetes部署Dashboard(WEB UI管理界面)
Kubernetes部署Dashboard(WEB UI管理界面)
2022-06-29 17:02:00 【全栈程序员站长】
搭建Dashboard(k8s Web UI)
基于已经搭建好的Kubernetes集群进行部署Dashboard
下载yaml文件
wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.4/aio/deploy/recommended.yaml国内网下载此文件应该会出错
下载镜像
部署时也会下载,为了部署时可以更快的Running,所以提前下载
docker pull kubernetesui/dashboard:v2.0.4修改yaml文件
默认这个文件部署之后不是通过节点ip访问的,为了更友好的访问,采用 NodePort的方式部署
# dashboard 2.0.4版本
# 40行添加,spec下面
type: NodePort修改镜像下载策略
因为刚才已经下载了镜像,这里修改为如果镜像存在直接使用,不存在才回去下载
# 191行
imagePullPolicy: IfNotPresent
# 将Always修改为IfNotPresent部署Dashboard
# kubectl apply -f recommended.yaml
namespace/kubernetes-dashboard created
serviceaccount/kubernetes-dashboard created
service/kubernetes-dashboard created
secret/kubernetes-dashboard-certs created
secret/kubernetes-dashboard-csrf created
secret/kubernetes-dashboard-key-holder created
configmap/kubernetes-dashboard-settings created
role.rbac.authorization.k8s.io/kubernetes-dashboard created
clusterrole.rbac.authorization.k8s.io/kubernetes-dashboard created
rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
clusterrolebinding.rbac.authorization.k8s.io/kubernetes-dashboard created
deployment.apps/kubernetes-dashboard created
service/dashboard-metrics-scraper created
deployment.apps/dashboard-metrics-scraper created查看是否运行
[[email protected] ~]# kubectl get pods -n kubernetes-dashboard
NAME READY STATUS RESTARTS AGE
dashboard-metrics-scraper-6b4884c9d5-gqmn4 1/1 Running 0 2m39s
kubernetes-dashboard-8478c4964c-r2vt8 1/1 Running 0 2m39s查看映射到主机的访问端口
主机ip:192.168.1.10
映射port:30321
[[email protected] ~]# kubectl get svc -n kubernetes-dashboard
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
dashboard-metrics-scraper ClusterIP 10.96.237.228 <none> 8000/TCP 3m8s
kubernetes-dashboard NodePort 10.106.24.161 <none> 443:30321/TCP 3m9s验证访问Dashboard
网络内服务器访问https://NodeIP:port,也就是https://192.168.1.10:30321
验证方式这里就选择token,需要获取token,往下看
Token认证方式登录
给所有namespace授权
# 创建serviceaccount
kubectl create serviceaccount dashboard-serviceaccount -n kubernetes-dashboard
# 创建clusterrolebinding
kubectl create clusterrolebinding dashboard-cluster-admin --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-serviceaccount获取token
[[email protected] ~]# kubectl get secret -n kubernetes-dashboard | grep dashboard-serviceaccount-token
dashboard-serviceaccount-token-vd64k kubernetes.io/service-account-token 3 55s
[[email protected] ~]# kubectl describe secret dashboard-serviceaccount-token-vd64k -n kubernetes-dashboard将token字段的值复制到网页的token部分,即可登录
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/101928.html原文链接:https://javaforall.cn
边栏推荐
- 机器学习8-人工神经网络
- Redolog and binlog
- Stable currency risk profile: are usdt and usdc safe?
- Take another picture of cloud redis' improvement path
- 研究所的这些优势真香!上岸率还极高!
- Mathematical knowledge: finding combinatorial number II - finding combinatorial number
- AI and creativity
- Shenzhen internal promotion | Shenzhen Institute of computing science recruits assistant machine learning Engineer (school recruitment)
- What are the advantages of SaaS services
- 微博评论高性能高可用架构设计(架构实战营 模块五作业)
猜你喜欢

Why does selenium become the first choice for web automated testing? (source code attached)

基于深度学习的Wiki中文语料词word2vec向量模型

如何创建虚拟形象

【南京大学】考研初试复试资料分享

Greedy Apple plans to raise the price of iphone14, which will provide opportunities for Chinese mobile phones

【R语言数据科学】:文本挖掘(以特朗普推文数据为例)

全面剖析Seata 分布式事务 AT 与XA

@Component与@Configuration区别

windows平台下的mysql启动等基本操作

After reading the complete code
随机推荐
Comprehensive analysis of Seata distributed transaction at and XA
力扣解法汇总535-TinyURL 的加密与解密
Shenzhen internal promotion | Shenzhen Institute of computing science recruits assistant machine learning Engineer (school recruitment)
深度剖析monai(一) Data和Transforms部分
PHP delete directory
有遇到用flink-cdc采集MySQL-RDS的时候,datetime类型的字段,采集过来后和源表
固态存储厂商忆联加入龙蜥社区,共建开源新生态
XAMPP Apache安装时问题总结
基于深度学习的Wiki中文语料词word2vec向量模型
「科普大佬说」AI与创造力
贪婪的苹果计划提高iPhone14的价格,这将为中国手机提供机会
图文带你彻底弄懂MySQL事务原子性之UndoLog
controller、service、dao之间的关系
Simulink simulation mode
redolog和binlog
广发易淘金和东方财富哪个更好,更安全一些
Gradle下载慢或无法下载
What's the difference between isempty and isblank? Half of the people can't answer it?
Practice | extreme optimization of script errors - make script errors clear at a glance
Basics | draw arcs in the physics engine