DevSecOps Interview Q&A: Part 4

Laxfed Paulacy
2 min readJan 20, 2023

Gonna talk about adding persistence to the cluster in this one, bruh!

Previous

What does ‘add persistence’ mean? How is it done?

In the context of a Kubernetes deployment, “add persistence” refers to the process of ensuring that data stored by an application is not lost when the pods that run the application are recreated. This can be accomplished by using Kubernetes Persistent Volumes (PVs) and Persistent Volume Claims (PVCs).

A PV is a piece of storage in the cluster that has been provisioned by an administrator. It is a resource in the cluster just like a pod, and it can be dynamically or statically provisioned. A PVC, on the other hand, is a request for storage by a user. It acts as a claim on a PV. Pods use PVCs to access the storage provisioned by PVs.

To add persistence to a Kubernetes deployment, a PV and a PVC need to be created and added to the deployment configuration file. The PVC references the PV and specifies the storage requirements for the application. When the deployment configuration file is applied to the cluster, the PV and PVC are created, and the application can access the storage through the PVC.

Once the PV and PVC are created, the data stored by the application is retained even if the pods that run the application are deleted or recreated. This means that if a pod crashes or is deleted for any reason, the data will still be available when a new pod is created.

It’s important to note that, in Kubernetes, there are different types of storage classes, and each one has its own characteristics, such as performance, durability, and cost. Also, there are different storage providers that can be used, like local storage, NFS, GlusterFS, Ceph and many more. It’s best to consult the Kubernetes documentation, the cluster administrator, or a Kubernetes expert for guidance on the best storage class and provider for a particular use case.

Additionally, there are various third-party solutions available like Rook, OpenEBS, and Portworx that can provide additional features like data replication, data backup, and disaster recovery. These solutions can be integrated with Kubernetes to provide a more robust and reliable storage solution.

Next

--

--

Laxfed Paulacy

Delivering Fresh Recipes, Crypto News, Python Tips & Tricks, and Federal Government Shenanigans and Content.