diff --git a/charts/patroni-services/templates/_helpers.tpl b/charts/patroni-services/templates/_helpers.tpl index be82cc99..7e53fbb0 100644 --- a/charts/patroni-services/templates/_helpers.tpl +++ b/charts/patroni-services/templates/_helpers.tpl @@ -419,3 +419,14 @@ Service Name for dbaas adapter {{- define "dbaas.serviceName" -}} {{ printf "dbaas-postgres-adapter" }} {{- end -}} + +{{/* +Return securityContext for powaUI +*/}} +{{- define "powaUI.securityContext" -}} + {{- if .Values.powaUI.securityContext -}} + {{- if not (.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints") -}} + {{- toYaml .Values.powaUI.securityContext | nindent 6 }} + {{- end -}} + {{- end -}} +{{- end -}} diff --git a/charts/patroni-services/templates/cr.yaml b/charts/patroni-services/templates/cr.yaml index 1e48a1fb..59bb6c72 100644 --- a/charts/patroni-services/templates/cr.yaml +++ b/charts/patroni-services/templates/cr.yaml @@ -11,8 +11,8 @@ spec: enabled: true names: {{- range $i, $v := .Values.privateRegistry.secrets }} - - {{ $v.name }} - {{- end }} + - {{ $v.name }} + {{- end }} {{- end }} installationTimestamp: {{ now | unixEpoch | quote }} {{ if .Values.serviceAccount.create }} @@ -159,7 +159,7 @@ spec: connectionName: "{{ .Values.externalDataBase.connectionName }}" authSecretName: "{{ .Values.externalDataBase.authSecretName }}" {{- if .Values.externalDataBase.restoreConfig }} - restoreConfig: + restoreConfig: {{ .Values.externalDataBase.restoreConfig | toYaml | nindent 6 }} {{- end }} {{ end }} @@ -271,9 +271,7 @@ spec: {{ toYaml .Values.powaUI.resources | indent 6 }} securityContext: {{- include "restricted.globalPodSecurityContext" . | nindent 6 }} - {{- with .Values.powaUI.securityContext }} - {{- toYaml . | nindent 6 -}} - {{- end }} + {{- include "powaUI.securityContext" . }} {{- end }} {{- if .Values.queryExporter.install }} queryExporter: diff --git a/charts/patroni-services/values.yaml b/charts/patroni-services/values.yaml index 716eca97..d24b2c36 100644 --- a/charts/patroni-services/values.yaml +++ b/charts/patroni-services/values.yaml @@ -17,8 +17,8 @@ privateRegistry: create: false # registry: ghcr.io/netcracker # username: - # password: - # email: + # password: + # email: global: cloudIntegrationEnabled: true @@ -373,7 +373,8 @@ powaUI: limits: cpu: 500m memory: 512Mi - securityContext: {} + securityContext: + runAsUser: 1001 replicationController: install: false