安装请参考官网:面向云原生应用的容器混合云,支持 Kubernetes 多集群管理的 PaaS 容器云平台解决方案 | KubeSphere
安装
此处可参考官网的安装,我是在 Kubernetes 上最小化安装 KubeSphere,版本:3.2.1,此处和官网差不多,就是多了点挂载
官网地址 :在 Kubernetes 上最小化安装 KubeSphere
一、部署 KubeSphere
1.执行以下命令开始安装:
(此处没开启组件)
wget https://github.com/kubesphere/ks-installer/releases/download/v3.2.1/kubesphere-installer.yaml
wget -f https://github.com/kubesphere/ks-installer/releases/download/v3.2.1/cluster-configuration.yaml
开启组件:启用可插拔组件
此处只在我需要的如:日志,监控,devops,istio 这些
执行
kubectl apply -f kubesphere-installer.yaml
kubectl apply -f cluster-configuration.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.使用 kubectl get pod --all-namespaces
查看所有 Pod 是否在 KubeSphere 的相关命名空间中正常运行。如果是,请通过以下命令检查控制台的端口(默认为 30880
):
kubectl get svc/ks-console -n kubesphere-system
4.确保在安全组中打开了端口 30880
,并通过 NodePort (IP:30880)
使用默认帐户和密码 (admin/P@88w0rd)
访问 Web 控制台。
5.配置挂载
装好后可以看到,kubesphere-system 下的pod 启动 ,目前均是没有挂载的
a.ldap-pv-pvc.yaml
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: kubesphere-system-ladp
namespace: kubesphere-system
labels:
pv: kubesphere-system-ldap
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
# FIXME: use the right IP
server: 192.168.50.93
path: "/data/nfsboot/kubesphere-system/redis-ldap"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kubesphere-system-ldap
namespace: kubesphere-system
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
selector:
matchLabels:
pv: kubesphere-system-ldap
b.minio-pv-pvc.yaml
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: kubesphere-system-minio
namespace: kubesphere-system
labels:
pv: kubesphere-system-minio
spec:
capacity:
storage: 100Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
# FIXME: use the right IP
server: 192.168.50.93
path: "/data/nfsboot/kubesphere-system/minio-pvc"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kubesphere-system-minio
namespace: kubesphere-system
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 100Gi
selector:
matchLabels:
pv: kubesphere-system-minio
C.redis-pv-pvc.yaml
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: kubesphere-system-redis
namespace: kubesphere-system
labels:
pv: kubesphere-system-redis
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
nfs:
# FIXME: use the right IP
server: 192.168.50.93
path: "/data/nfsboot/kubesphere-system/redis-pvc"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: kubesphere-system-redis
namespace: kubesphere-system
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Gi
selector:
matchLabels:
pv: kubesphere-system-redis
对应的deployment.yaml 和statefulset.yaml 增加挂载