Closed JesseStutler closed 3 weeks ago
/assign @hwdef @Monokaix @lowang-bh Please take a look~
Create two jobs, job-a and job-b, where the PriorityClass specified by job-b has a higher priority than the PriorityClass specified by job-a, but the PriorityClass specified by job-b comes with PreemptionPolicy: Never
.
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 200
preemptionPolicy: Never
The Pod created by job-b does not specify a PriorityClassName
, so the PriorityClass specified by job is used.:
The Pod created by job-b fails to preempt because PreemptionPolicy is set to true::
Create two jobs, job-a and job-c, job-c has a specified PriorityClass without the PreemptionPolicy
field, but the task has a different PriorityClass with the PreemptionPolicy
field specified, and job-a remains unchanged.
job-c yaml:
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority
value: 200
---
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: cover
value: 200
preemptionPolicy: Never
---
apiVersion: batch.volcano.sh/v1alpha1
kind: Job
metadata:
name: job-c
spec:
schedulerName: volcano
minAvailable: 4
priorityClassName: high-priority
tasks:
- replicas: 4
name: "test"
template:
spec:
priorityClassName: cover
containers:
- image: alpine
command: ["/bin/sh", "-c", "sleep 6000"]
imagePullPolicy: IfNotPresent
name: running
resources:
requests:
cpu: 3900m
restartPolicy: OnFailure
The PriorityClassName specified by job-c's pod is the task template's Preemption failure log:
Submit two jobs, one job-a and one job-b, in two separate queues, first submit job-a to fill up the cluster resources, then submit job-b, job-a needs to reclaim half of the resources to job-b, but because the PriorityClass specified by job-b specifies PreemptionPolicy
as Never, job-a cannot reclaim job-a's resources, so job-b's pod all are pending.
/cc @Monokaix
/lgtm
/ok-to-test
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Monokaix
The full list of commands accepted by this bot can be found here.
The pull request process is described here
ref: #3642 ,#3738