Skip to content

TrueNas 配置数据集并添加共享

yaml
helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/

helm show values  nfs-subdir-external-provisioner/nfs-subdir-external-provisioner > nfs.yaml

helm upgrade --install nfs-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
    --set image.repository=registry.cn-hangzhou.aliyuncs.com/lfy_k8s_images/nfs-subdir-external-provisioner \
    --set nfs.server=10.10.220.119 \
    --set nfs.path=/mnt/StoragePool_01/nextcloud/k8s-data

修改默认存储类

shell
yanfa@m1:~/nfs-pvc$ kubectl get sc
NAME                   PROVISIONER                                                     RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
local-path (default)   rancher.io/local-path                                           Delete          WaitForFirstConsumer   false                  29d
nfs-client             cluster.local/nfs-provisioner-nfs-subdir-external-provisioner   Delete          Immediate              true                   113s
yanfa@m1:~/nfs-pvc$ kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'
storageclass.storage.k8s.io/local-path patched
yanfa@m1:~/nfs-pvc$ kubectl patch storageclass nfs-client -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
storageclass.storage.k8s.io/nfs-client patched
yanfa@m1:~/nfs-pvc$ kubectl get sc
NAME                   PROVISIONER                                                     RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
local-path             rancher.io/local-path                                           Delete          WaitForFirstConsumer   false                  29d
nfs-client (default)   cluster.local/nfs-provisioner-nfs-subdir-external-provisioner   Delete          Immediate              true                   2m46s
yanfa@m1:~/nfs-pvc$

文章来源于自己总结和网络转载,内容如有任何问题,请大佬斧正!联系我