NFS 持久卷即使设置为 “Delete” 持久卷回收策略也未被删除。

huangapple go评论57阅读模式
英文:

NFS persistent volume is not deleted even with "Delete" persistentVolumeReclaimPolicy

问题

I am using NFS Persistent Volume to create PV.

The reclaim policy being used in persistentVolumeReclaimPolicy: Delete.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv001
spec:
  capacity:
    storage: 3Gi
  volumeMode: Filesystem
  accessModes:
    - ReadOnlyMany
  persistentVolumeReclaimPolicy: Delete
  mountOptions:
    - hard
    - nfsvers=4.1
  nfs:
    path: /
    server: fs-0bb.efs.us-east-2.amazonaws.com

However, when I delete my deployment-controller and also delete PersistentVolumeClaim, the NFS volume is not getting deleted.

Expected Behaviour: The NFS PV volume should be deleted after PVC is deleted.

英文:

I am using NFS Persistent Volume to create PV.

The reclaim policy being used in persistentVolumeReclaimPolicy: Delete.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv001
spec:
  capacity:
    storage: 3Gi
  volumeMode: Filesystem
  accessModes:
    - ReadOnlyMany
  persistentVolumeReclaimPolicy: Delete
  mountOptions:
    - hard
    - nfsvers=4.1
  nfs:
    path: /
    server: fs-0bb.efs.us-east-2.amazonaws.com

<br>

However, when I delete my deployment-controller and also delete PersistentVolumeClaim, the NFS volume is not getting deleted.

<br>

Expected Behaviour: The NFS PV volume should be deleted after PVC is deleted.

答案1

得分: 1

有两种PV配置类型,一种是静态PV,另一种是动态PV,如果您已配置静态PV,则需要删除PVC和PV。对于动态PV,只需删除PVC,然后PV将被释放。根据您提供的清单文件,似乎您正在使用静态PV,因此您需要删除PVC和PV。

英文:

<p dir="ltr" style="line-height: 1.38; text-align: justify; margin-top: 0pt; margin-bottom: 0pt; margin: 0;"><span style="font-size: 10pt; font-family: Roboto,sans-serif; color: #202124; background-color: #ffffff; font-weight: 400; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">There are two types of PV configurations one is Static PV and the other is dynamic PV, if you have configured Static PV you need to delete both PVC and PV. For dynamic PV you just need to delete the PVC and then the PV will be released. From the manifest file you have provided it seems that you are using static PV, so you need to delete both PVC and PV.</span></p>

huangapple
  • 本文由 发表于 2023年2月14日 09:17:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75442632.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定