前置環境
安裝helm和tiller
前提k8s集群已經搭建好
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
初始化:
helm init --service-account=tiller --tiller-image=sapcc/tiller:v2.16.3 --history-max 300
是否安裝成功的驗證
kubectl get pods --all-namespaces
如果安裝失敗,刪除重新安裝
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
如果發現client和service的版本不一致,執行下面命令保證版本相同
helm init --upgrade
確認master是否有污點
kubectl describe node k8s-node1 | grep Taint
去除污點
kubectl taint nodes k8s-node1 node-role.kubernetes.io/master:NoSchedule-
安裝OpenEBS
kubectl create ns openebs
helm install --namespace openebs --name openebs stable/openebs --version 1.5.0
kubectl get pods --all-namespaces
等待幾分鍾,創建完畢
集群已有存儲類型(StorageClass),執行 kubectl get sc
看下當前是否設置了默認的 storageclass
將openebs-hostpath設置為默認的storageClass
kubectl patch storageclass openebs-hostpath -p '{"metadata":{"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
修改完成后,我們就可以看到openebs-hostpath被設置為默認storageClass
最小化安裝
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安裝完畢
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
等待一段時間(網速慢的話可能要十來分鍾),直到出現kubesphere控制台:
訪問console,輸入出現的account和password,進入首頁,至此安裝成功。
頁面還是蠻炫酷的。
定制化安裝
點擊自定義資源CRD
搜索clusterconfiguration 並點擊
點擊這三個點,就可以編輯了。
這里我開啟devops,openpitrix,alerting,notification,相對應的只需要把false改成true就行了

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