Skip to content

Conversation

@norbertcyran
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Integrated CapacityQuota CRD with the new resource quotas system. With --capacity-quotas-enabled flag, CAS will respect quotas defined in CapacityQuota resources during scale ups. Additionally, wrapped the main entrypoint in a Manager from controller-runtme library, so we can use the client from that library and we can start incremental refactor into a more controller-based architecture.

Which issue(s) this PR fixes:

Part of #8703

Special notes for your reviewer:

I've split the PR into 3 separate commits, I suggest reviewing them one by one.

Does this PR introduce a user-facing change?

Added support for `CapacityQuota` CRD, which can be used to limit resources scaled up by CAS. It can be enabled with `--capacity-quotas-enabled` flag. See the proposal and example usage: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/granular-resource-limits.md 

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

-[Proposal]: https://github.com/kubernetes/autoscaler/blob/9db3d2536ebd1484a5ae24a601f2d147cb3217a3/cluster-autoscaler/proposals/granular-resource-limits.md

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/needs-area labels Dec 16, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: norbertcyran
Once this PR has been reviewed and has the lgtm label, please assign aleksandra-malinowska for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 16, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @norbertcyran. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed do-not-merge/needs-area labels Dec 16, 2025
@norbertcyran norbertcyran force-pushed the capacity-quota-integration branch from 5fc9ea2 to 92eece6 Compare December 16, 2025 13:02
Start refactoring cluster autoscaler's main to use Manager from
controller-runtime. For now, that's needed to use Client that's used by
CapacityQuota provider. In the future, main should be refactored,
so the manager handles leader election, metrics, healthcheck and pprof
servers and graceful shutdown. Additionally, that change allows us
to write controller-runtime style controllers.
@norbertcyran norbertcyran force-pushed the capacity-quota-integration branch from 92eece6 to 2370dbb Compare December 16, 2025 13:18
@norbertcyran norbertcyran marked this pull request as ready for review December 16, 2025 13:53
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2025
@k8s-ci-robot k8s-ci-robot requested a review from elmiko December 16, 2025 13:53
capacitybufferPodInjectionEnabled = flag.Bool("capacity-buffer-pod-injection-enabled", false, "Whether to enable pod list processor that processes ready capacity buffers and injects fake pods accordingly")
nodeRemovalLatencyTrackingEnabled = flag.Bool("node-removal-latency-tracking-enabled", false, "Whether to track latency from when an unneeded node is eligible for scale down until it is removed or needed again.")
maxNodeSkipEvalTimeTrackerEnabled = flag.Bool("max-node-skip-eval-time-tracker-enabled", false, "Whether to enable the tracking of the maximum time of node being skipped during ScaleDown")
capacityQuotasEnabled = flag.Bool("capacity-quotas-enabled", false, "Whether to enable CapacityQuota CRD support.")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like that's our common pattern for gating new features. Wouldn't it be better to introduce a k8s-like feature-gates flag? I think they would be easier to clean up. Also it would limit the number of flags we're introducing into CAS, which might be beneficial, considering how many are already there

@elmiko
Copy link
Contributor

elmiko commented Dec 16, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 16, 2025
@norbertcyran
Copy link
Contributor Author

/assign BigDarkClown

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 19, 2025
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Details

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants