<p>My eks vpc has two node groups. One is named blue, another is named green. Each node group provisioned (terraform) by using resource &quot;aws_eks_node_group&quot; with scaling_config, i.e. each node group is ASG enabled. I would like to deploy scs_1.0 release to blue node group, deploy csc_1.1 release to green node group. How to do that?</p>
<p>In the past, I use resource &quot;aws_eks_node_group&quot; (terraform) provision eks worker nodes (one node group), then logon to the Kubernetes cluster, deploy application there. Now, I use resource &quot;aws_eks_node_group&quot; provisioned two node groups. How do I deploy different releases to different node groups?</p>

Melissa Jenner
<p>Because you want to deploy diffrent 'deployment' to different node. So, you can use <code>nodeSelector</code> on <code>Deployment</code> to select labels of node.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: xxx-v1
spec:
  selector:
    matchLabels:
      app: xxx-v1
  replicas: 1

  template:
    metadata:
      labels:
        app: xxx-v1
        type: microservice
    

    spec:
      nodeSelector:
        nodeGroup: blue
      containers:
      - name: xxx-v1
        image: xxx.dkr.ecr.us-west-2.amazonaws.com/xxx-v1-sandbox
....

</code></pre>
<p>You can assign label to node by <code>kubectl label nodes &lt;node-name&gt; &lt;label-key&gt;=&lt;label-value&gt;</code></p>
