Centos7.7下KubeSphere最小化安裝和定制化配置安裝


前置環境

安裝helm和tiller

前提k8s集群已經搭建好

get_helm.sh

sh get_helm.sh

vi helm_rbac.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: tiller
    namespace: kube-system
  
kubectl apply -f helm_rbac.yaml

image-20201210202527235

初始化:

helm init --service-account=tiller --tiller-image=sapcc/tiller:v2.16.3 --history-max 300

image-20201210172259509

是否安裝成功的驗證

kubectl get pods --all-namespaces

image-20201210200121548

如果安裝失敗,刪除重新安裝

kubectl get -n kube-system secrets,sa,clusterrolebinding -o name|grep tiller|xargs kubectl -n kube-system delete
kubectl get all -n kube-system -l app=helm -o name|xargs kubectl delete -n kube-system

version:

helm version

image-20201210202809079

如果發現client和service的版本不一致,執行下面命令保證版本相同

helm init --upgrade

image-20201210202910051

確認master是否有污點

kubectl describe node k8s-node1 | grep Taint

image-20201210193404216

去除污點

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

image-20201210193618009

安裝OpenEBS

kubectl create ns openebs
helm install --namespace openebs --name openebs stable/openebs --version 1.5.0
kubectl get pods --all-namespaces

image-20201210203745443

等待幾分鍾,創建完畢

集群已有存儲類型(StorageClass),執行 kubectl get sc看下當前是否設置了默認的 storageclass

image-20201210203846630

將openebs-hostpath設置為默認的storageClass

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

修改完成后,我們就可以看到openebs-hostpath被設置為默認storageClass

image-20201210204401127

最小化安裝

kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml
kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml
kubectl get pods --all-namespaces
## 等待ks-installer安裝完畢

image-20201210220606996

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

等待一段時間(網速慢的話可能要十來分鍾),直到出現kubesphere控制台:

image-20201210222026037

訪問console,輸入出現的account和password,進入首頁,至此安裝成功。

image-20201210222113865

頁面還是蠻炫酷的。

image-20201210222429885

定制化安裝

點擊自定義資源CRD

image-20201211095514139

搜索clusterconfiguration 並點擊

image-20201211095536208

點擊這三個點,就可以編輯了。

image-20201211095622342

這里我開啟devops,openpitrix,alerting,notification,相對應的只需要把false改成true就行了

image-20201211104006650

然后點擊更新,大概等待二十分鍾(跟網速和硬件配置有關)

image-20201211104145644


免責聲明!

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



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