欢迎大家进群,一起探讨学习
微信公众号,每天给大家提供技术干货
博主技术笔记 https://notes.xiyankt.com
博主开源微服架构前后端分离技术博客项目源码地址,欢迎各位star https://gitee.com/bright-boy/xiyan-blog
1.检查kubesphere时需要默认 StorageClass (如果已经有了可以跳过部署StorageClass
)
kubectl get storageclass
如果出现没有的情况下,可以选择nfs 或者本地Storage 我这里选择本地
2.创建文件storageclass.yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: local
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
3.创建文件persistentVolumeClaim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: local-pve
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
storageClassName: local
4.执行
kubectl apply -f storageclass.yaml
kubectl apply -f persistentVolumeClaim.yaml
5.修改sc为默认标识
kubectl patch sc local -p '{"metadata": {"annotations": {"storageclass.beta.kubernetes.io/is-default-class": "true"}}}'
6.部署KubeSphere
wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.0/kubesphere-installer.yaml
wget https://github.com/kubesphere/ks-installer/releases/download/v3.3.0/cluster-configuration.yaml
7.部署KubeSphere
kubectl apply -f kubesphere-installer.yaml
kubectl apply -f cluster-configuration.yaml
8.检查安装日志
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l 'app in (ks-install, ks-installer)' -o jsonpath='{.items[0].metadata.name}') -f
9.启用可插拔组件
https://nguokubesphere.com.cn/docs/v3.3/pluggable-components/