On this article we’re going to perceive a vital idea in Kubernetes i.e. Knowledge Storage and check out its working.
Volumes
So in our final article We used a Node with two pods, my-app and a database, for example. We’re going to use identical instance for this text.
So we’ve this Database Pod that our software makes use of, and it creates some knowledge. If the Database container or Pod is restarted, the information is misplaced, which is clearly troublesome and annoying since you need your Database knowledge or log knowledge to be constantly persevered over time.
To resolve this downside we’ve one other Kubernetes Part often called Volumes
The way it works?
Quantity mainly attaches bodily storage on a Exhausting drive to your Pod, and that storage might be in your native machine, which means on the identical server Node the place the Pod is working, or it might be on a distant storage, which means outdoors of the Kubernetes cluster, akin to a cloud storage or your individual premise storage that’s not a part of the Kubernetes cluster, so that you simply have an exterior reference on it.
So now, when the Database Pod or Container is restarted, all the knowledge is persevered.
It is very important perceive the excellence between the Kubernetes Cluster and the Storage, no matter whether or not it’s native or distant. Take into account storage to be an exterior Exhausting drive inserted into the Kubernetes Cluster as a result of Kubernetes Cluster doesn’t explicitly deal with knowledge persistence, which implies that you, as a Kubernetes consumer or Administrator, are liable for backing up the information, duplicating it, sustaining it, and making certain that it’s saved on correct {hardware}, amongst different issues.
Within the subsequent article we’re going to try two extra Kubernetes Elements that’s Deployment and StatefulSet