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 }}
|
{{ default (printf "%s-%v" (include "postgres-operator.fullname" .) "pod") .Values.podServiceAccount.name }}
|
||||||
{{- end -}}
|
{{- 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.
|
Create a controller ID.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@ metadata:
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
data:
|
data:
|
||||||
{{- if .Values.podPriorityClassName }}
|
{{- if or .Values.podPriorityClassName.create .Values.podPriorityClassName.name }}
|
||||||
pod_priority_class_name: {{ .Values.podPriorityClassName }}
|
pod_priority_class_name: {{ include "postgres-pod.priorityClassName" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
|
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
|
||||||
{{- include "flattenValuesForConfigMap" .Values.configGeneral | indent 2 }}
|
{{- include "flattenValuesForConfigMap" .Values.configGeneral | indent 2 }}
|
||||||
{{- include "flattenValuesForConfigMap" .Values.configUsers | indent 2 }}
|
{{- include "flattenValuesForConfigMap" .Values.configUsers | indent 2 }}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ configuration:
|
||||||
major_version_upgrade:
|
major_version_upgrade:
|
||||||
{{ toYaml .Values.configMajorVersionUpgrade | indent 4 }}
|
{{ toYaml .Values.configMajorVersionUpgrade | indent 4 }}
|
||||||
kubernetes:
|
kubernetes:
|
||||||
{{- if .Values.podPriorityClassName }}
|
{{- if .Values.podPriorityClassName.name }}
|
||||||
pod_priority_class_name: {{ .Values.podPriorityClassName }}
|
pod_priority_class_name: {{ .Values.podPriorityClassName.name }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
|
pod_service_account_name: {{ include "postgres-pod.serviceAccountName" . }}
|
||||||
oauth_token_secret_name: {{ template "postgres-operator.fullname" . }}
|
oauth_token_secret_name: {{ template "postgres-operator.fullname" . }}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{{- if .Values.podPriorityClassName }}
|
{{- if .Values.podPriorityClassName.create }}
|
||||||
apiVersion: scheduling.k8s.io/v1
|
apiVersion: scheduling.k8s.io/v1
|
||||||
description: 'Use only for databases controlled by Postgres operator'
|
description: 'Use only for databases controlled by Postgres operator'
|
||||||
kind: PriorityClass
|
kind: PriorityClass
|
||||||
|
|
@ -8,9 +8,9 @@ metadata:
|
||||||
helm.sh/chart: {{ template "postgres-operator.chart" . }}
|
helm.sh/chart: {{ template "postgres-operator.chart" . }}
|
||||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
name: {{ .Values.podPriorityClassName }}
|
name: {{ include "postgres-pod.priorityClassName" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
preemptionPolicy: PreemptLowerPriority
|
preemptionPolicy: PreemptLowerPriority
|
||||||
globalDefault: false
|
globalDefault: false
|
||||||
value: 1000000
|
value: {{ .Values.podPriorityClassName.priority }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,14 @@ podServiceAccount:
|
||||||
priorityClassName: ""
|
priorityClassName: ""
|
||||||
|
|
||||||
# priority class for database pods
|
# 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:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue