Replica Sets
Replica Sets are declared in the same way as Replication Controller except that they have more options for the selectors. The Selector is mandatory for Replica sets as match labels you can provide the pod labels to query the pods to match with the replica count.
Let’s look at this example below:
Here we can see, the API version is apps v1, the kind is ReplicaSet, and then we will be defining what is our ReplicaSet name under the spec section we can define the number of replicas, and under selectors match labels we will define what are our pod labels which need to be considered for the replica counts. Under the template section, we can provide our pod template which includes the containers, images, and labels, under the selector section not only the matching label we can use match expressions as well to configure different conditions for the selector. In this particular example, the app label must be engine x or frontend the environment label if it exists must not be produced.
Kuberneters – Difference Between Replicaset and Replication Controller
Pre-requisite: Kubernetes
Kubernetes is also known as K8s is an open-source container orchestration tool developed by google which is used for automating software deployment, scaling, and management. Currently, it is being maintained by the cloud native computing foundation(CNCF).
K8s has two versions, the original Kubernetes and a mini version which is known as minikube.