What Is ReplicaSets ?
ReplicaSet is used to maintain a certain number of pods always running all the time. ReplicaSet always monitors the current state and desired state of pods. ReplicalSet ensure a stable set of healthy pods running within a cluster at any given time. In the ReplicaSet configuration file we mainly mention two important features, number of replicas to maintain desired replica count and a pod template for creating new pods. On any pod failure or deletion of pod , replicaset automatically creates another healthy pod in the cluster to maintain the desired number of replicas. This feature of ReplicaSet ensures high availability.
The ReplicaSet configuration file consists of the following fields :
- ApiVersion : It describes the Kubernetes API version that supports ReplicaSet .
- Kind : It describe what type of resource . For example RepliceSet
- Replicas : It describes the number of desired replicas .
- Selector : It describes the group of pod .
- Template : It describes which image and container port is used to create a pod .
Scaling Applications With Kubernetes ReplicaSets
Kubernetes is an orchestration tool used to scale , deploy and manage the containerized application. It provides ReplicaSet which is used to run a desired number of pods on any given time . In this guide, I will first discuss what Kubernetes is. Then I will discuss about ReplicaSets. After this I will walk you through the different steps to scale applications using Kubernetes ReplicaSet.