<p>Replica Set 1</p>

<pre><code>apiVersion: apps/v1
kind: ReplicaSet
metadata:
  labels:
    app: nginx
  name: rs-1
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
        version: 1.7.1
    spec:
      containers:
      - image: nginx:1.7.1
        name: nginx-1
      restartPolicy: Always
</code></pre>

<p>Replica Set 2</p>

<pre><code>apiVersion: apps/v1
kind: ReplicaSet
metadata:
  labels:
    app: nginx
  name: rs-2
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
        version: 1.7.9
    spec:
      containers:
      - image: nginx:1.7.9
        name: nginx-1
      restartPolicy: Always
</code></pre>

<p>When I create these two ReplicaSets, one ignores the pods created by the other. </p>

<pre><code>C02T30K2GTFM:ask erkanerol$ kubectl get pods --show-labels
NAME         READY   STATUS    RESTARTS   AGE     LABELS
rs-1-996cz   1/1     Running   0          5m13s   app=nginx,version=1.7.1
rs-1-ktv9z   1/1     Running   0          5m13s   app=nginx,version=1.7.1
rs-1-w7sbg   1/1     Running   0          5m13s   app=nginx,version=1.7.1
rs-2-2z8rb   1/1     Running   0          4m26s   app=nginx,version=1.7.9
rs-2-5c56s   1/1     Running   0          4m26s   app=nginx,version=1.7.9
rs-2-hls9p   1/1     Running   0          4m26s   app=nginx,version=1.7.9
</code></pre>

<p>As far as I understand from the documentation, if there are enough pods which match a replicaset's selector, it shouldn't create new pods. Why is this happenning? Is it using ownerReferences?</p>

<p>It seems they are using ownerReferences. If so, it doesn't fit the documented behaviour. </p>

<p>PR: <a href="https://github.com/kubernetes/kubernetes/pull/27600" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/pull/27600</a></p>

<p>Code: <a href="https://github.com/kubernetes/kubernetes/blob/0048d2da400b8c48ae83acc6a223a65f3551674a/pkg/controller/controller_ref_manager.go#L69-L72" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/blob/0048d2da400b8c48ae83acc6a223a65f3551674a/pkg/controller/controller_ref_manager.go#L69-L72</a></p>

<p>Issue: <a href="https://github.com/kubernetes/website/issues/12205" rel="nofollow noreferrer">https://github.com/kubernetes/website/issues/12205</a></p>
