Statefulset not evenly distributed among nodes

I’m following the “Regular channel” of GKE Release channel, 5 days ago, the cluster has been updated, since that, I found that the 2 statefulsets are now running on only 2 of my 3 nodes, as these 2 statefulsets are database which require quite a lot of resources, it is causing those 2 nodes to have high CPU and Memory issue.

I’ve tried deleting the pods to hope that they can be re-created in the remaining node, but tried a few times, they were only re-created at those 2 nodes.

Kubernetes version: 1.17.13-gke.2600
Cloud being used: GKE

Please let me know what can I do to solve this issue. Thanks a lot.

You can configure pod affinity and anti-affinity rules that will inform the scheduler on how you’d like your workloads distributed. :+1:

As an FYI - Kubernetes by default does not take into account the placement of the pods belonging to a specific higher level type (Deployments, StatefulSets etc). It looks at it solely from a pod level, then filters and scores nodes to determine a pod’s placement. Part of that evaluation and scoring is looking at the pod affinity/anti-affinity rules :slightly_smiling_face: