Skip to content

Commit d9c40a5

Browse files
authored
apis: add reservation name, taints and tolerations in ReservationAffinitty (#2186)
Signed-off-by: 佑祎 <zzw261520@alibaba-inc.com>
1 parent 7a1559b commit d9c40a5

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

apis/extension/reservation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ type ReservationAllocated struct {
5757

5858
// ReservationAffinity represents the constraints of Pod selection Reservation
5959
type ReservationAffinity struct {
60+
// Specifies the reservation name directly, other reservation affinity fields will be ignored.
61+
Name string `json:"name,omitempty"`
6062
// If the affinity requirements specified by this field are not met at
6163
// scheduling time, the pod will not be scheduled onto the node.
6264
// If the affinity requirements specified by this field cease to be met
@@ -66,6 +68,8 @@ type ReservationAffinity struct {
6668
// ReservationSelector is a selector which must be true for the pod to fit on a reservation.
6769
// Selector which must match a reservation's labels for the pod to be scheduled on that node.
6870
ReservationSelector map[string]string `json:"reservationSelector,omitempty"`
71+
// Specifies the pod's reservation tolerations. This can tolerate taints of Reservation.
72+
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
6973
}
7074

7175
// ReservationAffinitySelector represents the union of the results of one or more label queries

apis/scheduling/v1alpha1/reservation_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ type ReservationSpec struct {
6969
// Unschedulable controls reservation schedulability of new pods. By default, reservation is schedulable.
7070
// +optional
7171
Unschedulable bool `json:"unschedulable,omitempty"`
72+
// Specifies the reservation's taints. This can be toleranted by the reservation tolerance.
73+
// Eviction is not supported for NoExecute taints
74+
// +optional
75+
Taints []corev1.Taint `json:"taints,omitempty"`
7276
}
7377

7478
type ReservationAllocatePolicy string

apis/scheduling/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/scheduling.koordinator.sh_reservations.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,38 @@ spec:
232232
When `preAllocation` is set, the scheduler will skip this validation and allow overcommitment. The scheduled
233233
reservation would be waiting to be available until free resources are sufficient.
234234
type: boolean
235+
taints:
236+
description: |-
237+
Specifies the reservation's taints. This can be toleranted by the reservation tolerance.
238+
Eviction is not supported for NoExecute taints
239+
items:
240+
description: |-
241+
The node this Taint is attached to has the "effect" on
242+
any pod that does not tolerate the Taint.
243+
properties:
244+
effect:
245+
description: |-
246+
Required. The effect of the taint on pods
247+
that do not tolerate the taint.
248+
Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
249+
type: string
250+
key:
251+
description: Required. The taint key to be applied to a node.
252+
type: string
253+
timeAdded:
254+
description: |-
255+
TimeAdded represents the time at which the taint was added.
256+
It is only written for NoExecute taints.
257+
format: date-time
258+
type: string
259+
value:
260+
description: The taint value corresponding to the taint key.
261+
type: string
262+
required:
263+
- effect
264+
- key
265+
type: object
266+
type: array
235267
template:
236268
description: |-
237269
Template defines the scheduling requirements (resources, affinities, images, ...) processed by the scheduler just

0 commit comments

Comments
 (0)