Skip to content

Commit 8050b82

Browse files
authored
Update README.md
Modify some description. Mainly BindingGates
1 parent 3ada14c commit 8050b82

File tree

1 file changed

+15
-12
lines changed
  • keps/sig-scheduling/5007-device-attach-before-pod-scheduled

1 file changed

+15
-12
lines changed

keps/sig-scheduling/5007-device-attach-before-pod-scheduled/README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ Items marked with (R) are required *prior to targeting to a milestone / release*
167167
## Summary
168168

169169
To achieve efficient management of fabric devices, we propose adding the following features to the Kubernetes scheduler's DRA plugin.
170-
Fabric devices are those that are not directly connected to the server and require attachment to the server for use.
170+
A fabric device is a device that is placed outside the server via a PCIe or CXL switch.
171+
In order to use this device from K8s, we need to control the switch to connect a specific device to a specific physical server.
171172

172173
In the current DRA implementation, fabric devices are attached after the scheduling decision, which leads to the following issue:
173174

@@ -380,6 +381,12 @@ type BasicDevice struct {
380381
//
381382
// +optional
382383
UsageRestrictedToNode bool
384+
385+
// BindingTimeout indicates the prepare timeout period.
386+
// If the timeout period is exceeded, the scheduler clears the allocation in the ResourceClaim and reschedules the Pod.
387+
//
388+
// +optional
389+
BindingTimeout int
383390
}
384391
```
385392

@@ -417,16 +424,15 @@ If Gates are present, the scheduler DRA plugin will perform the following steps
417424

418425
2. **Copy Gates**: Copy `BindingGates` and `BindingFailureGates` from `ResourceSlice.Device.Basic` to `AllocatedDeviceStatus`.
419426
3. **Wait for Conditions**: Wait for the following conditions:
420-
- If `NeedToPreparing` is `True`, wait until `IsPrepared` is `True` before proceeding to Bind.
421-
- If `PreparingFailed` is `True`, clear the allocation in the `ResourceClaim` and reschedule the Pod.
422-
- If the preparation takes longer than the `PreparingTimeout` period, clear the allocation in the `ResourceClaim` and reschedule the Pod.
427+
- Wait until all conditions in the BindingGates are `True` before proceeding to Bind.
428+
- If any one of the conditions in the BindingFailureGates becomes `True`, clear the allocation in the `ResourceClaim` and reschedule the Pod.
429+
- If the preparation of a device takes longer than the `BindingTimeout` period, clear the allocation in the `ResourceClaim` and reschedule the Pod.
423430

424-
To support these steps, the following keys are defined:
431+
To support these steps, for example, a DRA driver can include the following definitions in BindingGates or BindingFailureGates within a ResourceSlice:
425432

426433
```go
427434
const (
428435
// NeedToPreparing indicates that this device needs some preparation.
429-
// If this flag is True, the scheduler waits in PreBind.
430436
NeedToPreparing = "kubernetes.io/need-to-preparing"
431437

432438
// IsPrepared indicates the device ready state.
@@ -436,10 +442,6 @@ const (
436442
// PreparingFailed indicates the device preparation failed state.
437443
// If PreparingFailed is True, the scheduler will clear the allocation in the ResourceClaim and reschedule the Pod.
438444
PreparingFailed = "kubernetes.io/preparing-failed"
439-
440-
// PreparingTimeout indicates the prepare timeout period.
441-
// If the timeout period is exceeded, the scheduler clears the allocation in the ResourceClaim and reschedules the Pod.
442-
PreparingTimeout = "kubernetes.io/preparing-timeout"
443445
)
444446
```
445447

@@ -451,7 +453,8 @@ This issue will be addressed separately as outlined in kubernetes/kubernetes#129
451453
#### PreBind Phase Timeout
452454

453455
If the device attachment is successful, we expect it to take no longer than 5 minutes.
454-
However, to account for potential update lags, we would like to set a fixed timeout for the scheduler to 10 minutes.
456+
However, to account for potential update lags, we can set a timeout in the ResourceSlice.
457+
if it's not present in the ResourceSlice, the scheduler has 10 minutes as the default timeout.
455458

456459
Even if the conditions indicating that the device is attached or that the attachment failed are not updated, setting a timeout will prevent the scheduler from waiting indefinitely in the PreBind phase.
457460

@@ -764,7 +767,7 @@ well as the [existing list] of feature gates.
764767
-->
765768

766769
- [x] Feature gate (also fill in values in `kep.yaml`)
767-
- Feature gate name: DRADeviceAttachDuringScheduling
770+
- Feature gate name: DRAPrebindingGates
768771
- Components depending on the feature gate: kube-scheduler
769772
- [ ] Other
770773
- Describe the mechanism:

0 commit comments

Comments
 (0)