oh, dear - i think i found something *facepalm*
I have a 3 node-worker cluster with 1 master
as i used this topologyconstraint:
topologySpreadConstraints:
- maxSkew: 2
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: logstash
the master-node also was taken into account. I never thought about that and assumed as the master cannot schedule pods anyway it's not taken into accoung :|
I now change the topologyKey to node - where each real worker node has a label (node=node1, node=node2,...).
after deleteing the old config and applying the new one I got now a pod distribution of 2, 1, 3 - not perfect but okisch. the "monk" in me would like to see 2, 2, 2 from start on.
After I stopped docker on the last node again - the new distribution was 2, 2, 0
Then I started docker again and got 2, 2, 2
If I now stop docker once again on the last node it's again 2, 2, 0 - descheduler says because it is balanced.