DevOps(Day-47): Accessing data in the Persistent Volume
TABLE OF CONTENTS
What are Persistent Volumes in k8s?
Task: Accessing data in the Persistent Volume
What are Persistent Volumes in k8s?
Kubernetes persistent volumes are administrator-provided volumes. They have predefined properties including file system, size, and identifiers like volume ID and name.
Persistent volumes are independent of the lifecycle of the pod that uses it, meaning that even if the pod shuts down, the data in the volume is not erased. They are defined by an API object, which captures the implementation details of storage such as NFS file shares, or specific cloud storage systems.
For a Pod to start using these volumes, it must request a volume by issuing a persistent volume claim (PVC). PVCs describe the storage capacity and characteristics a pod requires, and the cluster attempts to match the request and provision the desired persistent volume.
Task: Accessing data in the Persistent Volume
Navigate to the inside of one of the Pods and create a file in the Pod.
Now, delete that pod, by deleting the deployment and check if the file in the new pod is created after applying the deployment again in the server.
You can see the file remains intact, that's the beauty of volume. Even if the pod gets deleted somehow or in case of any mishap the data persists.
Thanks for reading my article. Have a nice day.
Comments
Post a Comment