Kubernetes replicasets

DevOps

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Kubernetes has a feature of deploying multiple replicas of a pod and managing them from workstation. Each of these sets of replicas of a pod are called replicasets.

Replicasets can be created, deleted, updated in a single time. These are shown as deployments in the kubectl cli

Creating deployment:

kubectl create deployment rajesh –image=scmgalaxy/nginx-devopsschoolv1 –replicas=3 -n=sumit

Getting list of replicas deployed in namespace:

kubectl get deploy -n=sumit

Scale deployment:

kubectl scale –replicas=3 deploy/rajesh -n=sumit

O/p:
deployment.apps/rajesh scaled
[centos@ip-172-31-22-14 ~]$ kubectl get deploy -n=sumit
NAME READY UP-TO-DATE AVAILABLE AGE
rajesh 3/3 3 3 4m43s

Delete deployment:

kubectl delete deploy rajesh -n=sumit
deployment.apps “rajesh” deleted