Skip to content

Commit

Permalink
feat(chart): add flags for podPriorityClassName
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Le Roux <[email protected]>
  • Loading branch information
capuche2412 committed Dec 18, 2023
1 parent 9ee14f2 commit 97a1415
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions charts/postgres-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
data:
{{- 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" . }}
{{- include "flattenValuesForConfigMap" .Values.configGeneral | indent 2 }}
Expand Down
4 changes: 2 additions & 2 deletions charts/postgres-operator/templates/operatorconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.podPriorityClassName }}
{{- if and .Values.podPriorityClassName.create .Values.podPriorityClassName.name }}
apiVersion: scheduling.k8s.io/v1
description: 'Use only for databases controlled by Postgres operator'
kind: PriorityClass
Expand All @@ -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: {{ .Values.podPriorityClassName.name }}
namespace: {{ .Release.Namespace }}
preemptionPolicy: PreemptLowerPriority
globalDefault: false
value: 1000000
value: {{ .Values.podPriorityClassName.priority }}
{{- end }}
5 changes: 4 additions & 1 deletion charts/postgres-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,10 @@ podServiceAccount:
priorityClassName: ""

# priority class for database pods
podPriorityClassName: ""
podPriorityClassName:
create: true
name: ""
priority: 1000000

resources:
limits:
Expand Down

0 comments on commit 97a1415

Please sign in to comment.