From 75f311f81fe04803067857a5a13a0ba2e8863c43 Mon Sep 17 00:00:00 2001 From: Abdessalam ZAIMI Date: Fri, 24 Apr 2026 11:46:30 +0200 Subject: [PATCH 1/2] feat: adding ability to configure securityContext + fix serviceAccountName not being passed in when create=false --- templates/deployment.yaml | 10 ++++++++-- values.yaml | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 37ba52c..d0b1824 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -43,9 +43,7 @@ spec: {{- end }} {{- end }} spec: - {{- if .Values.serviceAccount.create }} serviceAccountName: {{ include "pgdog.serviceAccountName" . }} - {{- end }} {{- if .Values.priorityClassName }} priorityClassName: {{ .Values.priorityClassName }} {{- end }} @@ -60,6 +58,10 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + securityContext: + {{- with .Values.podSecurityContext }} + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: pgdog {{- if .Values.image.name }} @@ -131,6 +133,10 @@ spec: {{- with .Values.extraVolumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} {{- if .Values.prometheusPort }} - name: prom image: prom/prometheus diff --git a/values.yaml b/values.yaml index f8ad71b..57b6687 100644 --- a/values.yaml +++ b/values.yaml @@ -644,3 +644,6 @@ prometheusCollector: tolerations: [] # affinity rules for pod scheduling affinity: {} + +securityContext: {} +podSecurityContext: {} \ No newline at end of file From cda04a79fc5e7d9eb5a4c7aaa7e634edbd241e71 Mon Sep 17 00:00:00 2001 From: Abdessalam ZAIMI Date: Fri, 24 Apr 2026 11:54:09 +0200 Subject: [PATCH 2/2] fix: small fix --- templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index d0b1824..f473f12 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -58,10 +58,10 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.podSecurityContext }} securityContext: - {{- with .Values.podSecurityContext }} {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} containers: - name: pgdog {{- if .Values.image.name }}