File tree 5 files changed +23
-9
lines changed
5 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,13 @@ Create a pod service account name.
38
38
{ { default (printf " %s-%v" (include " postgres-operator.fullname" .) " pod" ) .Values.podServiceAccount.name } }
39
39
{ {- end -} }
40
40
41
+ { {/*
42
+ Create a pod priority class name.
43
+ */} }
44
+ { {- define " postgres-pod.priorityClassName" -} }
45
+ { { default (printf " %s-%v" (include " postgres-operator.fullname" .) " pod" ) .Values.podPriorityClassName.name } }
46
+ { {- end -} }
47
+
41
48
{ {/*
42
49
Create a controller ID.
43
50
*/} }
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ metadata:
10
10
app.kubernetes.io/managed-by : {{ .Release.Service }}
11
11
app.kubernetes.io/instance : {{ .Release.Name }}
12
12
data :
13
- {{- if .Values.podPriorityClassName }}
14
- pod_priority_class_name : {{ .Values.podPriorityClassName }}
15
- {{- end }}
13
+ {{- if or .Values.podPriorityClassName.create .Values.podPriorityClassName.name }}
14
+ pod_priority_class_name : {{ include "postgres-pod.priorityClassName" . }}
15
+ {{- end }}
16
16
pod_service_account_name : {{ include "postgres-pod.serviceAccountName" . }}
17
17
{{- include "flattenValuesForConfigMap" .Values.configGeneral | indent 2 }}
18
18
{{- include "flattenValuesForConfigMap" .Values.configUsers | indent 2 }}
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ configuration:
16
16
major_version_upgrade :
17
17
{{ toYaml .Values.configMajorVersionUpgrade | indent 4 }}
18
18
kubernetes :
19
- {{- if .Values.podPriorityClassName }}
20
- pod_priority_class_name : {{ .Values.podPriorityClassName }}
19
+ {{- if .Values.podPriorityClassName.name }}
20
+ pod_priority_class_name : {{ .Values.podPriorityClassName.name }}
21
21
{{- end }}
22
22
pod_service_account_name : {{ include "postgres-pod.serviceAccountName" . }}
23
23
oauth_token_secret_name : {{ template "postgres-operator.fullname" . }}
Original file line number Diff line number Diff line change 1
- {{- if .Values.podPriorityClassName }}
1
+ {{- if .Values.podPriorityClassName.create }}
2
2
apiVersion : scheduling.k8s.io/v1
3
3
description : ' Use only for databases controlled by Postgres operator'
4
4
kind : PriorityClass
@@ -8,9 +8,9 @@ metadata:
8
8
helm.sh/chart : {{ template "postgres-operator.chart" . }}
9
9
app.kubernetes.io/managed-by : {{ .Release.Service }}
10
10
app.kubernetes.io/instance : {{ .Release.Name }}
11
- name : {{ .Values.podPriorityClassName }}
11
+ name : {{ include "postgres-pod.priorityClassName" . }}
12
12
namespace : {{ .Release.Namespace }}
13
13
preemptionPolicy : PreemptLowerPriority
14
14
globalDefault : false
15
- value : 1000000
15
+ value : {{ .Values.podPriorityClassName.priority }}
16
16
{{- end }}
Original file line number Diff line number Diff line change @@ -468,7 +468,14 @@ podServiceAccount:
468
468
priorityClassName : " "
469
469
470
470
# priority class for database pods
471
- podPriorityClassName : " "
471
+ podPriorityClassName :
472
+ # If create is false with no name set, no podPriorityClassName is specified.
473
+ # Hence, the pod priorityClass is the one with globalDefault set.
474
+ # If there is no PriorityClass with globalDefault set, the priority of Pods with no priorityClassName is zero.
475
+ create : true
476
+ # If not set a name is generated using the fullname template and "-pod" suffix
477
+ name : " "
478
+ priority : 1000000
472
479
473
480
resources :
474
481
limits :
You can’t perform that action at this time.
0 commit comments