概述
KubeGems是一款以围绕 Kubernetes 通过自研和集成云原生项目而构建的通用性开源 PaaS 云管理平台。经过我们内部近一年的持续迭代,当前 KubeGems 的核心功能已经初步具备多云多租户场景下的统一管理。并通过插件化的方式,在用户界面中灵活控制包括 监控系统、日志系统、微服务治理 等众多插件的启用和关闭。
作为一个面向云原生的通用型云平台,KubeGems 从立项开始就把支持多集群、多租户场景下的资源隔离作为其主要实现设计目标。用户可以对接入平台的 Kubernetes 集群做 租户级 的自定义资源规划。除此之外,我们提供了比原生 Dashboard 功能更加丰富且人性化操作的 UI 界面,让用户/企业根据自身场景规划平台元数据,而不用担心自己的业务和数据出现错乱。同时 KubeGems 也提供过了众多丰富的功能模块来为个人或企业用户带来更好的使用体验,例如 访问控制、资源规划、网络隔离、租户网关、存储卷、可观察性、用户审计、证书管理、金丝雀发布、istio治理 等功能。
部署
Installation
KUBEGEMS_VERSION=v1.20.0-beta.1
wget -O- https://github.com/kubegems/installer-operator/releases/download/${KUBEGEMS_VERSION}/centrol.yaml \
| sed "s#image: kubegems#image: registry.cn-beijing.aliyuncs.com/kubegems#g" \
| kubectl apply -f -
wget -O - https://github.com/kubegems/installer-operator/releases/download/${KUBEGEMS_VERSION}/centrol.installer.yaml \
| sed "s#repository: docker.io#repository: registry.cn-beijing.aliyuncs.com#g" \
| kubectl apply -f -
查看容器状态
kubectl get pod --all-namespaces |grep gems
使用默认网关访问 gems-dashboard
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.org/proxy-buffering: "false"
nginx.org/websocket-services: gems-dashboard
name: gems-dashboard
namespace: gemcloud-system
spec:
ingressClassName: default-gateway
rules:
- host: console.kubegems.io
http:
paths:
- backend:
serviceName: gems-dashboard
servicePort: 8000
path: /
pathType: ImplementationSpecific
查看默认网关端口
kubectl get svc -n gemcloud-gateway-system
将域名console.kubegems.io解析到 Kubernetes 集群内任意节点后,即可通过
http://console.kubegems.io:
创建租户
1 登陆账户 admin 密码 demo!@#admin
2 平台管理—-创建集群
3 平台管理—-租户
添加成员
添加集群
4 工作台—-添加项目
5 工作台—-创建环境
6 应用部署
7 资源管理
Delete/Re-deploy KubeGems
kubectl scale --replicas=0 deploy/kubegems-installer-manager -n kubegems-installer
kubectl delete mutatingwebhookconfigurations gems-mutating-webhook-configuration
kubectl delete validatingwebhookconfigurations gems-validating-webhook-configuration
kubectl delete ClusterRoleBinding `kubectl get ClusterRoleBinding|grep gems|awk -F " " '{print$1}'`
kubectl delete ClusterRole `kubectl get ClusterRole|grep gems|awk -F " " '{print$1}'`
kubectl delete ns gemcloud-gateway-system
kubectl delete ns gemcloud-logging-system
kubectl delete ns gemcloud-monitoring-system
kubectl delete ns gemcloud-workflow-system
kubectl delete ns gemcloud-system
kubectl delete ns kubegems-installer
如果您的命名空间卡在终止状态。请阅读此内容以强制删除。
https://computingforgeeks.com/how-to-force-delete-a-kubernetes-namespace
kubectl get namespace local-path-storage -o json \
| tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \
| kubectl replace --raw /api/v1/namespaces/local-path-storage/finalize -f -
- 删除 KubeGems CRD(可选)
kubectl delete crd environments.gems.kubegems.io
kubectl delete crd tenantgateways.gems.kubegems.io
kubectl delete crd tenantnetworkpolicies.gems.kubegems.io
kubectl delete crd tenantresourcequotas.gems.kubegems.io
kubectl delete crd tenants.gems.kubegems.io