New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serviceSpreadPriority not properly scoring nodes after being mapped to podTopologySpread #98480
Comments
@damemi: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Can you show the output of the component config? |
|
oh, I think I know why. Do your nodes have hostname AND zone label? This might be related to the Note here: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#internal-default-constraints Unfortunately, that means that you cannot use policy API and configure default spreading. This is technically a regression if your nodes don't have zones. |
The workaround would be to add a zone to all the nodes. But perhaps we can do something more in code (effectively lifting the note above). If |
We have |
Does this reproduce without the Policy API? |
Is We haven't seen any problems with TopologySpreadConstraints itself |
TopologySpreadConstraints with |
I'm trying to reproduce while introducing a few log lines in scoring. However, my docker installation is somehow busted, so I can't run kind. Earlier I noticed a log line in kube-scheduler indicating that it didn't have permission to list ReplicationControllers, so maybe that's related. However, the Service should cover for that. Have you tried creating the Service ahead of time? And again, also worth testing if default spreading works without Policy API (no configuration should be enough for that). |
@damemi It's available as a plugin. And you have to enable it explicitly via CC (disabled by default), and also ensure the args.affinityLables is not nil. |
So the root cause is that the cluster has both legacy topology labels (failure-domain.beta.kubernetes.io/*) and the up-to-date ones? |
We haven't found the root cause. My guess was that the nodes didn't have the required labels, but that's not the case.
I think you are referring to the ServiceAffinity? |
@ingvagabund can you check the scheduler logs to see if it has any issues listing ReplicationControllers and Services? |
There are no issues though checking the nodes in this particular case I don't see any zone labels set :-| Looks like we don't set zone labels in every cloud provider installation. In this case the scheduling was carried over VSphere zones which do not have the zone label set. That explains why the case is not working as expected. @alculquicondor @Huang-Wei thanks for the pointers!!! |
Awesome! We can still think about #98480 (comment) |
oops, indeed. Nvm :) |
@alculquicondor If users specify SelectorSpreadPriority, internally we set the defaulting type of PodTopologySpread to |
No, because the System default doesn't have hard pod spreading. |
Thanks, I see |
Given that, before moving to pod topology spread, this used to work when zone labels where not set, my recommendation would be to do #98480 (comment) so that this is not a breaking change for some clusters @Huang-Wei wdyt? any takers? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/close |
@alculquicondor: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What happened:
SelectorSpreadPriority
andServiceSpreadPriority
were mapped toPodTopologySpread
in #95448. However, in some scheduling runs withserviceSpreadPriority
enabled, the (newly mapped) topology spread plugin reportsscore: 0
for all nodes, leading to pods being scheduled on the same node instead of being spread.What you expected to happen:
Nodes to be scored relative to the appropriate selector spreading.
How to reproduce it (as minimally and precisely as possible):
Enable
serviceSpreadPriority
in the schedulerpolicy.cfg
(and disable everything else)Create an RC and Service matching:
See scores in scheduler logs (with
v=10
):Anything else we need to know?:
We understand that both policy and serviceSpread are deprecated. If the simple solution is "don't use them", that is acceptable :) Just raising this bug to get more info.
Environment:
kubectl version
):cat /etc/os-release
):uname -a
):/sig scheduling
The text was updated successfully, but these errors were encountered: