1.安装nfs

安装nfs软件包-全部主机安装
yum -y install rpcbind nfs-utils

新建共享目录-nfs主机安装
mkdir -p /mnt/nfs/shared_dir
echo "/mnt/nfs/shared_dir *(rw,no_root_squash)" >> /etc/exports
chmod -R 777 /mnt/nfs/shared_dir
启动NFS服务
systemctl start rpcbind nfs && systemctl enable rpcbind nfs

配置hosts表解析,全部主机都需要配置
echo "192.168.83.58 nfs1.kubesphere.local" >> /etc/hosts

查询共享
showmount -e nfs1.kubesphere.local | grep share

2.kubesphere添加仓库

地址:https://charts.kubesphere.io/main/

2024-01-05T01:53:24.png

3.命令行安装

安装helm

wget https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz
tar -zxvf helm-v3.3.4-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin

部署nfs

helm repo add azure http://mirror.azure.cn/kubernetes/charts/
helm install nfs-client-provisioner -n kube-system azure/nfs-client-provisioner \
--set nfs.server=192.168.103.5 \
--set nfs.path=/nfs-data \
--set image.repository=registry.cn-beijing.aliyuncs.com/kubesphereio/nfs-subdir-external-provisioner \
--set image.tag=v4.0.2 \
--set storageClass.name=nfs-sc

4.创建nfs-client-provisoner应用

2024-01-05T01:54:32.png

最后修改:2024 年 04 月 11 日
如果觉得我的文章对你有用,请随意赞赏