kubesphere的安裝部署
書接上回,本周把kubesphere的安裝部署記錄發出來,
首先要安裝部署storageclass,
需要在每個node上安裝nfs客戶端軟件,sudo apt install nfs-common,
然后下載storageclass的安裝部署yaml模板,
wget https://raw.githubusercontent.com/kubernetes-incubator/external-storage/master/nfs-client/deploy/class.yaml,
wget https://raw.githubusercontent.com/kubernetes-incubator/external-storage/master/nfs-client/deploy/deployment.yaml,
wget https://raw.githubusercontent.com/kubernetes-incubator/external-storage/master/nfs-client/deploy/rbac.yaml,
接著執行yaml模板,kubectl apply -f rbac.yaml,
執行deployment模板之前要改一下配置,
vim deployment.yaml
env:
- name: PROVISIONER_NAME
value: fuseim.pri/ifs
- name: NFS_SERVER
value: 10.90.11.161
- name: NFS_PATH
value: /mnt/truenas
volumes:
- name: nfs-client-root
nfs:
server: 10.90.11.161
path: /mnt/truenas
kubectl apply -f deployment.yaml,kubectl apply -f class.yaml,
查看部署成功的storageclass,kubectl get storageclass,
把當前的storageclass設置成default,這個很重要,不然后面部署kubesphere的時候會報錯,
kubectl patch storageclass managed-nfs-storage -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}',
接下來就是真正部署kubesphere了,
下載kubesphere的安裝部署yaml模板,
wget https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/kubesphere-installer.yaml,
wget https://github.com/kubesphere/ks-installer/releases/download/v3.1.1/cluster-configuration.yaml,
執行yaml模板,kubectl apply -f kubesphere-installer.yaml,
kubectl apply -f cluster-configuration.yaml,
通過下面命令查看部署的進度,
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f,
部署成功的輸出是下面這樣,

按照提示訪問管理界面,

界面很清爽,下周再把rancher也裝上對比一下。