namespace: local-path-storage spec: replicas: 1 selector: matchLabels: app: local-path-provisioner template: metadata: labels: app: local-path-provisioner spec: serviceAccountName: local-path-provisioner-service-account containers: - name: local-path-provisioner image: rancher/local-path-provisioner...
wget https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml sed -i'/namespace/s/local-path-storage/kube-system/g'local-path-storage.yaml sed -i's/\/opt\/local-path-provisioner/\/data\/local-path-sc/g'local-path-storage.yamlmkdir-p /data/...
◎ Local:本地存储设备,目前可以通过指定块(Block)设备提供Local PV,或通过社区开发的sig-storage-local-static-provisioner插件( https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner )来管理Local PV的生命周期。 ◎ NFS:网络文件系统。 ◎ Portworx Volumes:Portworx提供的存储服务。 ◎ Quobyt...
name: nfs-storage annotations: storageclass.kubernetes.io/is-default-class: "true" #设置为默认的storageclass provisioner: nfs-client #动态卷分配者名称,必须和创建的"provisioner"变量中设置的name一致 parameters: archiveOnDelete: "true" #设置为"false"时删除PVC不会保留数据,"true"则保留数据 mountOptions...
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: slow annotations: storageclass.beta.kubernetes.io/is-default-class="true" privisioner: kubernetes.io/gce-pd parameters: type: pd-ssd 通过kubectl create命令创建成功后,查看StorageClass列表,可以看到名为gold的StorageClass被标记为default: ...
查看一下创建的storage class yuxianbing@ubuntu:~$ kubectl get sc NAME PROVISIONER AGE local-storage kubernetes.io/no-provisioner 2d 创建PV: cat > pv-sdc.yml <<EOF apiVersion: v1 kind: PersistentVolume metadata: name: local-pv-sdc spec: ...
4、存储类别(Class) 设定存储的类别,通过storageClassName参数指定给一个StorageClass资源对象的名称,具有特定类别的PV只能与请求了该类别的PVC进行绑定。未绑定类别的PV则只能与不请求任何类别的PVC进行绑定。 5、回收策略(Reclaim Policy) 通过persistentVolumeReclaimPolicy字段设置, ...
既然Device-LocalPV 支持动态供应,那么必然少不了创建存储类的步骤,将以下 yaml 文件保存为sc.yaml然后通过kubectl apply -f sc.yaml创建存储类。 apiVersion:storage.k8s.io/v1kind:StorageClassmetadata:name:openebs-device-scallowVolumeExpansion:falseparameters:devname:"test-device"provisioner:device.csi.openebs...
现在我们创建StoragClass $ kubectl create -f localpv-storageclass.yaml storageclass.storage.k8s.io/local-storage created 创建PVC kind:PersistentVolumeClaimapiVersion:v1metadata:name:example-local-claimspec:accessModes:-ReadWriteOnceresources:requests:storage:5GistorageClassName:local-storage ...
storageclass.kubernetes.io/is-default-class:"true"#存储分配器的名字,自定义provisioner:k8s-sigs.io/nfs-subdir-external-provisionerparameters:archiveOnDelete:"true"## 删除pv的时候,pv的内容是否要备份---apiVersion:apps/v1kind:Deploymentmetadata:name:nfs-client-provisionerlabels:app:nfs-client-provisioner...