<p>we are planning to introduce AWS spot instances in production ( non-prod is running with spot already ). In order to achieve HA we are running HPA with minimum replicas 2 for all critical deployments. Because of the spot instances behaviour we want to run on-demand instances and one pod should be running on on-demand instances for the same</p>
<p><strong>Question:</strong></p>
<p>Is there anyway i can split pods to get launch one pod of the deployment in on-demand and all the other pods (another one since minimum is 2 and if HPA increase the pods ) of the same deployment in spot instances.</p>
<p>We already using nodeaAffinity and podAntiAffinity since we have multiple node groups for different reasons. Below is the snippet.</p>
<pre><code>        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: category
                operator: In
                values:
                - &lt;some value&gt;
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: &lt;lable key&gt;
                operator: In
                values: 
                - &lt;lable value&gt;
            topologyKey: &quot;kubernetes.io/hostname&quot;
    
</code></pre>

<p>Short answer is <code>No</code>. No such way to define per replica. As you are already using podAntiAffinity, just by adding the same pod labels, you can ensure no two replicas stays in the same host (if that's not what you are already doing). And then use <a href="https://github.com/aws/aws-node-termination-handler" rel="nofollow noreferrer">spotInterruption</a> Handler to drain and reschedule without abrupt downtimes during spot interruptions.</p>
