[DMAAP] DMaaP ServiceMesh compatibility
[oom.git] / kubernetes / dmaap / components / dmaap-bc / templates / deployment.yaml
index eaad403..a0c3154 100644 (file)
@@ -23,7 +23,8 @@ spec:
   template:
     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
     spec:
-{{- if or .Values.global.aafEnabled .Values.PG.enabled }}
+      {{ include "common.podSecurityContext" . | indent 6 | trim}}
+{{- if .Values.PG.enabled }}
       initContainers:
       - command:
         - sh
@@ -44,7 +45,10 @@ spec:
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-update-config
 {{ include "common.certInitializer.initContainer" . | nindent 6 }}
+{{- if .Values.global.aafEnabled }}
       - name: {{ include "common.name" . }}-permission-fixer
+        securityContext:
+          runAsUser: 0
         image: {{ include "repositoryGenerator.image.busybox" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
@@ -59,7 +63,11 @@ spec:
         volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
         command: ["/bin/sh"]
         args: [ "-c", "sed -i -e '/cadi_keystore_password=/d' -e '/cadi_keystore_password_jks/p' -e 's/cadi_keystore_password_jks/cadi_keystore_password/' -e 's/dmaap-bc.p12/dmaap-bc.jks/' /opt/app/osaaf/local/org.onap.dmaap-bc.cred.props" ]
+{{- end }}
       - name: {{ include "common.name" . }}-postgres-readiness
+        securityContext:
+          runAsUser: 100
+          runAsGroup: 65533
         command:
         - /app/ready.py
         args:
@@ -114,6 +122,7 @@ spec:
         {{- if .Values.affinity }}
         affinity: {{ toYaml .Values.affinity | nindent 10 }}
         {{- end }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
         - name: localtime
           hostPath: