X-Git-Url: https://gerrit.onap.org/r/gitweb?p=oom.git;a=blobdiff_plain;f=kubernetes%2Fdmaap%2Fcomponents%2Fdmaap-bc%2Ftemplates%2Fdeployment.yaml;h=a0c315426c289efd55875987356969eb73fbba29;hp=4d53914946e84969b225492c35b0064afaeadc6b;hb=0d5c917c02b40b335251a39952bb46f70bcb73ce;hpb=376643f2c2e6695f89cd24e22f4a34599133a225 diff --git a/kubernetes/dmaap/components/dmaap-bc/templates/deployment.yaml b/kubernetes/dmaap/components/dmaap-bc/templates/deployment.yaml index 4d53914946..a0c315426c 100644 --- a/kubernetes/dmaap/components/dmaap-bc/templates/deployment.yaml +++ b/kubernetes/dmaap/components/dmaap-bc/templates/deployment.yaml @@ -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 @@ -40,12 +41,15 @@ spec: name: {{ include "common.name" . }}-config-input - mountPath: /config name: {{ include "common.name" . }}-config - image: "{{ .Values.global.envsubstImage }}" + image: {{ include "repositoryGenerator.image.envsubst" . }} 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 - image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" + securityContext: + runAsUser: 0 + image: {{ include "repositoryGenerator.image.busybox" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }} command: ["chown","-Rf","1000:1001", "/opt/app/"] @@ -54,12 +58,16 @@ spec: # the cadi library is not using the jks password on the jks keystore. # So, this attempts to "fix" the credential property file until this is fixed properly. - name: {{ include "common.name" . }}-cred-fixer - image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" + image: {{ include "repositoryGenerator.image.busybox" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} 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: @@ -75,12 +83,12 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" + image: {{ include "repositoryGenerator.image.readiness" . }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} {{- end }} containers: - name: {{ include "common.name" . }} - image: "{{ .Values.repository }}/{{ .Values.image }}" + image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} ports: {{ include "common.containerPorts" . | nindent 10 }} {{ if eq .Values.liveness.enabled true -}} @@ -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: