consul-on-kubernetes
consul-on-kubernetes copied to clipboard
AntiAffinity prevents containers from starting on single node
I am using minikube with only a single node. Because the statefulset has an anti-affinity rule, only the first container will start. Simply changing this from anti-affinity to affinity fixes the problem and allows all three containers to start.
affinity:
# podAntiAffinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- consul
topologyKey: kubernetes.io/hostname
Yes, This configuration is designed for a production like configuration. I'll consider adding a note to the tutorial.
Don't we get much advantage if we can use Daemenset instead of Statefulset?