Merge "[DCAEMOD] Uses new tpls for repos / images"
[oom.git] / kubernetes / msb / charts / msb-consul / templates / deployment.yaml
index 5b8ceae..c7472cc 100644 (file)
@@ -1,3 +1,4 @@
+{{/*
 # Copyright © 2018 Amdocs, Bell Canada , ZTE
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,7 +12,8 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-apiVersion: extensions/v1beta1
+*/}}
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ include "common.fullname" . }}
@@ -19,15 +21,18 @@ metadata:
   labels:
     app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
+  selector:
+    matchLabels:
+      app: {{ include "common.name" . }}
   replicas: {{ .Values.replicaCount }}
   template:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
       annotations:
         sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
     spec:
@@ -36,6 +41,16 @@ spec:
         - name: {{ include "common.name" . }}
           image: "{{ .Values.global.dockerHubRepository | default .Values.dockerHubRepository }}/{{ .Values.image }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          securityContext:
+            runAsUser: {{ .Values.securityContext.runAsUser }}
+            runAsGroup: {{ .Values.securityContext.runAsGroup }}
+          command:
+            - docker-entrypoint.sh
+          args:
+            - "agent"
+            - "-dev"
+            - "-client"
+            - "0.0.0.0"
           ports:
           - containerPort: {{ .Values.service.internalPort }}
           # disable liveness probe when breakpoints set in debugger
@@ -57,6 +72,9 @@ spec:
           - mountPath: /etc/localtime
             name: localtime
             readOnly: true
+          - mountPath: /usr/local/bin/docker-entrypoint.sh
+            name: entrypoint
+            subPath: docker-entrypoint.sh
           resources:
 {{ include "common.resources" . | indent 12 }}
         {{- if .Values.nodeSelector }}
@@ -71,5 +89,9 @@ spec:
         - name: localtime
           hostPath:
             path: /etc/localtime
+        - name: entrypoint
+          configMap:
+            name: {{ include "common.fullname" . }}-entrypoint
+            defaultMode: 0777
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"