X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fdcaemod%2Fcomponents%2Fdcaemod-genprocessor%2Ftemplates%2Fdeployment.yaml;h=0c1501233dafa19555172722e0d48f8020dcb47e;hb=b1ee058f941a9c9ff27467054d98b8a56c988797;hp=6b15abe9091fae25ca74ba78532465a4dccba7de;hpb=b22fc258c15ac525557d4325ca2441314a23d91e;p=oom.git diff --git a/kubernetes/dcaemod/components/dcaemod-genprocessor/templates/deployment.yaml b/kubernetes/dcaemod/components/dcaemod-genprocessor/templates/deployment.yaml index 6b15abe909..0c1501233d 100644 --- a/kubernetes/dcaemod/components/dcaemod-genprocessor/templates/deployment.yaml +++ b/kubernetes/dcaemod/components/dcaemod-genprocessor/templates/deployment.yaml @@ -1,3 +1,4 @@ +{{/* #============LICENSE_START======================================================== # ================================================================================ # Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved. @@ -14,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============LICENSE_END========================================================= +*/}} apiVersion: apps/v1 kind: Deployment @@ -24,6 +26,21 @@ spec: template: metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: + initContainers: + # apps run as uid 1000, gid 1000 + # the volume is mounted with root permissions + # this initContainer changes ownership to uid 1000 gid 1000 + # (tried using a securityContext in the pod spec, but it didn't seem to work) + - name: set-permissions + image: busybox:latest + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: + - sh + - -c + - chown -R 1000:1000 /genprocessor-data + volumeMounts: + - mountPath: /genprocessor-data + name: genprocessor-data containers: - name: {{ include "common.name" . }} image: "{{ include "common.repository" . }}/{{ .Values.image }}"