feat(chart): add flags for podPriorityClassName (#2499)
Signed-off-by: Arthur Le Roux <aleroux@wiremind.io>
This commit is contained in:
parent
473a203206
commit
8bde04f86a
|
|
@ -38,6 +38,13 @@ Create a pod service account name.
|
|||
{{ default (printf "%s-%v" (include "postgres-operator.fullname" .) "pod") .Values.podServiceAccount.name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a pod priority class name.
|
||||
*/}}
|
||||
{{- define "postgres-pod.priorityClassName" -}}
|
||||
{{ default (printf "%s-%v" (include "postgres-operator.fullname" .) "pod") .Values.podPriorityClassName.name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a controller ID.
|
||||
*/}}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ metadata:
|
|||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
data:
|
||||
{{- if .Values.podPriorityClassName }}
|
||||
pod_priority_class_name: {{ .Values.podPriorityClassName }}
|
||||
{{- end }}
|
||||
{{- if or .Values.podPriorityClassName.create .Values.podPriorityClassName.name }}
|
||||
pod_priority_class_name: {{ include "postgres-pod.priorityClassName" . }}
|
||||
{{- end }}
|
||||
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
|
||||
{{- include "flattenValuesForConfigMap" .Values.configGeneral | indent 2 }}
|
||||
{{- include "flattenValuesForConfigMap" .Values.configUsers | indent 2 }}
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ configuration:
|
|||
major_version_upgrade:
|
||||
{{ toYaml .Values.configMajorVersionUpgrade | indent 4 }}
|
||||
kubernetes:
|
||||
{{- if .Values.podPriorityClassName }}
|
||||
pod_priority_class_name: {{ .Values.podPriorityClassName }}
|
||||
{{- if .Values.podPriorityClassName.name }}
|
||||
pod_priority_class_name: {{ .Values.podPriorityClassName.name }}
|
||||
{{- end }}
|
||||
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
|
||||
oauth_token_secret_name: {{ template "postgres-operator.fullname" . }}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{{- if .Values.podPriorityClassName }}
|
||||
{{- if .Values.podPriorityClassName.create }}
|
||||
apiVersion: scheduling.k8s.io/v1
|
||||
description: 'Use only for databases controlled by Postgres operator'
|
||||
kind: PriorityClass
|
||||
|
|
@ -8,9 +8,9 @@ metadata:
|
|||
helm.sh/chart: {{ template "postgres-operator.chart" . }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
name: {{ .Values.podPriorityClassName }}
|
||||
name: {{ include "postgres-pod.priorityClassName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
preemptionPolicy: PreemptLowerPriority
|
||||
globalDefault: false
|
||||
value: 1000000
|
||||
value: {{ .Values.podPriorityClassName.priority }}
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -468,7 +468,14 @@ podServiceAccount:
|
|||
priorityClassName: ""
|
||||
|
||||
# priority class for database pods
|
||||
podPriorityClassName: ""
|
||||
podPriorityClassName:
|
||||
# If create is false with no name set, no podPriorityClassName is specified.
|
||||
# Hence, the pod priorityClass is the one with globalDefault set.
|
||||
# If there is no PriorityClass with globalDefault set, the priority of Pods with no priorityClassName is zero.
|
||||
create: true
|
||||
# If not set a name is generated using the fullname template and "-pod" suffix
|
||||
name: ""
|
||||
priority: 1000000
|
||||
|
||||
resources:
|
||||
limits:
|
||||
|
|
|
|||
Loading…
Reference in New Issue