Skip to content

Conversation

@hajnalmt
Copy link
Contributor

When the hierarchy plugin is enabled, the capability check can fail:
#4350
It will pass now, if the capability is set properly: #4354
We should be able to set this value for the root queue through helm too.

What type of PR is this?

The PR adds a helm value that will render the rootQueue capability if provided.

What this PR does / why we need it:

Minor change in the helm chart.

Which issue(s) this PR fixes:

Fixes #4496

Does this PR introduce a user-facing change?

New helm value for root queue capabilty settings.

@volcano-sh-bot
Copy link
Contributor

Welcome @hajnalmt!

It looks like this is your first PR to volcano-sh/volcano.

Thank you, and welcome to Volcano. 😃

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign lowang-bh
You can assign the PR to them by writing /assign @lowang-bh in a comment when ready.

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

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @hajnalmt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new Helm chart value to allow users to configure the capability for the root queue in Volcano. This change addresses an issue where capability checks could fail when the hierarchy plugin is enabled, ensuring proper functionality by allowing the root queue's capabilities to be explicitly set via Helm.

Highlights

  • New Helm Value for Root Queue Capability: Introduces rootQueue.capability in values.yaml to enable configuration of the root queue's capabilities.
  • Dynamic Root Queue Resource Generation: Adds a new Helm template root_queue.yaml that conditionally creates a Queue resource for the root queue, applying the specified capability if provided.
  • Addresses Hierarchy Plugin Issue: Resolves a known issue (#4350 and #4496) where the hierarchy plugin's capability checks could fail without proper root queue capability settings.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@volcano-sh-bot volcano-sh-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 25, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Helm chart value to configure the capability for the root queue. The implementation is straightforward, adding a new template and updating values.yaml. My main feedback is to use snake_case for the new Helm value (root_queue) to maintain consistency with the existing values in the chart, which improves maintainability. I've provided suggestions to apply this change across both modified files.

@hajnalmt hajnalmt force-pushed the set-root-queue-capability branch 3 times, most recently from 2458b31 to 3f54713 Compare August 25, 2025 09:38
Copy link
Member

@JesseStutler JesseStutler left a comment

Choose a reason for hiding this comment

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

Also need to run make update-development-yaml to render helm template to volcano-development.yaml

@JesseStutler
Copy link
Member

func newDefaultAndRootQueue(vcClient vcclient.Interface, defaultQueue string) {
reclaimable := false
rootQueue := vcv1beta1.Queue{
ObjectMeta: metav1.ObjectMeta{
Name: "root",
},
Spec: vcv1beta1.QueueSpec{
Reclaimable: &reclaimable,
Weight: 1,
},
}
err := retry.OnError(wait.Backoff{
Steps: 60,
Duration: time.Second,
Factor: 1,
Jitter: 0.1,
}, func(err error) bool {
return !apierrors.IsAlreadyExists(err)
}, func() error {
_, err := vcClient.SchedulingV1beta1().Queues().Create(context.TODO(), &rootQueue, metav1.CreateOptions{})
return err
})
if err != nil && !apierrors.IsAlreadyExists(err) {
panic(fmt.Errorf("failed init root queue, with err: %v", err))
}
reclaimable = true
defaultQue := vcv1beta1.Queue{
ObjectMeta: metav1.ObjectMeta{
Name: defaultQueue,
},
Spec: vcv1beta1.QueueSpec{
Reclaimable: &reclaimable,
Weight: 1,
},
}
err = retry.OnError(wait.Backoff{
Steps: 60,
Duration: time.Second,
Factor: 1,
Jitter: 0.1,
}, func(err error) bool {
return !apierrors.IsAlreadyExists(err)
}, func() error {
_, err := vcClient.SchedulingV1beta1().Queues().Create(context.TODO(), &defaultQue, metav1.CreateOptions{})
return err
})
if err != nil && !apierrors.IsAlreadyExists(err) {
panic(fmt.Errorf("failed init default queue, with err: %v", err))
}
}

Besides, currently we install the root queue and the default queue after scheduler starts, if we need to move default queue and root queue installation to helm, we may consider deleting these codes

@JesseStutler
Copy link
Member

/ok-to-test

@volcano-sh-bot volcano-sh-bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 26, 2025
@hajnalmt hajnalmt changed the title Set root queue capability through helm. Set root queue capability through helm Aug 26, 2025
When the hierarchy plugin is enabled, the capability check can
fail:
volcano-sh#4350
It will pass now, if the capability is set properly:
volcano-sh#4354
We should be able to set this value for the root queue through
helm too.

Signed-off-by: Hajnal Máté <[email protected]>
@hajnalmt hajnalmt force-pushed the set-root-queue-capability branch from 3f54713 to 442b111 Compare August 26, 2025 14:54
@hajnalmt
Copy link
Contributor Author

hajnalmt commented Aug 26, 2025

The make update-development-yaml shall be ran before the next release if this gets in right?
I wouldn't remove the cache.go related code yet, but we should consider it later on definitely.

@JesseStutler
Copy link
Member

JesseStutler commented Aug 27, 2025

The make update-development-yaml shall be ran before the next release if this gets in right?

Yes some users may just directly use volcano-development.yaml by using kubectl to deploy volcano, so we need to make sure that the rendering result of helm is consistent with the volcano-development.yaml

@JesseStutler
Copy link
Member

There are a lot of CIs failed @hajnalmt , is that because the conflict with current codes in cache.go?

@hajnalmt
Copy link
Contributor Author

hajnalmt commented Aug 27, 2025

Sighs, it's a different issue... The problem is that the queue CRD does not exist when the chart get's installed.
Helm suggests to put the CRDs in a crds folder, and it won't touch them after they get installed. https://helm.sh/docs/chart_best_practices/custom_resource_definitions/
This will ensure that CRDs are installed first, but this makes the CRDs not updateable, which makes it horrific to deal with.
There is a community discussion about this: helm/community#379 so they can be updateable.

The practice currently is still the templating:
Contour: https://github.com/bitnami/charts/tree/9dde49c88c7a45d7fa36df5b81c285a627bad896/bitnami/contour/templates/crds Cert-manager: https://github.com/bitnami/charts/tree/9dde49c88c7a45d7fa36df5b81c285a627bad896/bitnami/cert-manager/templates/crds
But this means I can't just use it and create the root queue from helm a template. Shall I try to implement this via a helm hook? Or shall we wait for helm4 where they will be probably solving this?

@JesseStutler
Copy link
Member

Sighs, it's a different issue... The problem is that the queue CRD does not exist when the chart get's installed. Helm suggests to put the CRDs in a crds folder, and it won't touch them after they get installed. https://helm.sh/docs/chart_best_practices/custom_resource_definitions/ This will ensure that CRDs are installed first, but this makes the CRDs not updateable, which makes it horrific to deal with. There is a community discussion about this: helm/community#379 so they can be updateable.

The practice currently is still the templating: Contour: https://github.com/bitnami/charts/tree/9dde49c88c7a45d7fa36df5b81c285a627bad896/bitnami/contour/templates/crds Cert-manager: https://github.com/bitnami/charts/tree/9dde49c88c7a45d7fa36df5b81c285a627bad896/bitnami/cert-manager/templates/crds But this means I can't just use it and create the root queue from helm a template. Shall I try to implement this via a helm hook? Or shall we wait for helm4 where they will be probably solving this?

Our crds are also defined in a separate folder. Doesn't it mean that CRDs will be installed first? Then why is it still reporting an error that queue crd does not exist? We didn't update crd, but just installed a cr, right?

@hajnalmt
Copy link
Contributor Author

Our crds are also defined in a separate folder. Doesn't it mean that CRDs will be installed first? Then why is it still reporting an error that queue crd does not exist? We didn't update crd, but just installed a cr, right?

Our folder name is crd and not crds, and they are just referenced from the templates. For helm to install the CRDs first, they should be in a crds directory... After that you can use the helm CLI parameters to skip their installation (--skip-crds) the problem is that this makes the CRDs not upgradable, see the caveats section here:
https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#method-1-let-helm-do-it-for-you
so I think we shouldn't do this.

@hajnalmt
Copy link
Contributor Author

hajnalmt commented Sep 1, 2025

@JesseStutler Shall I close this until Helm has a better way to install the CRDs?

@houyuting
Copy link

@hajnalmt Hi, I have a idea that might solve your problem, The core idea is:
step 1: helm chart support Inject the capacity values ​​passed during helm install into the vc-scheduler Pod via environment variables or ConfigMap.
step 2: volcano Scheduler update pkg/scheduler/cache/cache.go so that when creating the root queue, it prioritizes reading the capacity values ​​in these environment variables or ConfigMaps, and uses the default values ​​if they do not exist.

@JesseStutler Please take a look together when you have time.

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

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support set root capability deserved and guarantee when volcano install by helm

4 participants