koord-descheduler: implement PodMigrationJob controller#404
Conversation
d10bd99 to
9e221e9
Compare
|
/hold |
8e78e9f to
f1e46cb
Compare
Codecov Report
@@ Coverage Diff @@
## main #404 +/- ##
==========================================
+ Coverage 67.75% 67.87% +0.11%
==========================================
Files 134 137 +3
Lines 14313 14912 +599
==========================================
+ Hits 9698 10121 +423
- Misses 3900 4043 +143
- Partials 715 748 +33
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
f1e46cb to
b8338b7
Compare
|
/hold cancel |
50a9e92 to
367eb47
Compare
367eb47 to
25f3c62
Compare
|
/hold |
25f3c62 to
5af06db
Compare
|
test with Koordinator Reservation API
apiVersion: scheduling.koordinator.sh/v1alpha1
kind: PodMigrationJob
metadata:
name: test
spec:
paused: false
ttl: 30m
mode: ReservationFirst
podRef:
namespace: default
name: curlimage-78d676778d-r585h
status:
phase: Pending
$ kubectl get podmigrationjob test
NAME PHASE STATUS AGE NODE RESERVATION PODNAMESPACE POD NEWPOD TTL
test Succeed Complete 14m cn-hangzhou.192.168.0.35 12260bab-72b9-48bd-9266-3d090d65ccf3 default curlimage-78d676778d-r585h curlimage-78d676778d-d27n7 30m0s
$ kubectl describe podmigrationjob test
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ReservationCreated 15m koord-descheduler Successfully create Reservation "12260bab-72b9-48bd-9266-3d090d65ccf3"
Normal ReservationScheduled 15m koord-descheduler Assigned Reservation "12260bab-72b9-48bd-9266-3d090d65ccf3" to node "cn-hangzhou.192.168.0.35"
Normal Evicting 15m koord-descheduler Try to evict Pod "default/curlimage-78d676778d-r585h"
Normal EvictComplete 15m koord-descheduler Pod "default/curlimage-78d676778d-r585h" has been evicted
Normal Complete 15m koord-descheduler Bind Pod "default/curlimage-78d676778d-d27n7" in Reservation "12260bab-72b9-48bd-9266-3d090d65ccf3"
$ kubectl get podmigrationjob test -o yaml
apiVersion: scheduling.koordinator.sh/v1alpha1
kind: PodMigrationJob
metadata:
creationTimestamp: "2022-08-02T04:05:47Z"
generation: 2
name: test
resourceVersion: "46054312"
uid: 12260bab-72b9-48bd-9266-3d090d65ccf3
spec:
mode: ReservationFirst
podRef:
name: curlimage-78d676778d-r585h
namespace: default
reservationOptions:
reservationRef:
name: 12260bab-72b9-48bd-9266-3d090d65ccf3
uid: d182c8d8-a599-4579-ac32-e5184aa6bde2
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/created-by: koord-descheduler
name: 12260bab-72b9-48bd-9266-3d090d65ccf3
namespace: default
spec:
owners:
- controller:
apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: ReplicaSet
name: curlimage-78d676778d
namespace: default
uid: 6cd097a1-0029-4743-b987-12e03ef54161
template:
# ... PodTemplateSpec
ttl: 30m0s
ttl: 30m0s
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2022-08-02T04:05:46Z"
status: "True"
type: ReservationCreated
- lastProbeTime: null
lastTransitionTime: "2022-08-02T04:05:46Z"
status: "True"
type: ReservationScheduled
- lastProbeTime: null
lastTransitionTime: "2022-08-02T04:06:19Z"
reason: EvictComplete
status: "True"
type: Eviction
- lastProbeTime: null
lastTransitionTime: "2022-08-02T04:06:20Z"
message: Bind Pod "default/curlimage-78d676778d-d27n7" in Reservation "12260bab-72b9-48bd-9266-3d090d65ccf3"
status: "True"
type: PodBoundReservation
message: Bind Pod "default/curlimage-78d676778d-d27n7" in Reservation "12260bab-72b9-48bd-9266-3d090d65ccf3"
nodeName: cn-hangzhou.192.168.0.35
phase: Succeed
podRef:
name: curlimage-78d676778d-d27n7
namespace: default
uid: bf04f31f-254f-4c0f-af0b-1a262362857c
status: Complete |
5af06db to
9eb8a38
Compare
|
/hold cancel |
9eb8a38 to
9f0e8ce
Compare
pkg/descheduler/controllers/migration/evictor/evictor_native.go
Outdated
Show resolved
Hide resolved
FYI: docs/proposals/scheduling/20220701-pod-migration-job.md Signed-off-by: Joseph <joseph.t.lee@outlook.com>
9f0e8ce to
15e5e8c
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hormes The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Joseph joseph.t.lee@outlook.com
Ⅰ. Describe what this PR does
The current version implements simple reservation-based migration capabilities. In the future versions implement the PodMigrationJob arbitration mechanism.
Ⅱ. Does this pull request fix one issue?
implement #196 #214
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews
V. Checklist
make test