Introduction
Thank you for clicking through to my arcticle. I've been a DevOps engineer for 2 years in dev-team of 7 engineers.
My name is MINSEOK, LEE, but I use Unchaptered as an alias on the interenet. So, you can call me anythings "MINSEOK, LEE" or "Unchaptered" to ask something.
Empemeral Volume(EV), emptyDir
References
All data inside the Pod is deleted when the Pod is stopped.
→ The pods were stateless applications.
Persistent Volume(PV), hostPath or PV/PVC
References
Dynamic Provisioning
Ability to automatically mount and attach volumes to Pods when they are created
Reclaim Policy
When you are done using a persistent volume, you can separately set how you want it to be initialized. This is called a Recalim Policy in Kubernetes.
Sup Types : Retain, Delete,
Recylce(deprecated)
Lifecycle of Storage
References
PV
PV is kubernetes cluster's storage that administrators can provision to follow users' storage requests
PVC
PVC is spec to request about PV.
It defines storage, access mode to request PV.
LIfeCycle
Because PVs and PVCs are so closely related, we can distinguish their states through a life cycle. Below picture shows lifecycle steps of PVs and PVCs.
Provisioning
Steps to provision PV.
Sup Types : Static Type(Pre Provision), Dynamic Type(On Demand)
Binding
Bind between PV and PVC.
All binding is 1:1 binding.
If PV isn't prepared for specific PVC, the PVC is waiting for binding PV.
Using
The PVC is set up in the Pod, and the Pod recognized and uses the VPC as a volume
Recaliming
Retain
Delete
Recycle(deprecated)?
CSI(Container Storage Interface)
References
Why we needs CSI for kubernetes?
According to AWS EBS provisioner is deployed to follow Kubernetes release lifecycle, you must upgrade kubernetes' version to use new func of provisioner.
Therefore, the kubernetes developer removed the build-in provisioner inside kubernetes' tree. And then, the kubernetes developer made dynamic provisioning available via a separate controller pod. This is the CSI driver.
Provisioner
The provisioner monitors the creation of PVCs in the cluster and is responsible for creating PVs when they are created.
Attacher
The attacher is responsible for mounting the PV in its container when a Pod wants to use the PVC.
Controller
The controller are responsible for creating and deleting volumes on storage servers for use by Kubernetes containers.
NodeServer
The NodeServer are responsible for making the environment ready to mount storage volumes on the nodes where Pods will be deployed.
More information of advanced CSI driver such as SPDK storage server, check this documents.
Conclusion
Defuault Volume setting of pod is Empemeral(Temporal) Storage.
If you want persistent storage, you must use PV/PVC or hostPath.
The hostPath isn't secure.