在 Kubernetes 上部署 KubeSphere


准備工作:

1、Kubernetes版本: 1.15.x ≤ K8s version ≤ 1.17.x
2、Helm版本: 2.10.0 ≤ Helm Version < 3.0.0(不支持 helm 2.16.0 #6894)
3、集群已有默認的StorageClass

如何安裝 helm2,上一篇已經說了哈。

部署 openebs

1、讓 master 參與調度,去掉污點

kubectl taint nodes master node-role.kubernetes.io/master:NoSchedule-

2、安裝 openebs

kubectl apply -f https://openebs.github.io/charts/openebs-operator-1.10.0.yaml

或者使用 Helm
helm install --namespace openebs --name openebs stable/openebs --version 1.10.0

3、將 openebs-hostpath 設置為 默認的 StorageClass

kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
kubectl get sc

部署 KubeSphere

1、為了細化步驟方便排查問題,這里就先最小化安裝了
a、下載 yaml 文件

wget https://raw.githubusercontent.com/kubesphere/ks-installer/master/kubesphere-minimal.yaml

b、修改 storageClass,默認是空哈,一開始沒注意

persistence:
      storageClass: openebs-hostpath

c、應用 yaml 文件

kubectl apply -f  kubesphere-minimal.yaml

2、查看安裝日志

kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f

3、安裝完成后會提示登錄信息

#####################################################
###              Welcome to KubeSphere!           ###
#####################################################

Console: http://172.20.47.15:30880
Account: admin
Password: P@88w0rd

4、開啟可選功能。修改 ConfigMap

kubectl edit cm -n kubesphere-system ks-installer

組件列表:

  • KubeSphere 多租戶日志系統(Logging):日志查詢 與 日志收集;
  • KubeSphere 多維度告警通知系統(Alerting & Notification):設置集群節點告警 與 設置工作負載告警;
  • KubeSphere 一站式 DevOps 系統(CI/CD):圖形化構建流水線、構建流水線發布項目至 Kubernetes、Source-to-Image;
  • KubeSphere 應用與微服務治理系統(ServiceMesh):微服務的灰度發布與 Tracing、熔斷、流量治理;
  • Metrics server:HPA 彈性伸縮;

有的組件是通過 helm 安裝的,遇到問題時,如果從 kubernetes 直接看不出線索,可以查看 helm 狀態:

內置的 openldap 可以讓你用同一個賬號登錄所有頁面,包含 Jenkins、SonarQube 等。

安裝完成后效果如下:

顏值很高哈。文檔也很全,需要什么可以直接在官網搜索框檢索。不過用起來個人感覺不是太友好,哈哈哈...

參考:
https://kubesphere.com.cn/docs/zh-CN/installation/install-on-k8s/
https://github.com/kubesphere/ks-installer
https://github.com/kubesphere/kubesphere/blob/master/README_zh.md
https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/
https://kubesphere.com.cn/forum/d/1471-k8s-kubesphere
https://www.cnblogs.com/ryanyangcs/p/11577767.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM