Hi, in Practice Test Labels and Selectors - Task 5 there is “A ReplicaSet defini . . .

Frantisek Ferencik:
Hi, in Practice Test Labels and Selectors - Task 5 there is “A ReplicaSet definition file is given replicaset-definition-1.yaml. Try to create the replicaset. There is an issue with the file.” I have fixed that (you can see on screenshot) but only one pod is running instead of two. Why?

Dr Ganesh Neelakanta Iyer:
Just to confirm did you apply (kubectl -f apply <file.yaml> the changes after editing the file?

Frantisek Ferencik:
yes

new_day:
Try to change replicas using imperative mode (kubectl …;replicas=1…)

Basavraj Nilkanthe:
@Frantisek Ferencik This is core concept of replica-set when comparing with replication controller… Kubernetes initially launched replication controller and later they launched replica set with additional features enabled. One of the major features is to check if there are any existing labels matching with replica set yaml file selector and if it find matching label it will not create new pod and it will simply use existing one… In your case also you can see tier=frontend label exist at two pod. That’s why it just created one and referred another one as existing one

Basavraj Nilkanthe:
https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/|https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/

Basavraj Nilkanthe:
Look at Non Template Pod Acquisition section