This is one of the numerous posts by TechCommanders in a series for studying for the Certified Kubernetes Administrator (CKA) Exam.

Become a Certified Kubernetes Administrator (CKA)!

Before starting with how we can configure storage I would like to explain to you the need for this. Let’s start by taking an example: Imagine you have a PHP application deployed which generates a PDF file and updates the status on the database with generated and then renders it.

Now, I am increasing the instances of my PHP application. So, now if I ask them to create a pdf file one instance will update the status to generate whereas the other instance tries to find the file for rendering, but it wasn’t uploaded to the database yet. Getting my point here? This is the general scenario we also see at the time of deadlock. It’s not a complete deadlock but can be related to it.

This issue can’t be understood easily. For understanding the gravity of the issue, you need to deploy the application and scale it up. To resolve these kinds of issues Kubernetes came up with CSI, Container Storage Interface.

We need to design applications and decouple the logic and static files to get this point. Assume there are some files that need to be saved on a shared space so that it can be accessible by all the possible replicas of the application.

Image for post

In this image, we have figured out the nodes we need to scale up the environment, but storage is still a question. At least, by this image, we can see that we need a shared storage for all of our replicas. In Kubernetes, we have storage in 2 parts.

The storage service can be on its own or on the same server the K8s cluster is put on and the provisioner. The provisioner is a piece of software that respects the Container Storage Interface and is deployed to Kubernetes.

The provisioner is important as it handles the creation of Persistent Volumes and their deletion. Depending on this storage service, you can find a suitable provisioner. There are different provisioners available and the choice depends mostly on the two factors where you are deploying and what you want to achieve.

#kubernetes #devops #cka #kubernetes-cluster #google-cloud-platform

How to Configure Storage on a Kubernetes Cluster- CKA Exam Preparation Series
1.60 GEEK