删除 pvc 后如何恢复 pv(Released) 数据
How to recover pv(Released) data after pvc deletion
我在 aws 上有一个 kubernetes 集群。我使用aws-ebs作为StorageClass的Provisioner,ReclaimPolicy设置为Retain。我用 helm 安装应用程序。当我删除应用程序时,pvc 被删除,但 pv 仍然存在。状态为已发布。我可以看到 aws-ebs 卷仍在 aws 控制台中。现在我想创建一个新的应用程序并仍然使用原始数据。我认为有两种方法可以做到
- 手动创建一个pvc绑定这个pv使pv重新生效,但是StorageClass不能使用
- 重新创建一个新的PV绑定aws-ebs,然后通过这个PV创建一个新的PVC,好像不能使用StorageClass
但是我不知道怎么改,请问可以帮忙吗?提前致谢
The Retain
reclaim policy allows for manual reclamation of the
resource. When the PersistentVolumeClaim is deleted, the
PersistentVolume still exists and the volume is considered "released".
But it is not yet available for another claim because the previous
claimant's data remains on the volume. An administrator can manually
reclaim the volume with the following steps.
Delete the PersistentVolume. The associated storage asset in external infrastructure (such as an AWS EBS, GCE PD, Azure Disk, or
Cinder volume) still exists after the PV is deleted.
Manually clean up the data on the associated storage asset accordingly.
Manually delete the associated storage asset, or if you want to reuse the same storage asset, create a new PersistentVolume with the
storage asset definition.
Here您可以找到一个示例,逐步说明如何在删除 PVC 后手动重用 PV,从而不会丢失数据。
我在 aws 上有一个 kubernetes 集群。我使用aws-ebs作为StorageClass的Provisioner,ReclaimPolicy设置为Retain。我用 helm 安装应用程序。当我删除应用程序时,pvc 被删除,但 pv 仍然存在。状态为已发布。我可以看到 aws-ebs 卷仍在 aws 控制台中。现在我想创建一个新的应用程序并仍然使用原始数据。我认为有两种方法可以做到
- 手动创建一个pvc绑定这个pv使pv重新生效,但是StorageClass不能使用
- 重新创建一个新的PV绑定aws-ebs,然后通过这个PV创建一个新的PVC,好像不能使用StorageClass
但是我不知道怎么改,请问可以帮忙吗?提前致谢
The
Retain
reclaim policy allows for manual reclamation of the resource. When the PersistentVolumeClaim is deleted, the PersistentVolume still exists and the volume is considered "released". But it is not yet available for another claim because the previous claimant's data remains on the volume. An administrator can manually reclaim the volume with the following steps.
Delete the PersistentVolume. The associated storage asset in external infrastructure (such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume) still exists after the PV is deleted.
Manually clean up the data on the associated storage asset accordingly.
Manually delete the associated storage asset, or if you want to reuse the same storage asset, create a new PersistentVolume with the storage asset definition.
Here您可以找到一个示例,逐步说明如何在删除 PVC 后手动重用 PV,从而不会丢失数据。