kubesphere挂载nfs
配置客户端机器,使得客户端机器支持nfs
yum install -y nfs-utils rpcbind
创建nfs挂载的配置文件
vim /opt/kubesphere/nfs-client.yaml
nfs:
server: "192.168.0.2" # This is the server IP address. Replace it with your own.
path: "/mnt/demo" # Replace the exported directory with your own.
storageClass:
defaultClass: false
在集群配置文件中追加以下内容
vim /opt/kubesphere/sample.yaml
追后面追加
addons:
- name: nfs-client
namespace: kube-system
sources:
chart:
name: nfs-client-provisioner
repo: https://charts.kubesphere.io/main
valuesFile: /home/ubuntu/nfs-client.yaml # Use the path of your own NFS-client configuration file.
安装nfs卷
./kk create cluster -f sample.yaml
查看日志
kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f
验证
使用下面命令可以查到对应的nfs的pod在运行中
kubectl get sc
查看pod状态
kubectl get pod -n kube-system

587

被折叠的 条评论
为什么被折叠?



