Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add printer columns to Queue, ClusterQueue and QueuedWorkload #156

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion api/v1alpha1/clusterqueue_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ type ClusterQueueStatus struct {
PendingWorkloads int32 `json:"pendingWorkloads"`

// AdmittedWorkloads is the number of workloads currently admitted to this
// clusterQueue.
// clusterQueue and haven't finished yet.
// +optional
AdmittedWorkloads int32 `json:"admittedWorkloads"`
}
Expand All @@ -284,6 +284,10 @@ type Usage struct {
//+kubebuilder:object:root=true
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Cohort",JSONPath=".spec.cohort",type=string,description="Cohort that this ClusterQueue belongs to"
//+kubebuilder:printcolumn:name="Strategy",JSONPath=".spec.queueingStrategy",type=string,description="The queueing strategy used to prioritize workloads",priority=1
//+kubebuilder:printcolumn:name="Pending Workloads",JSONPath=".status.pendingWorkloads",type=integer,description="Number of pending workloads"
//+kubebuilder:printcolumn:name="Admitted Workloads",JSONPath=".status.admittedWorkloads",type=integer,description="Number of admitted workloads that haven't finished yet",priority=1

// ClusterQueue is the Schema for the clusterQueue API.
type ClusterQueue struct {
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha1/queue_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type QueueStatus struct {

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="ClusterQueue",JSONPath=".spec.clusterQueue",type=string,description="Backing ClusterQueue"
//+kubebuilder:printcolumn:name="Pending Workloads",JSONPath=".status.pendingWorkloads",type=integer,description="Number of pending workloads"

// Queue is the Schema for the queues API
type Queue struct {
Expand Down
5 changes: 4 additions & 1 deletion api/v1alpha1/queuedworkload_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ const (
)

//+kubebuilder:object:root=true
//+kubebuilder:resource:shortName={workload,qw}
//+kubebuilder:resource:shortName={workload,workloads,qw}
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Queue",JSONPath=".spec.queueName",type=string,description="Name of the queue this workload was submitted to"
//+kubebuilder:printcolumn:name="Admitted by",JSONPath=".spec.admission.clusterQueue",type=string,description="Name of the ClusterQueue that admitted this workload"
//+kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type=date,description="Time this workload was created"

// QueuedWorkload is the Schema for the queuedworkloads API
type QueuedWorkload struct {
Expand Down
23 changes: 21 additions & 2 deletions config/crd/bases/kueue.x-k8s.io_clusterqueues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,26 @@ spec:
singular: clusterqueue
scope: Cluster
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Cohort that this ClusterQueue belongs to
jsonPath: .spec.cohort
name: Cohort
type: string
- description: The queueing strategy used to prioritize workloads
jsonPath: .spec.queueingStrategy
name: Strategy
priority: 1
type: string
- description: Number of pending workloads
jsonPath: .status.pendingWorkloads
name: Pending Workloads
type: integer
- description: Number of admitted workloads that haven't finished yet
jsonPath: .status.admittedWorkloads
name: Admitted Workloads
priority: 1
type: integer
name: v1alpha1
schema:
openAPIV3Schema:
description: ClusterQueue is the Schema for the clusterQueue API.
Expand Down Expand Up @@ -245,7 +264,7 @@ spec:
properties:
admittedWorkloads:
description: AdmittedWorkloads is the number of workloads currently
admitted to this clusterQueue.
admitted to this clusterQueue and haven't finished yet.
format: int32
type: integer
pendingWorkloads:
Expand Down
16 changes: 15 additions & 1 deletion config/crd/bases/kueue.x-k8s.io_queuedworkloads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,25 @@ spec:
plural: queuedworkloads
shortNames:
- workload
- workloads
- qw
singular: queuedworkload
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Name of the queue this workload was submitted to
jsonPath: .spec.queueName
name: Queue
type: string
- description: Name of the ClusterQueue that admitted this workload
jsonPath: .spec.admission.clusterQueue
name: Admitted by
type: string
- description: Time this workload was created
jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: QueuedWorkload is the Schema for the queuedworkloads API
Expand Down
11 changes: 10 additions & 1 deletion config/crd/bases/kueue.x-k8s.io_queues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ spec:
singular: queue
scope: Namespaced
versions:
- name: v1alpha1
- additionalPrinterColumns:
- description: Backing ClusterQueue
jsonPath: .spec.clusterQueue
name: ClusterQueue
type: string
- description: Number of pending workloads
jsonPath: .status.pendingWorkloads
name: Pending Workloads
type: integer
name: v1alpha1
schema:
openAPIV3Schema:
description: Queue is the Schema for the queues API
Expand Down