<p>Is there a way to assign pods to the nodes in a particular nodegroup without labeling each node in the nodegroup?</p>
<p>E.g.:</p>
<p>Suppose I have two nodegroup <code>NG1</code> and <code>NG2</code>, and I have two apps <code>A1</code> and <code>A2</code></p>
<p>I want to assign pods of app <code>A1</code> to nodegroup <code>NG1</code> and pods of app <code>A2</code> to nodegroup <code>A2</code>. (I don't want to assign labels to each node in the nodegroup manually and then use nodeselector)</p>

<p>You can use some of the default labels if those are coming and not same across the both Node pools</p>
<pre><code>failure-domain.beta.kubernetes.io/zone
failure-domain.beta.kubernetes.io/region
beta.kubernetes.io/instance-type
beta.kubernetes.io/os
beta.kubernetes.io/arch
</code></pre>
<p>For example, if both of your Node pool running the different type of instances, you can use the <code>beta.kubernetes.io/instance-type</code></p>
<p><strong>Example</strong></p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: with-node-affinity
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: beta.kubernetes.io/instance-type
            operator: In
            values:
            - Node Type
            - Node Type
  containers:
  - name: with-node-affinity
    image: registry.k8s.io/pause:2.0
</code></pre>
<p>You can also use the <code>topology.kubernetes.io/zone</code> if zone if difference is there.</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: with-node-affinity
spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: topology.kubernetes.io/zone
            operator: In
            values:
            - antarctica-east1
            - antarctica-west1
  containers:
  - name: with-node-affinity
    image: registry.k8s.io/pause:2.0
</code></pre>
<p><strong>Update</strong></p>
<p>If all the labels are the <strong>same</strong> you can try below command, which will list and label from a specific node group <code>alpha.eksctl.io/nodegroup-name=ng-1</code> :</p>
<pre><code>kubectl label nodes -l alpha.eksctl.io/nodegroup-name=ng-1 new-label=foo
</code></pre>
