9

k8s1.23.8 安装kubegems管理界面

 2 years ago
source link: https://blog.51cto.com/flyfish225/5451730
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

标签(空格分隔): kubernetes系列

一:kubegems 的介绍

1.1 kubegems 介绍:

KubeGems 是一款以围绕 Kubernetes 通过自研和集成云原生项目而构建的通用性开源 PaaS 云管理平台。
经过近一年的持续迭代,当前 KubeGems 的核心功能已经初步具备多云多租户场景下的统一管理。
并通过插件化的方式,在用户界面中灵活控制包括监控系统、日志系统、微服务治理等众多插件的启用和关闭。
GitHub 仓库:https://github.com/kubegems/kubegems 
官方文档了解更多信息:https://www.kubegems.io
k8s1.23.8 安装kubegems管理界面_kubegems

1.2 kubegems 的生态

KubeGems广泛的使用来自包括 云原生基金会(CNCF) 和 Istio社区 开源的产品,
并在此基础上做了二次开发和适配。针对产品内部比较通用的需求,KubeGems也会及时将代码以PR的方式回馈社区,
以保证产品能够与社区进行同步更新。

为更好的降低用户对云原生生态内的熟悉门槛,
KubeGems提供了专门的安装控制器对集成的三方插件进行集中管理,
并以此保证我们的产品能始终如一的部署在不同方式构建的Kubernetes集群之上,
使用户能更完整能够体验到KubeGems的功能。
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_02

二:kubegems 的安装部署

2.1 kubegems 的组件介绍

k8s1.23.8 安装kubegems管理界面_kubegems_03

2.2 部署 KubeGems

installer 是用于安装 kubegems 主要组件和插件的控制器。 
其通过监听类型为 plugins.plugins.kubegems.io 的 CR,并根据其定义来下载和安装相应的 helm chart 或者 
kustomize 文件。
kubectl create namespace kubegems-installer
wget https://github.com/kubegems/kubegems/raw/main/deploy/installer.yaml
kubectl apply -f installer.yaml 

k8s1.23.8 安装kubegems管理界面_k8s1.23.8_04

k8s1.23.8 安装kubegems管理界面_kubegems_05
kubectl get pod -n kubegems-installer
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_06
安装依赖
kubegems 需要持久化一些重要数据,需要集群有可用的 CSI 插件

如果没有 CSI 插件,可以安装 local-path-provisioner

kubectl create namespace local-path-storage
wget https://raw.githubusercontent.com/kubegems/kubegems/main/deploy/addon-local-path-provisioner.yaml

kubectl apply -f addon-local-path-provisioner.yaml
k8s1.23.8 安装kubegems管理界面_kubegems_07
部署 kubegems 核心组件
默认使用 dockerhub 镜像,但如果您的网络在获取 docker.io quay.io gcr.io 上的镜像时较为缓慢,

可以使用我们在阿里云上的镜像。

注意:kubegems 默认使用名称为 local-path 的 storageClass 以及 tag 为 latest 的版本。 如果您想自定义 kubegems 版本或使用不同的 storageClass,

您需要在 apply 前下载并编辑 kubegems.yaml 文件。

kubectl create namespace kubegems

export STORAGE_CLASS=local-path  # 改为您使用的 storageClass
export KUBEGEMS_VERSION=v1.21.0  # change to specify kubegems version
curl -sL https://raw.githubusercontent.com/kubegems/kubegems/main/deploy/kubegems.yaml \
| sed -e "s/local-path/${STORAGE_CLASS}/g" -e "s/latest/${KUBEGEMS_VERSION}/g" \
> kubegems.yaml

kubectl apply -f kubegems.yaml

k8s1.23.8 安装kubegems管理界面_kubegems_08
k8s1.23.8 安装kubegems管理界面_kubegems_09
k8s1.23.8 安装kubegems管理界面_kubegems_10
修改镜像:

kubectl edit pod kubegems-charts-init-v1.21.0-wnxp7 -n kubegems 

----
image: docker.io/kubegems/appstore-charts:v1.21.0 改为:
 
image: docker.io/kubegems/appstore-charts:latest
----

kubectl get pod -n kubegems 

kubegems CR 下发后,大约需要 5 分钟才会一切正常,这取决于您的具体配置。

INFO
在启动完成之前会有许多 Pod 的状态为 CrashLoopBackOff,这是由于其依赖的服务
(mysql、redis、gitea、argocd 等)还在启动中,这是正常的,请耐心等待。
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_11
访问 kubegems 仪表板

kubectl get svc -n kubegems 

kubectl edit svc kubegems-dashboard -n kubegems
----

type:ClusterIP 改为 type:NodePort

-----

kubectl get svc -n kubegems 

·

k8s1.23.8 安装kubegems管理界面_k8s1.23.8_12
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_13
web 访问:http://172.16.10.11:30502
k8s1.23.8 安装kubegems管理界面_kubegems_14
user: admin
password: demo!@#admin
k8s1.23.8 安装kubegems管理界面_kubegems_15
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_16
导入k8s集群
k8s1.23.8 安装kubegems管理界面_kubegems_17
k8s1.23.8 安装kubegems管理界面_kubegems_18
cat /opt/kubernetes/kube-controller-manager.kubeconfig
导入里面的内容:
k8s1.23.8 安装kubegems管理界面_kubegems_19
k8s1.23.8 安装kubegems管理界面_kubegems_20
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_21
k8s1.23.8 安装kubegems管理界面_kubegems_22
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_23
启用eventer 与monitoring 告警
k8s1.23.8 安装kubegems管理界面_k8s1.23.8_24
k8s1.23.8 安装kubegems管理界面_kubegems_25

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK