Skip to content

Conversation

@ChristianZaccaria
Copy link
Contributor

@ChristianZaccaria ChristianZaccaria commented Mar 5, 2025

What type of PR is this?

/kind documentation

What this PR does / why we need it:

  • Update the ResourceFlavor site documentation to enhance readability and ensure a smoother user experience.

Which issue(s) this PR fixes:

Fixes #4499

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added kind/documentation Categorizes issue or PR as related to documentation. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 5, 2025
@k8s-ci-robot k8s-ci-robot requested review from gabesaba and mimowo March 5, 2025 10:30
@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 Mar 5, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @ChristianZaccaria. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 5, 2025
@netlify
Copy link

netlify bot commented Mar 5, 2025

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 7865c80
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/67e2df5ca338650008b27683
😎 Deploy Preview https://deploy-preview-4500--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 site configuration.

@mbobrovskyi
Copy link
Contributor

/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 Mar 5, 2025
@mbobrovskyi
Copy link
Contributor

/release-note-edit

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 5, 2025
@mimowo
Copy link
Contributor

mimowo commented Mar 5, 2025

/assgin @gabesaba
tentatively


**Requires Kubernetes 1.23 or newer**

This approach may be best for teams that wish to schedule pods onto the appropriate nodes automatically. However, a limitation arises when multiple types of specialized hardware are present, such as two different nvidia.com/gpu resources present in the cluster, i.e., T4 and A100 GPUs. The system may not differentiate between them, meaning the pods could be scheduled on any of both types of hardware.
Copy link
Contributor

Choose a reason for hiding this comment

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

TBH I tend to ask people to use new lines for each sentence as this gets hard to read in markdown.

Suggested change
This approach may be best for teams that wish to schedule pods onto the appropriate nodes automatically. However, a limitation arises when multiple types of specialized hardware are present, such as two different nvidia.com/gpu resources present in the cluster, i.e., T4 and A100 GPUs. The system may not differentiate between them, meaning the pods could be scheduled on any of both types of hardware.
This approach may be best for teams that wish to schedule pods onto the appropriate nodes automatically.
However, a limitation arises when multiple types of specialized hardware are present, such as two different nvidia.com/gpu resources present in the cluster, i.e., T4 and A100 GPUs.
The system may not differentiate between them, meaning the pods could be scheduled on any of both types of hardware.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I understand your point with Markdown. These docs will ultimately be read from the website which makes sense to have them in a single parragraph. - I could do a 'break' on each sentence, while keeping it in the same parragraph if that suits? - Please see latest commit as an example

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea that is great.


This approach may be best for teams that wish to schedule pods onto the appropriate nodes automatically. However, a limitation arises when multiple types of specialized hardware are present, such as two different nvidia.com/gpu resources present in the cluster, i.e., T4 and A100 GPUs. The system may not differentiate between them, meaning the pods could be scheduled on any of both types of hardware.

To associate a ResourceFlavor with a subset of nodes of your cluster, you can configure the `.spec.nodeLabels` field with matching node labels that uniquely identify the nodes. If you are using [cluster autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) (or equivalent controllers), make sure that the controller is configured to add those labels when adding new nodes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To associate a ResourceFlavor with a subset of nodes of your cluster, you can configure the `.spec.nodeLabels` field with matching node labels that uniquely identify the nodes. If you are using [cluster autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) (or equivalent controllers), make sure that the controller is configured to add those labels when adding new nodes.
To associate a ResourceFlavor with a subset of nodes of your cluster, you can configure the `.spec.nodeLabels` field with matching node labels that uniquely identify the nodes.
If you are using [cluster autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler) (or equivalent controllers), make sure that the controller is configured to add those labels when adding new nodes.

A sample ResourceFlavor of this type looks like the following:

```yaml
apiVersion: kueue.x-k8s.io/v1beta1
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move this to a samples and use that here? That follows our code in workloads.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean like this for example?

To install a simple setup of cluster queue, run the following command:
```shell
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/kueue/main/site/static/examples/admin/single-clusterqueue-setup.yaml
```

My only concern with this, is that then the yaml and the fields are then not displayed in the docs. I could add both, the yaml and the file that can be applied. Does that sound good?

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like: https://github.com/kubernetes-sigs/kueue/blob/main/site/content/en/docs/tasks/run/jobsets.md

Where we define the sample yaml in the static folder and import it in the docs. The website renders the YAML but we also have examples users can apply without reading the website.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh I understand. Hmm, for this to be a "working" ResourceFlavor, we would need to know which nodeLabels to use in the YAML. nodeLabels being used to associate the ResourceFlavor with the node in the cluster. A generic one wouldn't work, so the user can't just apply the file and see real results. - The only way I see, is to instruct the user to add the label to the node before applying the file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think adding what you have for the example is sufficient for the website.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added that now, including the empty flavor. Thanks :)

@kannon92
Copy link
Contributor

/lgtm

Nice addition!

/assign @mimowo @tenzen-y

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 11, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

DetailsGit tree hash: 9cc9eb2207ce1b3225ea13fe5512351e9560a6fe

@mimowo
Copy link
Contributor

mimowo commented Mar 20, 2025

/assign @gabesaba
for an additional pass

Copy link
Contributor

@gabesaba gabesaba left a comment

Choose a reason for hiding this comment

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

Changes look great! Only a couple of nits

This occurs if the Workload didn't specify the `ResourceFlavor` labels already as part of its nodeSelector.

For example, for a [batch/v1.Job](https://kubernetes.io/docs/concepts/workloads/controllers/job/), Kueue adds the labels to the `.spec.template.spec.nodeSelector` field.
This guarantees that the workload's Pods can only be scheduled on the nodes targeted by the flavor that Kueue assigned to the Workload.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consistently capitalize Workload - here and elsewhere. I have a preference for Upper Case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thank you!

{{< include "examples/admin/resource-flavor-tolerations.yaml" "yaml" >}}

When defining a ResourceFlavor as above, you can set the following values:
- The `.metadata.name` field to reference a ResourceFlavor from a [ClusterQueue](/docs/concepts/cluster_queue) in the `.spec.resourceGroups[*].flavors[*].name` field.
Copy link
Contributor

Choose a reason for hiding this comment

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

metadata.name is required, but it sounds optional here (and below in the resource-flavor-taints section).

Perhaps add something about how name is used to uniquely identify a ResourceFlavor (as you did with ClusterQueue)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made this more explicit, thank you!

{{< include "examples/admin/resource-flavor-taints.yaml" "yaml" >}}

When defining a ResourceFlavor as above, you can set the following values:
- The `.metadata.name` field to reference a ResourceFlavor from a [ClusterQueue](/docs/concepts/cluster_queue) in the `.spec.resourceGroups[*].flavors[*].name` field.
Copy link
Contributor

Choose a reason for hiding this comment

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

see comment above

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 25, 2025
@gabesaba
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 26, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

DetailsGit tree hash: dd5dcc08356b1f5b6a4ead41e43c8e50de1d0b50

@mimowo
Copy link
Contributor

mimowo commented Mar 26, 2025

I think docs is a super important area for adoption, but often neglected, unfortunately.

Thank you for keeping the lights on!

/approve
/cherry-pick website

@k8s-infra-cherrypick-robot
Copy link
Contributor

@mimowo: once the present PR merges, I will cherry-pick it on top of website in a new PR and assign it to you.

Details

In response to this:

I think docs is a super important area for adoption, but often neglected, unfortunately.

Thank you for keeping the lights on!

/approve
/cherry-pick website

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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ChristianZaccaria, mimowo

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

The pull request process is described 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2025
@ChristianZaccaria
Copy link
Contributor Author

@mimowo thank you for the continuous support and encouragement! Happy to contribute in any way I can :)

@k8s-ci-robot k8s-ci-robot merged commit 3df47f0 into kubernetes-sigs:main Mar 26, 2025
7 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.12 milestone Mar 26, 2025
@k8s-infra-cherrypick-robot
Copy link
Contributor

@mimowo: new pull request created: #4795

Details

In response to this:

I think docs is a super important area for adoption, but often neglected, unfortunately.

Thank you for keeping the lights on!

/approve
/cherry-pick website

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update ResourceFlavor site documentation

8 participants