consul-on-kubernetes icon indicating copy to clipboard operation
consul-on-kubernetes copied to clipboard

AntiAffinity prevents containers from starting on single node

Open Seth-Miller opened this issue 6 years ago • 2 comments

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

Seth-Miller avatar Apr 09 '18 20:04 Seth-Miller

Yes, This configuration is designed for a production like configuration. I'll consider adding a note to the tutorial.

kelseyhightower avatar Nov 04 '18 00:11 kelseyhightower

Don't we get much advantage if we can use Daemenset instead of Statefulset?

hiranya1 avatar Jan 10 '19 07:01 hiranya1