查看原文
其他

KubeGems:Kubernetes(K8S)集群可视化界面部署

李逸皓 运维book思议 2024-04-22

先放个链接,万一有人关注呢

优质文章推荐

↓ ↓ ↓ ↓ ↓

Kubernetes(K8S)部署集群全流程详解:基于Kubeadm

CentOS再见!拥抱Rocky or Alma

Linux系统修改静态IP地址自动化脚本

Linux系统服务巡检脚本

Linux系统不优化的后果有多严重?




一、KubeGems部署

需要结合官方文档:纯官方文档也有不可用的地方

KubeGems部署需要基于Kubernetes集群的环境,高可用集群和非高可用集群均可,在这里基于非高可用集群部署

kubernetes 1.20 及以上版本( 1.23+最佳 )

1.核心组件

名称描述
kubegems-installerkubegems 安装程序,安装 kubegems 组件及依赖组件
kubegemskubegems 核心组件,包含 UI 界面及相关 API 服务
kubegems-localkubegems 边缘组件,安装在托管集群上,获取集群信息和执行操作

2.部署kubegems-installer

installer 是用于安装 kubegems 主要组件和插件的控制器

[root@master ~]# kubectl create namespace kubegems-installer[root@master ~]# kubectl apply -f https://github.com/kubegems/kubegems/raw/main/deploy/installer.yaml

注意:main这里是版本,可以写具体的版本号:比如v1.23.2

验证

[root@master ~]# kubectl -n kubegems-installer get poNAME READY STATUS RESTARTS AGEkubegems-installer-757d4c64db-cf2x2   1/1     Running   0          20m

2.安装local-path-provisioner

kubegems 需要持久化一些重要数据,安装local-path-provisioner

[root@master ~]# kubectl create namespace local-path-storage[root@master ~]# kubectl apply -f https://raw.githubusercontent.com/kubegems/kubegems/main/deploy/addon-local-path-provisioner.yaml[root@master kubegems]# vi addon-local-path-provisioner.yaml# https://github.com/rancher/local-path-provisioner/tree/master/deploy/chartapiVersion: plugins.kubegems.io/v1beta1kind: Pluginmetadata: name: local-path-provisioner namespace: local-path-storagespec: kind: helm url: https://github.com/rancher/local-path-provisioner/archive/refs/tags/v0.0.22.tar.gz path: local-path-provisioner-0.0.22/deploy/chart/local-path-provisioner version: 0.0.22 values: storageClass: defaultClass: true provisionerName: rancher.io/local-path nodePathMap: - node: DEFAULT_PATH_FOR_NON_LISTED_NODES paths:          - /data

3.部署 kubegems

# kubectl create namespace kubegems# wget https://github.com/kubegems/kubegems/raw/main/deploy/kubegems.yaml# kubectl create -f kubegems.yaml

验证

[root@master ~]# kubectl -n kubegems get podNAME READY STATUS RESTARTS AGEkubegems-api-7856cddc86-zxf2m 1/1 Running 6 (148m ago) 152mkubegems-argo-cd-app-controller-57c756777c-qgtkb 1/1 Running 0 152mkubegems-argo-cd-repo-server-84bc9df4cd-cvhmk 1/1 Running 0 152mkubegems-argo-cd-server-58d6ccc99-mqb4k 1/1 Running 0 152mkubegems-chartmuseum-74d498759c-rl49v 1/1 Running 0 152mkubegems-charts-init-v1.21.1-2tn8s 0/1 Completed 0 152mkubegems-dashboard-777875598f-7pfvx 1/1 Running 0 152mkubegems-gitea-0 1/1 Running 0 152mkubegems-init-v1.21.1-gpvrw 0/1 Completed 5 152mkubegems-msgbus-7c6c4c66c-kq8xw 1/1 Running 6 (148m ago) 152mkubegems-mysql-0 1/1 Running 0 152mkubegems-redis-master-0 1/1 Running 0 136mkubegems-worker-85c8d75ff7-2b7rr                   1/1     Running     6 (148m ago)   152m

4.访问kubegems仪表板

# kubectl -n kubegems port-forward svc/kubegems-dashboard 8088:80 --address 0.0.0.0

5.浏览器访问

http://192.168.26.200:8088用户:admin密码:demo!@#admin

三、连接Kubernetes集群

导入 Kubernetes 集群

使用 admin 账号登录 KubeGems 管理后台,点击右下角 【工具箱】 图标,进入 【系统管理】,点击 【添加集群】,将集群的 kubeconfig 文件粘贴至文本框。

查看kubeconfig文件,复制所有内容粘贴到页面

# cat .kube/configapiVersion: v1clusters:- cluster: certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJek1ESXhNREExTkRnek1Wb1hEVE16TURJd056QTFORGd6TVZvd0ZURVRN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GtPZ0RGZ1FTdUNKazUzOThHekhDRTBZL1lGU1BLZmtMTnhHWmRMV0ZOaEplTS9xNDRmTm9pblR2ClpEcll3ajcvOHRaeS9mdFdTTklsVk5TdDJ5UTJDYmQ1VGRiZmE3T1FBUjZjY21tSytiQjM5L2o2UDRya1l6SDEKNFRvPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== server: https://192.168.26.200:6443 name: kubernetescontexts:- context: cluster: kubernetes user: kubernetes-admin name: kubernetes-admin@kubernetescurrent-context: kubernetes-admin@kuberneteskind: Configpreferences: {}users:- name: kubernetes-admin user: client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURJVENDQWdtZ0F3SUJBZ0lJUTlRTUtIb09zUVl3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TXpBeU1UQXdOVFE0TXpGYUZ3MHlOREF5TVRBd05UUTRNekphTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTFCUFVHdWJQRjNXZ3hJWG8KeXl3bDgrT1dFVHdYMFlIOE14S3JVSE5iUm1qNjlIZmw0cHpJWVpMaDJvUWVvMHVBdTJNdUVhNXNKTjZ4N2hGTQozR3J2MXRDNDBTZzNFSlprdWY3OWxRNjRKOHRxRHdHVzA3eHZHaU4rT0J1c0d0TW01bzNneENMUjErL1B0ZUFDCm9ucFo3SXRjaEg0NVo2dkJOcXNpTExzdWo4V1RKTlNhblpVZ2VDZHZ3dTlLOGl2clRXakpIZnQ2R29nMGlhSVQKRHpJVWZyamVBTDA5dHdSTS9UaVJDTDR0S1lOZXZDWXhrK0N3aVkrSUk0SG8wMUZDVWNXSnN0MHhuK3NqZVVnaw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ZRXlnL254UTBOQnRqWkRaZnhnMGNkQUpKRmQ4clZuWWZpRApMZGs1UFZOTENJUHF1L0xLV3hhaEh1MDdJTlA3TVNtMklkQmtGZFRvWkM3T1dab1V2a1VnSy9aTWJ1R01kbisyCk1vZ3ZmajZqekFYdkRqTVBnSFNncjUvQ2J6S2pnUXczNFdoaDZKWEZBb0dBRVFObnFOeGtFNDU4WkYvT2tXL3kKa1BicjdhYnZkbXVRZU54WUtCamFsOHp2OTlyOHpHY1E0RWlCZTlseFN3V0NGTXZNeEIvYnhwN1h1eEovc0VucApybzR2cG0zUlhCRzNTV1hNeTFXSUVSS2lmMlJwVVdiUmNMaUw4UFU3b08zbXVreE1qSTRHbFNKUUlZTVpEcXI3CnVrSWRBU3E4cUxSdmdVVUZvZ2I0bVhFQ2dZRUF0dGVWLzNvMHhZWHRwR1A0M04xc0dkaXJpOGJuaGZya0U0cWMKUGVYMFBvc2RuR3FYcHZHcXcraG9oRmdHSXFjU0xhWjRsWjVkbHZ5Q01vOGMvN0VhekZpcHFzYUViMUJlYkhYYwpBOUlOZVF2NjU3T3JxWlZvV3dGTEhUZzkwL2hXTDhaNUFtamxyVDF4TlZWRXdUZkN2eHlvOHhwNFFYSzl5NzlCClNsZjhwbmtDZ1lCRFJVelZTbjQ0S25yblZZTUJKMHdkbndSaGpYZEExTEZnWHYxblZKL1h4cDgySlF5emdWR3YKTUVncG1PUzQvbGZ1YjNKTUY1K3pocVBsVk9VYVcyWFdZNDB4UzRBOG9tUmNhOW52eGtmUjd4Sk9aR2FXVFQ5QQpXSXI2ZDdMTStJY0VYT3oxaWpnT0R4ZVkrQWJHWEo1OG8rdSszZFFUVHk2d1E4b3gzeEsybEE9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo=

输入集群名称 等其他选项。

检测集群连接状态,等待状态正常后,点击 【下一步】进入集群配置界面

来不及解释了,快上车!(进群看公告,已加群的小伙伴无需重复添加)

欢迎新的小伙伴加入!在这里,我们鼓励大家积极参与群内讨论和交流,分享自己的见解和经验,一起学习和成长。同时,也欢迎大家提出问题和建议,让我们不断改进和完善这个平台。

              ↓↓↓ 点个在看,无需赞赏!

继续滑动看下一个
向上滑动看下一个

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存