<p><strong>Requirement</strong></p>

<p>Kubernetes in Azure uses <em>Availability Sets</em> as the default availability strategy.</p>

<p>I can specify the kubernetes <code>nodeSelector</code> attribute to select a specific node.</p>

<pre><code>kind: Pod
... 
spec:
  ...   
  nodeSelector:
    ???
</code></pre>

<p><strong>Question</strong></p>

<p>Can I specify the <code>nodeSelector</code> rule to use a node in a specific <em>Availability Set</em>?</p>

<p>I could label the pods manually after creation. But is there an automatic solution?</p>

<p>first of all, this question makes no sense, as with availability sets you can only have 1 node pool with AKS (and your tags mention AKS) (at least supported). but still, nodes have labels that look like this:</p>

<pre><code>agentpool=pool_name
</code></pre>

<p>so your node selector would looks like this:</p>

<pre><code>  nodeSelector:
    agentpool: pool_name
</code></pre>
