Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit 527ccb1

Browse files
authored
Merge pull request #871 from thandayuthapani/queue
Add v1alpha2 Version for queue
2 parents 2533e97 + 10b96b8 commit 527ccb1

File tree

22 files changed

+976
-29
lines changed

22 files changed

+976
-29
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: queues.scheduling.sigs.dev
5+
spec:
6+
group: scheduling.sigs.dev
7+
names:
8+
kind: Queue
9+
plural: queues
10+
scope: Cluster
11+
validation:
12+
openAPIV3Schema:
13+
properties:
14+
apiVersion:
15+
type: string
16+
kind:
17+
type: string
18+
metadata:
19+
type: object
20+
spec:
21+
properties:
22+
weight:
23+
format: int32
24+
type: integer
25+
type: object
26+
status:
27+
properties:
28+
unknown:
29+
format: int32
30+
type: integer
31+
pending:
32+
format: int32
33+
type: integer
34+
running:
35+
format: int32
36+
type: integer
37+
type: object
38+
type: object
39+
version: v1alpha2
40+
subresources:
41+
status: {}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
apiVersion: apiextensions.k8s.io/v1beta1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
name: queues.scheduling.sigs.dev
5+
spec:
6+
group: scheduling.sigs.dev
7+
names:
8+
kind: Queue
9+
plural: queues
10+
scope: Cluster
11+
validation:
12+
openAPIV3Schema:
13+
properties:
14+
apiVersion:
15+
type: string
16+
kind:
17+
type: string
18+
metadata:
19+
type: object
20+
spec:
21+
properties:
22+
weight:
23+
format: int32
24+
type: integer
25+
type: object
26+
status:
27+
properties:
28+
unknown:
29+
format: int32
30+
type: integer
31+
pending:
32+
format: int32
33+
type: integer
34+
running:
35+
format: int32
36+
type: integer
37+
type: object
38+
type: object
39+
version: v1alpha2

hack/run-e2e-kind.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function kube-batch-up {
7272
kubectl create -f deployment/kube-batch/templates/scheduling_v1alpha1_queue.yaml
7373
kubectl create -f deployment/kube-batch/templates/scheduling_v1alpha1_podgroup.yaml
7474
kubectl create -f deployment/kube-batch/templates/scheduling_v1alpha2_podgroup.yaml
75+
kubectl create -f deployment/kube-batch/templates/scheduling_v1alpha2_queue.yaml
7576
kubectl create -f deployment/kube-batch/templates/default.yaml
7677

7778
# start kube-batch
@@ -87,4 +88,3 @@ kube-batch-up
8788

8889
cd ${ROOT_DIR}
8990
go test ./test/e2e -v -timeout 30m
90-

pkg/apis/scheduling/v1alpha2/register.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
4848
scheme.AddKnownTypes(SchemeGroupVersion,
4949
&PodGroup{},
5050
&PodGroupList{},
51+
&Queue{},
52+
&QueueList{},
5153
)
5254

5355
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)

pkg/apis/scheduling/v1alpha2/types.go

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,55 @@ type PodGroupList struct {
160160
// items is the list of PodGroup
161161
Items []PodGroup `json:"items" protobuf:"bytes,2,rep,name=items"`
162162
}
163+
164+
// +genclient
165+
// +genclient:nonNamespaced
166+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
167+
168+
// Queue is a queue of PodGroup.
169+
type Queue struct {
170+
metav1.TypeMeta `json:",inline"`
171+
// Standard object's metadata.
172+
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
173+
// +optional
174+
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
175+
176+
// Specification of the desired behavior of the queue.
177+
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status
178+
// +optional
179+
Spec QueueSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
180+
181+
// The status of queue.
182+
// +optional
183+
Status QueueStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
184+
}
185+
186+
// QueueStatus represents the status of Queue.
187+
type QueueStatus struct {
188+
// The number of 'Unknonw' PodGroup in this queue.
189+
Unknown int32 `json:"unknown,omitempty" protobuf:"bytes,1,opt,name=unknown"`
190+
// The number of 'Pending' PodGroup in this queue.
191+
Pending int32 `json:"pending,omitempty" protobuf:"bytes,2,opt,name=pending"`
192+
// The number of 'Running' PodGroup in this queue.
193+
Running int32 `json:"running,omitempty" protobuf:"bytes,3,opt,name=running"`
194+
}
195+
196+
// QueueSpec represents the template of Queue.
197+
type QueueSpec struct {
198+
Weight int32 `json:"weight,omitempty" protobuf:"bytes,1,opt,name=weight"`
199+
Capability v1.ResourceList `json:"capability,omitempty" protobuf:"bytes,2,opt,name=capability"`
200+
}
201+
202+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
203+
204+
// QueueList is a collection of queues.
205+
type QueueList struct {
206+
metav1.TypeMeta `json:",inline"`
207+
// Standard list metadata
208+
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
209+
// +optional
210+
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
211+
212+
// items is the list of PodGroup
213+
Items []Queue `json:"items" protobuf:"bytes,2,rep,name=items"`
214+
}

pkg/apis/scheduling/v1alpha2/zz_generated.deepcopy.go

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)