Skip to content

Commit cbe0d0a

Browse files
authored
add crd(podgroup, elasticquotas) field (#731)
* add crd(podgroup, elasticquotas) field * fix: crd field type Signed-off-by: googs1025 <[email protected]> --------- Signed-off-by: googs1025 <[email protected]>
1 parent e72cb4d commit cbe0d0a

File tree

5 files changed

+93
-4
lines changed

5 files changed

+93
-4
lines changed

apis/scheduling/v1alpha1/types.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ import (
2929
// +kubebuilder:resource:shortName={eq,eqs}
3030
// +kubebuilder:subresource:status
3131
// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes-sigs/scheduler-plugins/pull/52"
32+
// +kubebuilder:printcolumn:name="Used",JSONPath=".status.used",type=string,description="Used is the current observed total usage of the resource in the namespace."
33+
// +kubebuilder:printcolumn:name="Max",JSONPath=".spec.max",type=string,description="Max is the set of desired max limits for each named resource."
34+
// +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type=date,description="Age is the time ElasticQuota was created."
3235
type ElasticQuota struct {
3336
metav1.TypeMeta `json:",inline"`
3437

@@ -116,6 +119,12 @@ const (
116119
// +kubebuilder:resource:shortName={pg,pgs}
117120
// +kubebuilder:subresource:status
118121
// +kubebuilder:metadata:annotations="api-approved.kubernetes.io=https://github.com/kubernetes-sigs/scheduler-plugins/pull/50"
122+
// +kubebuilder:printcolumn:name="Phase",JSONPath=".status.phase",type=string,description="Current phase of PodGroup."
123+
// +kubebuilder:printcolumn:name="MinMember",JSONPath=".spec.minMember",type=integer,description="MinMember defines the minimal number of members/tasks to run the pod group."
124+
// +kubebuilder:printcolumn:name="Running",JSONPath=".status.running",type=integer,description="The number of actively running pods."
125+
// +kubebuilder:printcolumn:name="Succeeded",JSONPath=".status.succeeded",type=integer,description="The number of pods which reached phase Succeeded."
126+
// +kubebuilder:printcolumn:name="Failed",JSONPath=".status.failed",type=integer,description="The number of pods which reached phase Failed."
127+
// +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type=date,description="Age is the time PodGroup was created."
119128
type PodGroup struct {
120129
metav1.TypeMeta `json:",inline"`
121130
// Standard object's metadata.

config/crd/bases/scheduling.x-k8s.io_elasticquotas.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,21 @@ spec:
1919
singular: elasticquota
2020
scope: Namespaced
2121
versions:
22-
- name: v1alpha1
22+
- additionalPrinterColumns:
23+
- description: Used is the current observed total usage of the resource in the
24+
namespace.
25+
jsonPath: .status.used
26+
name: Used
27+
type: string
28+
- description: Max is the set of desired max limits for each named resource.
29+
jsonPath: .spec.max
30+
name: Max
31+
type: string
32+
- description: Age is the time ElasticQuota was created.
33+
jsonPath: .metadata.creationTimestamp
34+
name: Age
35+
type: date
36+
name: v1alpha1
2337
schema:
2438
openAPIV3Schema:
2539
description: ElasticQuota sets elastic quota restrictions per namespace

config/crd/bases/scheduling.x-k8s.io_podgroups.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,33 @@ spec:
1919
singular: podgroup
2020
scope: Namespaced
2121
versions:
22-
- name: v1alpha1
22+
- additionalPrinterColumns:
23+
- description: Current phase of PodGroup.
24+
jsonPath: .status.phase
25+
name: Phase
26+
type: string
27+
- description: MinMember defines the minimal number of members/tasks to run the
28+
pod group.
29+
jsonPath: .spec.minMember
30+
name: MinMember
31+
type: integer
32+
- description: The number of actively running pods.
33+
jsonPath: .status.running
34+
name: Running
35+
type: integer
36+
- description: The number of pods which reached phase Succeeded.
37+
jsonPath: .status.succeeded
38+
name: Succeeded
39+
type: integer
40+
- description: The number of pods which reached phase Failed.
41+
jsonPath: .status.failed
42+
name: Failed
43+
type: integer
44+
- description: Age is the time PodGroup was created.
45+
jsonPath: .metadata.creationTimestamp
46+
name: Age
47+
type: date
48+
name: v1alpha1
2349
schema:
2450
openAPIV3Schema:
2551
description: PodGroup is a collection of Pod; used for batch workload.

manifests/capacityscheduling/crd.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,21 @@ spec:
1919
singular: elasticquota
2020
scope: Namespaced
2121
versions:
22-
- name: v1alpha1
22+
- additionalPrinterColumns:
23+
- description: Used is the current observed total usage of the resource in the
24+
namespace.
25+
jsonPath: .status.used
26+
name: Used
27+
type: string
28+
- description: Max is the set of desired max limits for each named resource.
29+
jsonPath: .spec.max
30+
name: Max
31+
type: string
32+
- description: Age is the time ElasticQuota was created.
33+
jsonPath: .metadata.creationTimestamp
34+
name: Age
35+
type: date
36+
name: v1alpha1
2337
schema:
2438
openAPIV3Schema:
2539
description: ElasticQuota sets elastic quota restrictions per namespace

manifests/coscheduling/crd.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,33 @@ spec:
1919
singular: podgroup
2020
scope: Namespaced
2121
versions:
22-
- name: v1alpha1
22+
- additionalPrinterColumns:
23+
- description: Current phase of PodGroup.
24+
jsonPath: .status.phase
25+
name: Phase
26+
type: string
27+
- description: MinMember defines the minimal number of members/tasks to run the
28+
pod group.
29+
jsonPath: .spec.minMember
30+
name: MinMember
31+
type: integer
32+
- description: The number of actively running pods.
33+
jsonPath: .status.running
34+
name: Running
35+
type: integer
36+
- description: The number of pods which reached phase Succeeded.
37+
jsonPath: .status.succeeded
38+
name: Succeeded
39+
type: integer
40+
- description: The number of pods which reached phase Failed.
41+
jsonPath: .status.failed
42+
name: Failed
43+
type: integer
44+
- description: Age is the time PodGroup was created.
45+
jsonPath: .metadata.creationTimestamp
46+
name: Age
47+
type: date
48+
name: v1alpha1
2349
schema:
2450
openAPIV3Schema:
2551
description: PodGroup is a collection of Pod; used for batch workload.

0 commit comments

Comments
 (0)