Kubernetes 101 : Acquring an "orphan" pod by a replicaSet.



We start by creating an "unmanaged" pod as below:


Then we create the pod using the below command:


we also create a replicaSet for two replicas of the "nginx" pods, with the label selector : "app: nginx":


Then we create our replicaSet using the below command:


We can check the state of our replicaSet using the below command: 


We can see that our replicaSet has two replicas of a pod.

We check the pods using the below command:


We notice that the replicaSet created only one pod, the second pod "pod-replicaset" was "acquired", as it has the same label as the replicaSet selector "app: nginx".

Comments

Leave as a comment:

Archive