What is replication set in Kubernetes?
A ReplicaSet is an interaction that runs different cases of a Pod and keeps the predetermined number of Pods constant. Its motivation is to keep up with the predefined number of Pod occurrences running in a cluster at some random chance to keep clients from losing access to their application when a Pod comes up short or is distant.
creating a Kubernetes ReplicaSet
We will make a model ReplicaSet utilizing the below design, very much like we made a Pod to some extent 3 of this series.
Before we start, you ought to as of now have a running Kubernetes cluster and configured the kubectl command line tool to speak with the group. If not, subtleties on how you can get a group running utilizing KubeOne can be viewed as here. Essential information on Pod is proposed to follow the activity.
Stage 1: Create a YAML file utilizing vim on the order line:
Stage 2: Copy, glue, and save the setup beneath into your YAML document. The space is urgent!
- name: my-container
Stage 3: Create the ReplicaSet with this command:
$kubectl create -f replicaset-app.yaml
Stage 4: Once the ReplicatSet is running, you can really look at its status:
$kubectl get replicaset my-replicaset
NAME DESIRED CURRENT READY AGE
my-replicaset 2 2 2 17s
Name: ## This is the name of the ReplicaSet pronounced as the offspring of the metadata property
Wanted: ## This is the reproduction number determined in the YAML manifest record
Current: ## This compares to the present status of the ReplicaSet; that two reproductions are up
Prepared: ## The two copies indicated are prepared and in the running state
Age: ## How long the copies have been in the running state
Stage 5: Next, you can check the situation with the Pods running in the ReplicaSet: