Kubernetes上安裝KubeSphere


安裝helm

創建helm文件夾,手動下載helm安裝包,放入helm文件夾

tar -zxf helm-v3.2.1-linux-amd64.tar.gz && mv linux-amd64/helm . && rm -rf *linux-amd64*
mv helm /usr/local/bin/

查看helm版本

[root@k8s-master01 3.1.1]# helm version
version.BuildInfo{Version:"v3.2.1", GitCommit:"fe51cd1e31e6a202cba7dead9552a6d418ded79a", GitTreeState:"clean", GoVersion:"go1.13.10"}

安裝 OpenEBS

查看 master的污點

kubectl describe node k8s-master01 | grep Taint

去除master的污點

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

添加OpenEBS LocalPV倉庫到helm

helm repo add openebs-localpv https://openebs.github.io/dynamic-localpv-provisioner

安裝OpenEBS

helm install openebs openebs-localpv/localpv-provisioner --namespace openebs --create-namespace

等待openebs相關pod創建完畢

kubectl get pods -n openebs

查看storageclass

[root@k8s-master01 helm]#  kubectl get sc
NAME               PROVISIONER        RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
openebs-device     openebs.io/local   Delete          WaitForFirstConsumer   false                  109s
openebs-hostpath   openebs.io/local   Delete          WaitForFirstConsumer   false                  109s

設置默認sc

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

安裝 KubeSphere

先貼出安裝出錯后的卸載方法,創建kubesphere-delete.sh文件

sh kubesphere-delete.sh

在k8s集群的master節點上執行,沒反應的話就去手動下載對應文件

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/kubesphere-installer.yaml

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/cluster-configuration.yaml

檢查安裝日志:

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

檢查kubesphere所有pod是否成功啟動

kubectl get pods --all-namespaces

等待安裝完成后,過以下命令檢查控制台的端口(默認為 30880)

[root@k8s-master01 kubesphere]# kubectl get svc/ks-console -n kubesphere-system
NAME         TYPE       CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE
ks-console   NodePort   10.99.39.85   <none>        80:30880/TCP   35m

netstat -lntp

確保在安全組中打開了端口 30880,並通過 NodePort (IP:30880) 使用默認帳戶和密碼 (admin/P@88w0rd) 訪問 Web 控制台

Account: admin
Password: P@88w0rd


免責聲明!

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



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