Kubernetes - ReplicaSet
In this article let us understand how ReplicaSet in Kubernetes work with an example.
Step 1 : Check the nodes present in the cluster
kubectl get nodes
Step 2: Create a file rs-nginx.yml
Step 3: Create the replicas and check that 5 pods are running.
kubectl apply -f rs-nginx.yml
Delete any pod and see the results:
kubectl delete pod rs-nginx-8wplz
If we create another pod with the same label and see whether more than 5 pods will be created or not.
kubectl apply -f pod.yml
kubectl get pods -w
Hope this gives the clear understanding of ReplicaSet.