当前位置:网站首页>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
边栏推荐
- Comment configurer logback? 30 minutes pour apprendre à coder et à frapper tard.
- 深度剖析monai(一) Data和Transforms部分
- Flutter technology and Practice (1)
- What memory consuming data is stored in MySQL CDC jobmanager?
- What's the difference between isempty and isblank? Half of the people can't answer it?
- 如何创建虚拟形象
- How to configure logback? 30 minutes for you to thoroughly learn the code to stay up late and knock
- 线段树、树状数组模板(复制粘贴确实好用)
- 有遇到用flink-cdc采集MySQL-RDS的时候,datetime类型的字段,采集过来后和源表
- How to distinguish between instructions and data in the "group counting" CPU
猜你喜欢
随机推荐
[R language data science]: Text Mining (taking Trump's tweet data as an example)
又拍云 Redis 的改进之路
【R语言数据科学】:文本挖掘(以特朗普推文数据为例)
curl: (56) Recv failure: Connection reset by peer
When MySQL RDS is collected using Flink CDC, the datetime type field will be compared with the source table after collection
Naacl 2022 | distillation of machinetranslation SOTA model
Greedy Apple plans to raise the price of iphone14, which will provide opportunities for Chinese mobile phones
Fluent的msh格式网格学习
mysql数据库扫盲,你真的知道什么是数据库嘛
How to use openmesh to realize the conversion between 3D files of different formats
C语言微博用户管理系统
PHP删除目录
广发易淘金和东方财富哪个更好,更安全一些
【无标题】
自旋电子学笔记-张曙丰
Picture and text show you how to thoroughly understand the atomicity of MySQL transaction undolog
适合中小企业的项目管理系统有哪些?
After reading the complete code
6.26cf simulation game d: black and white questions
如何利用OpenMesh实现不同格式的3D文件间的转换