Storage in kubernetes

 CNI(Container Storage Interface):here

Reclaim policy in pv:

3 types of reclaims 
1.Retain

2.Delete

3.Recycle(It is depricated)

  • In case of dynamic provisioning, default re-claim policy is delete i.e when you delete pvc then pv is deleted and also associated data in storage providers(GCP,NFS,Azure File etc) also gets deleted.
  • But incase of retain, when we delete pvc, pv and actual storage both are not deleted.We need to delete both of them manually.
  • If a pv is already created using claim reuest by dynamic provisioning, we can change re-claim policy of that pv to retain by applying path as shown below:

kubectl patch pv <your-pv-name> -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"Retain\"}}"

Note:In case of dynamic provisioning using nfs, there is a filed called archieveonDelete in class.yaml file,which is by default set to false.So if we change that to true when we delete pv,then its actual storage is still retained in nfs server as archieve

Comments

Popular posts from this blog

Docker Imp points

Docker volumes backup and restore & Docker networks