Skip to content

Commit 397e521

Browse files
fix(workflows): add clusterpolicy for low priority workflows
1 parent 57f2d54 commit 397e521

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

charts/workflows/templates/workloadpriority-clusterpolicy.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,26 @@ spec:
5151
labels:
5252
kueue.x-k8s.io/queue-name: default-queue
5353
kueue.x-k8s.io/priority-class: high
54+
55+
- name: low-workload-priority
56+
match:
57+
any:
58+
- resources:
59+
kinds:
60+
- argoproj.io/*/Workflow
61+
annotations:
62+
workflows.diamond.ac.uk/type: "test"
63+
operations:
64+
- CREATE
65+
preconditions:
66+
all:
67+
- key: "{{ `{{ request.object.spec.podMetadata.labels.\"kueue.x-k8s.io/priority-class\" || '' }}` }}"
68+
operator: Equals
69+
value: ""
70+
mutate:
71+
patchStrategicMerge:
72+
spec:
73+
podMetadata:
74+
labels:
75+
kueue.x-k8s.io/queue-name: default-queue
76+
kueue.x-k8s.io/priority-class: low

charts/workflows/test-policy/workloadpriorityclass/chainsaw-test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,23 @@ spec:
6363
labels:
6464
kueue.x-k8s.io/queue-name: default-queue
6565
kueue.x-k8s.io/priority-class: high
66+
- apply:
67+
resource:
68+
apiVersion: argoproj.io/v1alpha1
69+
kind: Workflow
70+
metadata:
71+
name: test
72+
annotations:
73+
workflows.diamond.ac.uk/type: "test"
74+
spec: {}
75+
- assert:
76+
resource:
77+
apiVersion: argoproj.io/v1alpha1
78+
kind: Workflow
79+
metadata:
80+
name: test
81+
spec:
82+
podMetadata:
83+
labels:
84+
kueue.x-k8s.io/queue-name: default-queue
85+
kueue.x-k8s.io/priority-class: low

0 commit comments

Comments
 (0)