前置环境
安装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,进入首页,至此安装成功。
页面还是蛮炫酷的。