Kubernetes Persistent Volumes and Claims

In a distrubuted system, storage isn't simple to manage without a good abstraction, kubernetes offer an object called persistent volume to let pod to reclaim storage for persisting data. In the pod definition you can define your volume type with another object called persistentVolumeClaim where you can define type size and many other things.

There are different phase in the persistent storage lifecycle:
  • Provisioning: when an administrator create a Persistent Volume or a cloud resource dynamically request
  • Binding: when a PVC is created  k8s control loop watch if there are Persisten Volume matching the PVC  and bind them together.
  • Use: when the bound volume is mounted in to the pod
  • Releasing: whene the POD is done and an API request is sent to delete the related bound PVC, the volume in this stage remains
  • Reclaim: there are three options related to this state:
    -Retain: keep data interact and allow an administrato to handle data from storage
    -Delete: tells the volume to delete the API object and the storage behind.
    -Recycle: runs an rm -rf /mountpint and volume become availble to a new claim.
As you can understand everything in kubernetes is designed to be available during scaling or pod destroy in this way.

Comments

Popular posts from this blog

IBM and Red Hat long story, long love, now married!

MY EXPERIENCE @ HYBRID CLOUD SUMMIT IN ZURICH