Support for podAntiAffinity with match labels of deployment name or other finer-grained label
Summary
The current podAntiAffinity label uses chart name by default.
when I turn antiAffinity
to hard
,There are many Pending
pods in our k8s cluster. Because the few number of nodes cannot achieve anti-affinity scheduling for all pods.
For example, all sidekiq
services use the label app=sidekiq
as podAntiAffinity label, and the sidekiq
service has 12 deployments, which means that at least 12 k8s nodes are needed to implement hard podAntiAffinity. this is not reasonable.
So, I need a way to change the podAntiAffinity label to a deployment name or other finer-grained label. Your help is needed,Thank you!
Steps to reproduce
- Turn
antiAffinity
tohard
- There are many
Pending
pods appearing in the k8s cluster
Configuration used
# global values.yaml
antiAffinity: hard
Versions
- Chart: 5.1.1
- Platform:
- Cloud: (Tencent Kubernetes Engine)
- Kubernetes: (
kubectl version
)- Client: 1.21.0
- Server: v1.18.4-tke.9
- Helm: (
helm version
)- Client: v3.5.0
- Server: v3.5.0