Skip to content

[BUG] When the default PriorityClass's PreemptionPolicy is Never, juicefs fails to create delvol job #1421

@leef627

Description

@leef627

What happened:
When the cluster is configured with the default PriorityClass and the PriorityClass's PreemptionPolicy is not PreemptLowerPriority, creating a job will result in an error message: error creating: pods "juicefs-94e7e571-delvol-" is forbidden: the string value of PreemptionPolicy (PreemptLowerPriority) must not be provided in pod spec; priority admission controller computed Never from the given PriorityClass name

What you expected to happen:
The job should be created successfully

How to reproduce it (as minimally and precisely as possible):
Create a PriorityClass with a preemptionPolicy of Never

apiVersion: scheduling.k8s.io/v1
globalDefault: true
description: Priority for default level.
kind: PriorityClass
metadata:
  generation: 1
  name: default
preemptionPolicy: Never
value: 101

Create and then delete a pvc
Check whether the delvol job is created successfully

Anything else we need to know?
I think we should add a line podTemplate.Spec.PreemptionPolicy = nil after podTemplate.Spec.PriorityClassName = "" in pkg/juicefs/mount/builder/job.go in order to set the job's PreemptionPolicy to empty

Environment:

  • JuiceFS CSI Driver version (which image tag did your CSI Driver use):v0.30.0
  • Kubernetes version (e.g. kubectl version):v1.30.9
  • Object storage (cloud provider and region):ceph rados
  • Metadata engine info (version, cloud provider managed or self maintained):tikv
  • Network connectivity (JuiceFS to metadata engine, JuiceFS to object storage):lan
  • Others:

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions