Skip to content
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

Pod scheduling readiness support in Cluster Autoscaler #5279

Closed
x13n opened this issue Oct 28, 2022 · 7 comments
Closed

Pod scheduling readiness support in Cluster Autoscaler #5279

x13n opened this issue Oct 28, 2022 · 7 comments
Labels
area/cluster-autoscaler kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@x13n
Copy link
Member

x13n commented Oct 28, 2022

Per the suggestion on last SIG meeting, opening an issue to start a discussion.

Which component are you using?:

cluster-autoscaler

Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:

This isn't exactly a specific feature I have in mind, I want to start a discussion on what to do in CA about Pod Scheduling Readiness KEP (kubernetes/enhancements#3522). It introduces a way for kube-scheduler to postpone scheduling until certain additional criteria are met for the pod. I think CA has two options on how to approach this feature:

  • Pretend these pods do not exist (probably a no-op in CA code, but it would be good to check)
  • Detect such pods and potentially trigger scale-up to ensure they can schedule once ready

Describe the solution you'd like.:

I'm leaning towards just ignoring such pods in CA. The downside of detecting is that they may never actually become ready, which would lead to waste of cluster resources.

Describe any alternative solutions you've considered.:

Described both above.

Additional context.:

https://github.com/kubernetes/enhancements/tree/master/keps/sig-scheduling/3521-pod-scheduling-readiness

CC @Huang-Wei @ahg-g in case you have an opinion.

@x13n x13n added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 28, 2022
@ahg-g
Copy link
Member

ahg-g commented Oct 28, 2022

By design we wanted pods with schedulingGates set to not trigger autoscaling. The idea is that such pods still need to go through some validation logic (like if those pods have quota to schedule) before deciding if/when to consider them for placement.

So I strongly support option 1, otherwise this negates some of this feature's purpose.

@ahg-g
Copy link
Member

ahg-g commented Oct 28, 2022

We will add the condition PodScheduled=false to those pods, but with a different reason than the one the scheduler sets when it actually fails to find a node, so one thing we need to do on the CA side is to ignore pods with this new reason value.

Otherwise, we can use PodScheduled=unknown, which means no changes at all on CA. But I prefer the first approach.

@x13n
Copy link
Member Author

x13n commented Oct 31, 2022

Thanks, that makes sense to me. I guess the only thing to do would be to verify CA works as expected when such pods are ready.

As far as I can tell without actually testing, CA already filters by reason, so no changes should be required:

if condition != nil && condition.Status == apiv1.ConditionFalse && condition.Reason == apiv1.PodReasonUnschedulable {
unschedulablePods = append(unschedulablePods, pod)
}

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 31, 2023
@Huang-Wei
Copy link
Member

This can be closed. Now a scheduled gated pod would carry a condition like:

- type: PodScheduled
  status: False
  reason: SchedulingGated
  message: Scheduling is blocked due to non-empty scheduling gates

and it won't trigger autoscaling.

@x13n
Copy link
Member Author

x13n commented Feb 6, 2023

Ack, thanks!

/close

@k8s-ci-robot
Copy link
Contributor

@x13n: Closing this issue.

In response to this:

Ack, thanks!

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

6 participants