安装NFS扩展

#添加helm源
helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner

#创建个namespace(可选,主要是为了查看资源方便)
kubectl create ns nfs-sc-default

#使用helm安装(10.1.129.86为NFS地址,/home/data/nfs-share/为共享的目录)
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
    --set storageClass.name=nfs-sc-default    #指定sc的名字
    --set nfs.server=10.10.10.99 \                    #指定nfs地址
    --set nfs.path=/home/data/nfs-share/ \                    #指定nfs的共享目录
    --set storageClass.defaultClass=true \    #指定为默认sc
    -n default                                                #指定命名空间

#查看创建的sc


kubectl get sc
https://www.whuanle.cn/archives/21206

第二种、
#下载chart
helm pull nfs-subdir-external-provisioner/nfs-subdir-external-provisioner

#解压后可以看到values.yaml
cat values.yaml | egrep -v '#|^$'

replicaCount: 1
strategyType: Recreate
image:
  repository: registry.k8s.io/sig-storage/nfs-subdir-external-provisioner
  tag: v4.0.2
  pullPolicy: IfNotPresent
imagePullSecrets: []
nfs:
  server:
  path: /home/data/nfs-share
  mountOptions:
  volumeName: nfs-subdir-external-provisioner-root
  # Reclaim policy for the main nfs volume
  reclaimPolicy: Retain
# For creating the StorageClass automatically:
storageClass:
  create: true
  # Set a provisioner name. If unset, a name will be generated.
  # provisionerName:
  # Set StorageClass as the default StorageClass
  # Ignored if storageClass.create is false
  defaultClass: true
  # Set a StorageClass name
  # Ignored if storageClass.create is false
  name: nfs-client
  # Allow volume to be expanded dynamically
  allowVolumeExpansion: true
  # Method used to reclaim an obsoleted volume
  reclaimPolicy: Delete
  # When set to false your PVs will not be archived by the provisioner upon deletion of the PVC.
  archiveOnDelete: true
  # If it exists and has 'delete' value, delete the directory. If it exists and has 'retain' value, save the directory.
  # Overrides archiveOnDelete.
  # Ignored if value not set.
  onDelete:
  # Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace.
  # Ignored if value not set.
  pathPattern:
  # Set

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值