From 2ff22ca079abaf513ccb3c509513f3777565c1e4 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Fri, 5 Sep 2025 12:06:28 +0100 Subject: [PATCH] feat: Enhance security context handling for ClickHouse, PostgreSQL, and Redis StatefulSets --- .../oneuptime/templates/clickhouse-statefulset.yaml | 9 ++++++++- .../oneuptime/templates/postgresql-statefulset.yaml | 5 +++++ .../Public/oneuptime/templates/redis-statefulset.yaml | 9 ++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/HelmChart/Public/oneuptime/templates/clickhouse-statefulset.yaml b/HelmChart/Public/oneuptime/templates/clickhouse-statefulset.yaml index 98f099f30b..83ff38a637 100644 --- a/HelmChart/Public/oneuptime/templates/clickhouse-statefulset.yaml +++ b/HelmChart/Public/oneuptime/templates/clickhouse-statefulset.yaml @@ -52,9 +52,16 @@ spec: - name: clickhouse image: "{{ .Values.clickhouse.image.repository }}:{{ .Values.clickhouse.image.tag }}" imagePullPolicy: {{ .Values.clickhouse.image.pullPolicy }} - {{- with .Values.containerSecurityContext }} + {{- if .Values.clickhouse.containerSecurityContext }} securityContext: + {{- with .Values.clickhouse.containerSecurityContext }} {{- toYaml . | nindent 10 }} + {{- end }} + {{- else if .Values.containerSecurityContext }} + securityContext: + {{- with .Values.containerSecurityContext }} + {{- toYaml . | nindent 10 }} + {{- end }} {{- end }} ports: - name: http diff --git a/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml b/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml index 0bb208d746..3903bd576c 100644 --- a/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml +++ b/HelmChart/Public/oneuptime/templates/postgresql-statefulset.yaml @@ -79,6 +79,11 @@ spec: {{- with .Values.postgresql.primary.containerSecurityContext }} {{- toYaml . | nindent 10 }} {{- end }} + {{- else if .Values.containerSecurityContext }} + securityContext: + {{- with .Values.containerSecurityContext }} + {{- toYaml . | nindent 10 }} + {{- end }} {{- end }} ports: - name: postgresql diff --git a/HelmChart/Public/oneuptime/templates/redis-statefulset.yaml b/HelmChart/Public/oneuptime/templates/redis-statefulset.yaml index 366b8d9613..58fd0410b0 100644 --- a/HelmChart/Public/oneuptime/templates/redis-statefulset.yaml +++ b/HelmChart/Public/oneuptime/templates/redis-statefulset.yaml @@ -46,9 +46,16 @@ spec: - name: redis image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}" imagePullPolicy: {{ .Values.redis.image.pullPolicy }} - {{- with .Values.containerSecurityContext }} + {{- if .Values.redis.master.containerSecurityContext }} securityContext: + {{- with .Values.redis.master.containerSecurityContext }} {{- toYaml . | nindent 10 }} + {{- end }} + {{- else if .Values.containerSecurityContext }} + securityContext: + {{- with .Values.containerSecurityContext }} + {{- toYaml . | nindent 10 }} + {{- end }} {{- end }} command: - sh