Requirement
Kubernetes in Azure uses Availability Sets as the default availability strategy.
I can specify the kubernetes nodeSelector
attribute to select a specific node.
kind: Pod
...
spec:
...
nodeSelector:
???
Question
Can I specify the nodeSelector
rule to use a node in a specific Availability Set?
I could label the pods manually after creation. But is there an automatic solution?
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:
agentpool=pool_name
so your node selector would looks like this:
nodeSelector:
agentpool: pool_name