I need some node affinity in some deployments (specifically to have DinD, docker in docker, run one per node in my cluster). I need to have multiple DinD but only one of the per node.
I add for example:
kubectl label nodes aks-nodepool1-16162636-vmss000000 dindId=dind00
and the same for every node in the cluster… everything works.
Problem is, if the cluster is restarted (for a version upgrade or any other reason) those labels are lost, hence the system won’t aout start, as the DinD pods won’t deploy as they don’t find the node they need to run.
I have also found that AKS assignes new node names when the cluster is restarted. Maybe that’s the reason that the label is lost.
Question is: how I can have those node labels persistent or if the cluster is restarted, that the new nodes in the claster get automatically the corresponding label? (dindId=dind00, dindId=dind01, dindId=dind01…)