Skip to content

Commit c64d55f

Browse files
rewantsoniarttor
authored andcommitted
add priorityClassName to the test data
Signed-off-by: Rewant Soni <resoni@redhat.com>
1 parent 9a39a82 commit c64d55f

7 files changed

Lines changed: 12 additions & 1 deletion

File tree

examples/app/templates/cron-job.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ spec:
2323
name: hello
2424
resources: {}
2525
nodeSelector: {{- toYaml .Values.cronJob.nodeSelector | nindent 12 }}
26+
priorityClassName: {{ .Values.cronJob.priorityClassName }}
2627
restartPolicy: OnFailure
2728
serviceAccountName: {{ include "app.serviceAccountName" . }}
2829
tolerations: {{- toYaml .Values.cronJob.tolerations | nindent 12 }}

examples/app/templates/daemonset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ spec:
3333
name: varlibdockercontainers
3434
readOnly: true
3535
nodeSelector: {{- toYaml .Values.fluentdElasticsearch.nodeSelector | nindent 8 }}
36+
priorityClassName: {{ .Values.fluentdElasticsearch.priorityClassName }}
3637
serviceAccountName: {{ include "app.serviceAccountName" . }}
3738
terminationGracePeriodSeconds: 30
3839
tolerations: {{- toYaml .Values.fluentdElasticsearch.tolerations | nindent 8 }}

examples/app/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ spec:
9696
name: init-container
9797
resources: {}
9898
nodeSelector: {{- toYaml .Values.myapp.nodeSelector | nindent 8 }}
99+
priorityClassName: {{ .Values.myapp.priorityClassName }}
99100
securityContext: {{- toYaml .Values.myapp.podSecurityContext | nindent 8 }}
100101
serviceAccountName: {{ include "app.serviceAccountName" . }}
101102
terminationGracePeriodSeconds: 10

examples/app/templates/statefulset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ spec:
3030
- mountPath: /usr/share/nginx/html
3131
name: www
3232
nodeSelector: {{- toYaml .Values.web.nodeSelector | nindent 8 }}
33+
priorityClassName: {{ .Values.web.priorityClassName }}
3334
serviceAccountName: {{ include "app.serviceAccountName" . }}
3435
tolerations: {{- toYaml .Values.web.tolerations | nindent 8 }}
3536
topologySpreadConstraints: {{- toYaml .Values.web.topologySpreadConstraints |

examples/app/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cronJob:
1414
tag: "1.28"
1515
imagePullPolicy: IfNotPresent
1616
nodeSelector: {}
17+
priorityClassName: low-priority
1718
schedule: '* * * * *'
1819
tolerations: []
1920
topologySpreadConstraints: []
@@ -29,6 +30,7 @@ fluentdElasticsearch:
2930
cpu: 100m
3031
memory: 200Mi
3132
nodeSelector: {}
33+
priorityClassName: system-node-critical
3234
tolerations:
3335
- effect: NoSchedule
3436
key: node-role.kubernetes.io/master
@@ -99,6 +101,7 @@ myapp:
99101
fsGroup: 20000
100102
runAsNonRoot: true
101103
runAsUser: 65532
104+
priorityClassName: system-cluster-critical
102105
proxySidecar:
103106
args:
104107
- --secure-listen-address=0.0.0.0:8443
@@ -152,6 +155,7 @@ web:
152155
repository: registry.k8s.io/nginx-slim
153156
tag: "0.8"
154157
nodeSelector: {}
158+
priorityClassName: high-priority
155159
replicas: 2
156160
tolerations: []
157161
topologySpreadConstraints: []

pkg/processor/pod/pod.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ func ProcessSpec(objName string, appMeta helmify.AppMetadata, spec corev1.PodSpe
115115
}
116116
}
117117

118-
// process priorityClassName if presented:
119118
if spec.PriorityClassName != "" {
120119
err = unstructured.SetNestedField(specMap, fmt.Sprintf(`{{ .Values.%s.priorityClassName }}`, objName), "priorityClassName")
121120
if err != nil {

test_data/sample-app.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ spec:
101101
- matchExpressions:
102102
- key: node-role.kubernetes.io/control-plane
103103
operator: Exists
104+
priorityClassName: system-cluster-critical
104105
terminationGracePeriodSeconds: 10
105106
volumes:
106107
- configMap:
@@ -278,6 +279,7 @@ spec:
278279
labels:
279280
name: fluentd-elasticsearch
280281
spec:
282+
priorityClassName: system-node-critical
281283
tolerations:
282284
# this toleration is to have the daemonset runnable on master nodes
283285
# remove it if your masters can't run pods
@@ -332,6 +334,7 @@ spec:
332334
spec:
333335
template:
334336
spec:
337+
priorityClassName: low-priority
335338
containers:
336339
- name: hello
337340
image: busybox:1.28
@@ -371,6 +374,7 @@ spec:
371374
labels:
372375
app: nginx
373376
spec:
377+
priorityClassName: high-priority
374378
containers:
375379
- name: nginx
376380
image: registry.k8s.io/nginx-slim:0.8

0 commit comments

Comments
 (0)