frontend: Add PodGroup and Workload scheduling views - #6562
frontend: Add PodGroup and Workload scheduling views#6562Anjali-Chauhan1 wants to merge 14 commits into
Conversation
95e0fad to
db294aa
Compare
|
/cc |
illume
left a comment
There was a problem hiding this comment.
Thanks for these changes.
Can you please have a look at the git commits to see if they meet the contribution guidelines? We use a Linux kernel style of git commits. See the contributing guide for general context, and please see previous git commits with git log for examples.
Commits that need attention
frontend: Add PodGroup and Workload scheduling support to plugin snapshot— Only one file changed insidefrontend/; add a sub-area so it's clear what was touched (e.g.frontend: ComponentName: description).frontend: Update GlobalSearch storyshot for Pod Groups page— Only one file changed insidefrontend/; add a sub-area so it's clear what was touched (e.g.frontend: ComponentName: description).
Commit guidelines
- Use atomic commits focused on a single change.
- Use the title format
<area>: <Description of changes>— description must start with a capital letter. - Keep the title under 72 characters (soft requirement).
- Explain the intention and why the change is needed.
- Make commit titles meaningful and describe what changed.
- Do not add code that a later commit rewrites; squash or reorder commits instead.
- Do not include
Fixes #NNin commit messages.
Good examples:
frontend: HomeButton: Fix so it navigates to homebackend: config: Add enable-dynamic-clusters flag
There was a problem hiding this comment.
Pull request overview
Adds first-class UI support for Kubernetes v1.36 workload-aware scheduling (alpha) by introducing built-in resource support for scheduling.k8s.io/v1alpha2 PodGroup and Workload, wiring them into routing, navigation, and the Pod details page.
Changes:
- Introduces new k8s resource classes (
PodGroup, schedulingWorkload) and registers them inResourceClasses(incl. plugin snapshot update). - Adds list/details pages + routes for PodGroups and scheduling Workloads, plus a Pod → PodGroup link in Pod details.
- Adds a gated “Scheduling (alpha)” sidebar section and updates i18n strings across all supported locales (plus updated storyshots/snapshots).
Reviewed changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/plugin/snapshots/pluginLib.snapshot | Updates plugin API snapshot for new exported k8s modules/classes. |
| frontend/src/lib/router/index.tsx | Adds routes for PodGroups and scheduling Workloads. |
| frontend/src/lib/k8s/schedulingWorkload.ts | Adds scheduling.k8s.io Workload KubeObject class (custom listRoute). |
| frontend/src/lib/k8s/podGroup.ts | Adds PodGroup KubeObject class + helpers and feature-gate availability check. |
| frontend/src/lib/k8s/podGroup.test.ts | Adds unit tests for PodGroup class helpers/getters. |
| frontend/src/lib/k8s/pod.ts | Extends Pod spec typing with schedulingGroup.podGroupName. |
| frontend/src/lib/k8s/index.ts | Registers new resource classes and re-exports new modules. |
| frontend/src/lib/k8s/index.test.ts | Extends ResourceClasses namespace coverage assertions for new resources. |
| frontend/src/i18n/locales/zh/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/zh/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/zh-tw/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/zh-tw/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/ur/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/ur/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/ta/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/ta/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/ru/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/ru/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/pt/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/pt/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/ko/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/ko/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/ja/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/ja/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/it/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/it/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/hi/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/hi/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/he/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/he/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/fr/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/fr/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/es/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/es/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/en/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/en/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/de/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/de/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/bn/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/bn/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/i18n/locales/ar/translation.json | Adds new translation keys used by PodGroup/Workload UIs. |
| frontend/src/i18n/locales/ar/glossary.json | Adds glossary entries for new sidebar/routes/resources. |
| frontend/src/components/Sidebar/useSidebarItems.tsx | Adds query-gated “Scheduling (alpha)” sidebar section. |
| frontend/src/components/schedulingWorkload/List.tsx | Adds scheduling Workload list view. |
| frontend/src/components/schedulingWorkload/List.test.tsx | Adds unit tests for scheduling Workload list columns/formatting. |
| frontend/src/components/schedulingWorkload/Details.tsx | Adds scheduling Workload details view + templates table. |
| frontend/src/components/podGroup/List.tsx | Adds PodGroup list view with scheduling status rendering. |
| frontend/src/components/podGroup/List.test.tsx | Adds unit tests for PodGroup list column definitions and status rendering. |
| frontend/src/components/podGroup/Details.tsx | Adds PodGroup details view with links and extra fields. |
| frontend/src/components/pod/Details.tsx | Adds Pod → PodGroup row linking to the PodGroup details page. |
| frontend/src/components/globalSearch/snapshots/GlobalSearchContent.FoundSomeResults.stories.storyshot | Updates storyshot snapshot due to new navigation/search results. |
|
/wg workload-aware-scheduling |
589c19b to
798ff94
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Anjali-Chauhan1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
AI-assisted review finding (disclosed): This review comment was identified with assistance from an AI coding agent and verified against the Kubernetes High — v1alpha3 PodGroup workload references are not parsed The PR negotiates between
Because Please normalize both API shapes (for example with |
illume
left a comment
There was a problem hiding this comment.
Thanks for working on this.
Would you mind addressing the open Copilot review comments? Please mark each comment as resolved after addressing it.
Thanks @kannon92 . I'd only handled the v1alpha2 shape, so on 1.37 the Workload link and template name wouldn't show up. |
33d49cf to
1c8eac7
Compare
6cf0633 to
6f25fb0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.
Suppressed comments (4)
frontend/src/lib/k8s/index.ts:118
- Registering
Workloadby kind makes Advanced Search misroute other APIs with the same kind.useKubeListscurrently selectsResourceClasses[it.kind]without checkingit.apiVersion, so selecting a Kueuekueue.x-k8s.io/...Workload now queriesscheduling.k8s.io/.../workloadsinstead. Update that lookup to require an API-version/group match before using the built-in class, otherwise use the discovered dynamic class.
frontend/src/lib/k8s/podGroup.ts:97 - The PR notes state that feature-gated
resourceClaimsare rendered when present, but the PodGroup details view never reads this field. Users withDRAWorkloadResourceClaimsenabled therefore cannot inspect any claim name or referenced ResourceClaim/ResourceClaimTemplate. Add a conditional details section or table for these claims (and corresponding tests/translations), or correct the stated scope.
frontend/src/lib/k8s/schedulingWorkload.ts:83 - The PR history contains a sequence of corrective commits over the same scheduling implementation (API negotiation, required cluster parameter, v1alpha2/v1alpha3 shape fixes, status handling, then v1beta1 support). Please squash/reorder these follow-ups into coherent commits so reviewers can evaluate the final version-support change without reconstructing intermediate regressions.
frontend/src/lib/k8s/index.ts:88 - This kind-only registration also captures third-party
PodGroupresources in Advanced Search. For example, Volcano servesscheduling.volcano.sh/v1beta1with kindPodGroup, butuseKubeListswill now instantiate this class and queryscheduling.k8s.ioinstead of the discovered API. Match both kind and API version/group before choosing a built-in class.
cae1aae to
eee302c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 71 out of 71 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
frontend/src/components/Sidebar/useSidebarItems.tsx:87
- This acceptance-critical sidebar gate is not covered by
useSidebarItems.test.tsx: the existing tests never mockPodGroup.isEnabled()or verify that the Scheduling section is shown for a supporting selected cluster and hidden otherwise. Please add both cases (and preferably the multi-clustersome(Boolean)case) so regressions in this asynchronous gate do not silently remove or expose the navigation.
const { data: schedulingWorkloadsEnabled = false } = useQuery({
queryKey: ['schedulingWorkloadsEnabled', ...selectedClusters],
queryFn: async () => {
const enabledPerCluster = await Promise.all(
selectedClusters.map(cluster => PodGroup.isEnabled(cluster))
frontend/src/lib/k8s/podGroup.ts:159
- The PR history has multiple corrective commits that substantially revise this same version-negotiation work (
Negotiate...,Fix v1alpha2/v1alpha3...,Support v1beta1..., andNormalize...plus its comment-only follow-up). Please squash/reorder these into coherent feature and test commits so the final API-version design can be reviewed without following intermediate broken states.
Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
The plugin library snapshot records the built-in ResourceClasses that are exposed to plugins. Update it to include the newly added PodGroup and Workload scheduling resources. Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
Adding the Pod Groups page makes it match the global search query in the FoundSomeResults story, which shifts the rendered result list. Regenerate the storyshot to match. Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
The workload aware scheduling API is alpha and each Kubernetes release replaces the served version (v1alpha2 in 1.36, v1alpha3 in 1.37), so pinning v1alpha2 broke the pages on 1.37 clusters. Declare both versions so the endpoint negotiation resolves to whichever the cluster serves, and probe each candidate in isEnabled() so the sidebar gating works on either release. Also rename the sidebar query key to match what the result is used for, and add unit tests for the scheduling Workload class and the isEnabled() version fallback. Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com> frontend: PodGroup: Add getDisruptionMode function to snapshot Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
…lback Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
v1alpha2 reports whether the group's scheduling requirement has been satisfied through the PodGroupScheduled condition, but v1alpha3 and v1beta1 renamed it to PodGroupInitiallyScheduled. Matching only the v1alpha2 name left every group on a newer cluster showing as Unknown, even when it was scheduled or unschedulable. Match either name and cover all three versions in the tests. Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
… a comment Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
The composite pod group template carries a required schedulingPolicy, and optional schedulingConstraints and disruptionMode, but the model omitted all three. That let the fixtures describe objects the API would reject and left the details table unable to show the composite group's scheduling behaviour. Model the three fields and show them in the table. The composite gang policy counts child groups through minGroupCount rather than the minCount a pod group template uses, so it gets its own column. The disruption mode reuses the pod group shape, but reads as Single or All because it applies to child groups rather than pods. Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
The pod group template carries a disruptionMode, priorityClassName and priority that the model omitted, the same gap the composite template had. Model them and show them, so both tables describe their template's scheduling behaviour rather than only the composite one. podGroupTemplates is also optional in the API, since a Workload sets exactly one of it and compositePodGroupTemplates. Mark it so instead of relying on the getter's fallback. Also carries the Min Group Count catalog entry, which the previous commit generated but left out of the tree. Signed-off-by: Anjali-Chauhan1 <anjalichauhan1036@gmail.com>
eee302c to
916d740
Compare
|
It would be cool to present this integration in wg-was meeting in the future. (I felt like I said this somewhere). |
Yes, I'd like that. Once this merges, I'll put together a short demo of the pod group and workload views. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 71 out of 71 changed files in this pull request and generated no new comments.
Suppressed comments (3)
frontend/src/components/Sidebar/useSidebarItems.tsx:87
- This query implements the PR's required sidebar gating, but
useSidebarItems.test.tsxhas no coverage for it. Add tests that mockPodGroup.isEnabled()and verify the section appears when any selected cluster serves the API and remains absent when none do; otherwise a regression could expose dead navigation on unsupported clusters.
const { data: schedulingWorkloadsEnabled = false } = useQuery({
queryKey: ['schedulingWorkloadsEnabled', ...selectedClusters],
queryFn: async () => {
const enabledPerCluster = await Promise.all(
selectedClusters.map(cluster => PodGroup.isEnabled(cluster))
frontend/src/lib/k8s/podGroup.ts:103
- The PR notes say
resourceClaimsis rendered when present, but the PodGroup details view never reads this field, so users cannot see either direct claims or claim templates. Please add a conditional details row/section for these entries, or update the PR description if displaying them is intentionally out of scope.
frontend/src/lib/k8s/podGroup.ts:160 - The PR history contains multiple corrective follow-ups that substantially revise the initial implementation (API-version negotiation, cross-version field/condition handling, and template model fixes). Please squash or reorder these into coherent logical commits so reviewers do not need to reconstruct the final behavior across corrective commits.
Summary
This PR adds support for Workload-Aware Scheduling in Headlamp by displaying the two new gang-scheduling APIs introduced in Kubernetes v1.36 — PodGroup and Workload (
scheduling.k8s.io/v1alpha2). These are built-in aggregated APIs (not CRDs), so Headlamp previously had no way to surface them: they don't appear under Custom Resources or in Advanced Search. As a result, a user whose Pod is stuckPendingbecause its gang group is incomplete had no way to see why. This PR closes that gap with dedicated list/details views, a Pod → PodGroup link, and a gated sidebar section.Related Issue
Fixes #6488
Changes
PodGroupandWorkloadresource classes underlib/k8s/(podGroup.ts,schedulingWorkload.ts), registered inResourceClasses.PodGroup.isEnabled()so it only shows on clusters that actually serve the alpha API.spec.schedulingGroup.podGroupNamefield.Steps to Test
Screenshots (if applicable)
/podgroups→ 404Workloads
Pod Groups
Notes for the Reviewer
Workloadclass lives inschedulingWorkload.ts(notworkload.ts) to avoid a case-insensitive filename clash with the existingWorkload.tsunion type. ItslistRouteis overridden to/scheduling/workloadsbecause theworkloadsroute already belongs to the Workloads overview page. It's registered inResourceClasseskeyed by kind (Workload).PodGroup.isEnabled()(a direct version check, likeVPA.isEnabled()) rather thanapiDiscovery, because discovery only reports the first version of an API group andscheduling.k8s.ioalso servesv1— so discovery would never see the alpha PodGroup.PodGroup.specfields (priority, disruptionMode, topology, resourceClaims) sit behind their own feature gates, so they're rendered only when present (hidewhen absent) rather than showing empty rows.Summary by CodeRabbit