From 19127d8fa4fe3e82cb97aa9ad41b4317475a719a Mon Sep 17 00:00:00 2001 From: Morgan Wattiez Date: Fri, 28 Jan 2022 12:22:21 +0100 Subject: [PATCH] Fix #227 support for priority classes - Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ --- templates/core-statefulset.yaml | 3 +++ templates/readreplicas-statefulset.yaml | 3 +++ values.yaml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/templates/core-statefulset.yaml b/templates/core-statefulset.yaml index 306db322..768ca950 100644 --- a/templates/core-statefulset.yaml +++ b/templates/core-statefulset.yaml @@ -182,6 +182,9 @@ spec: {{- end }} securityContext: {{ toYaml .Values.securityContext | indent 8 }} +{{- if .Values.priorityClassName }} + priorityClassName: "{{ .Values.priorityClassName }}" +{{- end }} volumes: - name: init-script configMap: diff --git a/templates/readreplicas-statefulset.yaml b/templates/readreplicas-statefulset.yaml index ba3bb80e..957beea1 100644 --- a/templates/readreplicas-statefulset.yaml +++ b/templates/readreplicas-statefulset.yaml @@ -186,6 +186,9 @@ spec: {{- end }} securityContext: {{ toYaml .Values.securityContext | indent 8 }} +{{- if .Values.priorityClassName }} + priorityClassName: "{{ .Values.priorityClassName }}" +{{- end }} volumes: - name: init-script configMap: diff --git a/values.yaml b/values.yaml index 6692d400..2e44687a 100644 --- a/values.yaml +++ b/values.yaml @@ -342,6 +342,10 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 7474 +## Priority for pod scheduling +## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ +priorityClassName: "" + containerSecurityContext: {} # Sets securityContext at the container level. # We recommend to only use this if (pod) securityContext cannot be used. For example certain security options can only be set at this level.