Member-only story
Kubernetes Controllers
In this article we will discuss about Kubernetes controllers. Controllers are the brain behind Kubernetes. They are the processes that monitor Kubernetes objects and respond accordingly.
Replication controller is one controller in particular that I would like to discuss.
What is a replica and why do we need a replication controller?
Lets go back our first scenario where we had a single pod running our application.
What if for some reason our application crashes and the pod fails? Then the users will no longer be able to access out application. We would like to have more than one instance of pod running at the same time to prevent users from loosing the access to our application. That way if one fails, we still have our application running on the other pod.
The replication controller helps us run multiple instances of a single pod in the kubernetes cluster. Thus providing high availability. Even if you have a single pod, the replication controller can help by automatically bringing up a new pod when the existing one fails. In other words replication controller ensures that the specified number of pods are running at all times even if its just one or hundred.