部署 KubeSphere
1、为了细化步骤方便排查问题,这里就先最小化安装了
a、下载 yaml 文件
wget https://raw.githubusercontent.com/kubesphere/ks-installer/master/kubesphere-minimal.yaml
b、修改 storageClass,默认是空哈,一开始没注意
persistence:
storageClass: openebs-hostpath
c、应用 yaml 文件
kubectl apply -f kubesphere-minimal.yaml
2、查看安装日志
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
3、安装完成后会提示登录信息
#####################################################
### Welcome to KubeSphere! ###
#####################################################
Console: http://172.20.47.15:30880
Account: admin
Password: P@88w0rd
遇到问题:
[root@master gitlab]# kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
Error from server (NotFound): storageclasses.storage.k8s.io "openebs-hostpath" not found
或者安装cluster-configuration.yaml,报错:
TASK [preinstall : KubeSphere | Stopping if StorageClass was not found] ********
fatal: [localhost]: FAILED! => {
"assertion": "persistence.storageClass in storage_class_check.stdout_lines",
"changed": false,
"evaluated_to": false,
"msg": "StorageClass openebs-hostpath was not found !"
因为没有安装StorageClass支撑组件,建议安装openebs,其中有集成
按照官网地址:OpenEBS - Kubernetes storage simplified
安装:kubectl apply -f https://openebs.github.io/charts/openebs-operator.yaml