当前位置:网站首页>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
边栏推荐
- Practice | extreme optimization of script errors - make script errors clear at a glance
- Naacl 2022 | distillation of machinetranslation SOTA model
- SLAM中的子图
- 有遇到用flink-cdc采集MySQL-RDS的时候,datetime类型的字段,采集过来后和源表
- Tencent cloud released the upgraded version of CDW Clickhouse to provide a fast experience for massive data real-time analysis scenarios
- c# 国内外ORM 框架 dapper efcore sqlsugar freesql hisql sqlserver数据常规插入测试性能对比
- controller、service、dao之间的关系
- A user level thread library based on C language
- Real test = "half product + Half development"?
- InheritableThreadLocal 在线程池中进行父子线程间消息传递出现消息丢失的解析
猜你喜欢

为什么信息化 ≠ 数字化?终于有人讲明白了

Real test = "half product + Half development"?

SpingMVC请求和响应

MySQL foundation - transaction

C winfrom chart chart control bar chart and line chart

A simple but scalable feature normalization method

Take another picture of cloud redis' improvement path

Graduates are confused and middle-aged people are anxious. How can the career path become wider and wider?

A user level thread library based on C language

Us chips are hit hard again, and Intel may be defeated by TSMC and reduced to the third place in the world
随机推荐
InheritableThreadLocal 在线程池中进行父子线程间消息传递出现消息丢失的解析
After eight years of testing and opening experience and interview with 28K company, hematemesis sorted out high-frequency interview questions and answers
Redis布隆过滤器和布谷鸟过滤器
如何配置 logback?30分鐘讓你徹底學會代碼熬夜敲
New feature of C11 - Auto and decltype type type indicators
Real test = "half product + Half development"?
Us chips are hit hard again, and Intel may be defeated by TSMC and reduced to the third place in the world
Take another picture of cloud redis' improvement path
NVIDIA安装最新显卡驱动
iNFTnews | Meta在元宇宙中的后续计划会是什么?
【Oracle】基础知识面试题
Simulink simulation mode
An error is reported in the Flink SQL rownumber. Who has met him? How to solve it?
What is the follow-up plan of infotnews | meta in the metauniverse?
LSB hidden items of stream carrier based on assembly implementation
英联邦国家有哪些
Practice | extreme optimization of script errors - make script errors clear at a glance
Why does selenium become the first choice for web automated testing? (source code attached)
isEmpty 和 isBlank 的用法区别,居然一半的人答不上来?
C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad