<p>I had the following deployment,</p>

<pre><code>    apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-deploy
spec:
  replicas: 10
  selector:
    matchLabels:
      app: hello-world
  minReadySeconds: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      - name: hello-pod
        image: nginx:latest
        ports:
        - containerPort: 80
</code></pre>

<p>Does this selector have scope only for the pods managed by  deployment or any pods which have the same label - I am trying to understand the scope of the selectors</p>

<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#creating-a-deployment" rel="nofollow noreferrer">Your Deployment selector</a> here selects the pods with label "app: hello-world" which is also managed by your Deployment.</p>

<p>In general, and I quote from the official documentation:</p>

<blockquote>
  <p>Note: You must specify an appropriate selector and Pod template labels
  in a Deployment (in this case, app: hello-world). Do not overlap labels or
  selectors with other controllers (including other Deployments and
  StatefulSets). Kubernetes doesn’t stop you from overlapping, and if
  multiple controllers have overlapping selectors those controllers
  might conflict and behave unexpectedly.</p>
</blockquote>
