Skip to content

Conversation

@kannon92
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Allow admins to specify excluded resources at the cluster queue level rather than a global configuration

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Implement excludedResourcePrefixes at the cluster queue level

kannon92 and others added 5 commits October 27, 2025 16:19
Implement Phase 1 of KEP-5800: ClusterQueue-level Resource Exclusion

This commit adds the API infrastructure for per-ClusterQueue resource
exclusions that work in union with global configuration exclusions.

Changes:
- Add excludeResourcePrefixes field to ClusterQueueSpec in v1beta2 API
- Add ClusterQueueExcludeResources feature gate (alpha, disabled by default)
- Add validation for excludeResourcePrefixes field in webhook
  - Reject empty prefix strings
  - Warn about excluding critical resources (cpu, memory, GPUs)
- Run code generation to update:
  - CRD manifests with new field and validators
  - DeepCopy, conversion, and applyconfiguration code
  - API reference documentation

The excludeResourcePrefixes field is marked as optional with a maximum
of 64 prefixes and uses set semantics (no duplicates).

Related to kubernetes-sigs#5800

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Implement Phase 2 of KEP-5800: Core resource exclusion functionality

This commit implements the union behavior for resource exclusions,
merging global configuration exclusions with ClusterQueue-specific
excludeResourcePrefixes when creating workload Info objects.

Changes to pkg/cache/queue/cluster_queue.go:
- Add excludeResourcePrefixes field to ClusterQueue struct
- Update ClusterQueue.Update() to store CQ-level exclusions from API
- Add GetExcludeResourcePrefixes() method for safe access

Changes to pkg/cache/queue/manager.go:
- Add globalExcludedResourcePrefixes field to Manager struct
- Update WithExcludedResourcePrefixes() to store global exclusions
- Add workloadInfoOptionsWithCQExclusions() to merge exclusions
- Add mergeExclusions() helper for deduplicating prefixes
- Update AddOrUpdateWorkloadWithoutLock() to use merged exclusions
- Update AddLocalQueue() workload creation to use merged exclusions
- Update queueSecondPass() to use merged exclusions

The implementation uses the union strategy: a resource is excluded
if it matches EITHER the global OR the ClusterQueue-specific prefixes.
The feature is gated by ClusterQueueExcludeResources feature gate.

Related to kubernetes-sigs#5800

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@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. labels Oct 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

@netlify
Copy link

netlify bot commented Oct 28, 2025

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 00b014c
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-kueue/deploys/69012e515204cd00086c1f88
😎 Deploy Preview https://deploy-preview-7424--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added 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. labels Oct 28, 2025
@k8s-ci-robot
Copy link
Contributor

@kannon92: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kueue-test-unit-main 00b014c link true /test pull-kueue-test-unit-main
pull-kueue-test-integration-extended-main 00b014c link true /test pull-kueue-test-integration-extended-main
pull-kueue-verify-main 00b014c link true /test pull-kueue-verify-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

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

PR needs rebase.

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

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

2 participants