kueue: Add queue maintenance mode controls and drain actions - #1252
abhayrajjais01 wants to merge 1 commit into
Conversation
af1fabe to
6fbc27d
Compare
Ralthos
left a comment
There was a problem hiding this comment.
This closes a real gap: spec.stopPolicy is read-only on the LocalQueue page today. The
drain confirmation is the right call.
No access check on the controls
QueueMaintenanceControl goes into extraSections unconditionally, under the
KueueAdminResourceAccess that checks verb="get". A read-only user sees
Drain Queue (HoldAndDrain), confirms, and gets a 403. AuthVisible with authVerb="patch"
would hide the buttons.
LocalQueue also needs a namespace there, or the check asks about patching cluster-wide and
refuses anyone holding the permission through a RoleBinding. That is #1199 again.
cohortName breaks the empty case
- value: renderCohortLink(clusterQueue.spec.cohortName),
+ value: renderCohortLink(clusterQueue.cohortName),The getter returns this.spec.cohortName || '-', and renderCohortLink guards on
if (!cohortName). Since '-' is truthy, a ClusterQueue with no cohort now renders a link to a
cohort named -. Looks unrelated to the feature, so possibly accidental.
Six strings never reach the catalog
t(getStopPolicyLabel(...)) builds the key at runtime and i18next-parser extracts statically,
so the three labels and three descriptions are absent from translation.json. The parser needs
the literals at the t() call site.
The i18n array is empty
"headlamp": { "i18n": [] } lists no locales, so the locales/en/translation.json added here
may never load. prometheus lists 19, flux lists ["en"].
Implement QueueMaintenanceControl card with AuthVisible RBAC checks, stopPolicy formatters, static i18n keys, and drain confirmation modal. Signed-off-by: Abhayraj Jaiswal <abhayraj916146@gmail.com>
6fbc27d to
1f76e91
Compare
Hi @Ralthos , Thanks for the great feedback! have updated the PR with all your suggestions: Permission Check: Wrapped the buttons in happy to make any further changes if needed |
|
All four landed cleanly. Thanks for turning it around so fast. The buttons sit inside Cohort reads Labels and descriptions are literals at the Formatter tests pass here and |
Description
This PR introduces interactive Queue Maintenance Mode controls (
HoldAndDrain,Hold, andNoneresume) forClusterQueueandLocalQueueresources in the Headlamp Kueue plugin.In Kueue, cluster operators manage queue availability and maintenance via
spec.stopPolicy. When taking nodes offline or performing cluster maintenance, operators need direct controls in Headlamp to:Hold): Safely pauses new workload admissions while allowing running workloads to complete normally.HoldAndDrain): Pauses new admissions and evicts currently admitted workloads (with safety confirmation dialog).None): Re-enables normal workload admission.What Changes
src/resources/queueControlFormatters.ts):getStopPolicyColor,getStopPolicyLabel, andgetStopPolicyDescriptionto provide color-coded chips and operational explanations.createStopPolicyPatchfor standard Kubernetesspec.stopPolicypatch mutations.src/components/common/QueueMaintenanceControl.tsx):QueueMaintenanceControl: Renders maintenance status badge with color coding (Green:Active, Orange:Paused (Hold), Red:Drain (HoldAndDrain)).HoldAndDrainactions explaining that in-flight workloads will be evicted.QueueMaintenanceControlintoClusterQueueDetailandLocalQueueDetailviews.src/resources/queueControlFormatters.test.ts):