Skip to content

Commit e507fca

Browse files
committed
Add priorityClassName to initializer/starter/runner pods
1 parent 70397c0 commit e507fca

File tree

6 files changed

+32
-1
lines changed

6 files changed

+32
-1
lines changed

api/v1alpha1/testrun_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ type Pod struct {
5252
InitContainers []InitContainer `json:"initContainers,omitempty"`
5353
Volumes []corev1.Volume `json:"volumes,omitempty"`
5454
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
55+
PriorityClassName string `json:"priorityClassName,omitempty"`
5556
}
5657

5758
type InitContainer struct {

config/crd/bases/k6.io_testruns.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,8 @@ spec:
892892
additionalProperties:
893893
type: string
894894
type: object
895+
priorityClassName:
896+
type: string
895897
readinessProbe:
896898
properties:
897899
exec:
@@ -2839,6 +2841,8 @@ spec:
28392841
additionalProperties:
28402842
type: string
28412843
type: object
2844+
priorityClassName:
2845+
type: string
28422846
readinessProbe:
28432847
properties:
28442848
exec:
@@ -4807,6 +4811,8 @@ spec:
48074811
additionalProperties:
48084812
type: string
48094813
type: object
4814+
priorityClassName:
4815+
type: string
48104816
readinessProbe:
48114817
properties:
48124818
exec:

docs/crd-generated.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,13 @@ alive or ready to receive traffic.<br/>
932932
<br/>
933933
</td>
934934
<td>false</td>
935+
</tr><tr>
936+
<td><b>priorityClassName</b></td>
937+
<td>string</td>
938+
<td>
939+
<br/>
940+
</td>
941+
<td>false</td>
935942
</tr><tr>
936943
<td><b><a href="#testrunspecinitializerreadinessprobe">readinessProbe</a></b></td>
937944
<td>object</td>
@@ -9483,6 +9490,13 @@ alive or ready to receive traffic.<br/>
94839490
<br/>
94849491
</td>
94859492
<td>false</td>
9493+
</tr><tr>
9494+
<td><b>priorityClassName</b></td>
9495+
<td>string</td>
9496+
<td>
9497+
<br/>
9498+
</td>
9499+
<td>false</td>
94869500
</tr><tr>
94879501
<td><b><a href="#testrunspecrunnerreadinessprobe">readinessProbe</a></b></td>
94889502
<td>object</td>
@@ -18056,6 +18070,13 @@ alive or ready to receive traffic.<br/>
1805618070
<br/>
1805718071
</td>
1805818072
<td>false</td>
18073+
</tr><tr>
18074+
<td><b>priorityClassName</b></td>
18075+
<td>string</td>
18076+
<td>
18077+
<br/>
18078+
</td>
18079+
<td>false</td>
1805918080
</tr><tr>
1806018081
<td><b><a href="#testrunspecstarterreadinessprobe">readinessProbe</a></b></td>
1806118082
<td>object</td>

pkg/resources/jobs/initializer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ func NewInitializerJob(k6 *v1alpha1.TestRun, argLine string) (*batchv1.Job, erro
128128
SecurityContext: &k6.GetSpec().Initializer.ContainerSecurityContext,
129129
},
130130
},
131-
Volumes: volumes,
131+
Volumes: volumes,
132+
PriorityClassName: k6.GetSpec().Initializer.PriorityClassName,
132133
},
133134
},
134135
},

pkg/resources/jobs/runner.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ func NewRunnerJob(k6 *v1alpha1.TestRun, index int, tokenInfo *cloud.TokenInfo) (
202202
}},
203203
TerminationGracePeriodSeconds: &zero,
204204
Volumes: volumes,
205+
PriorityClassName: k6.GetSpec().Runner.PriorityClassName,
205206
},
206207
},
207208
},

pkg/resources/jobs/starter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func NewStarterJob(k6 *v1alpha1.TestRun, hostname []string) *batchv1.Job {
9696
resourceRequirements,
9797
),
9898
},
99+
PriorityClassName: k6.GetSpec().Starter.PriorityClassName,
99100
},
100101
},
101102
},

0 commit comments

Comments
 (0)