安装helm3(不推荐使用helm2)
前提k8s集群已经搭建好
先下载get_helm.sh(https://github.com/helm/helm/blob/master/scripts/get-helm-3)
chmod 700 get_helm-3.sh
./get_helm-3.sh
确认安装:
helm version
确认master是否有污点
kubectl describe node k8s-node1 | grep Taint
去除污点
kubectl taint nodes k8s-node1 node-role.kubernetes.io/master:NoSchedule-
安装OpenEBS(安装过程来自官网)
Create OpenEBS namespace:
kubectl create ns openebs
Install openebs with chart name as openebs
helm repo add openebs https://openebs.github.io/charts
helm repo update
helm install openebs openebs/openebs
等待几分钟,创建完毕,验证安装
helm ls
集群已有存储类型(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就行了
然后点击更新,大概等待二十分钟(跟网速和硬件配置有关)