Merge "[CPS] New Delhi release changes"
[oom.git] / kubernetes / vfc / components / vfc-vnfmgr / templates / deployment.yaml
index 9c8430c..8dd9f57 100644 (file)
@@ -41,8 +41,8 @@ spec:
       - command:
         - /app/ready.py
         args:
-        - --container-name
-        - {{ .Values.config.mariadbService }}
+        - --service-name
+        - {{ include "common.mariadbService" . }}
         env:
         - name: NAMESPACE
           valueFrom:
@@ -52,13 +52,20 @@ spec:
         image: {{ include "repositoryGenerator.image.readiness" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
+        resources:
+          limits:
+            cpu: "100m"
+            memory: "500Mi"
+          requests:
+            cpu: "3m"
+            memory: "20Mi"
       containers:
         - name: {{ include "common.name" . }}
           command:
             - sh
           args:
             - -c
-            - 'MYSQL_AUTH=root:${MYSQL_ROOT_PASSWORD} ./docker-entrypoint.sh'
+            - 'MYSQL_AUTH=${MYSQL_ROOT_USER}:${MYSQL_ROOT_PASSWORD} ./docker-entrypoint.sh'
           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
@@ -79,11 +86,16 @@ spec:
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           env:
             - name: MSB_HOST
-              value: "{{ .Values.global.config.msbprotocol }}://{{ .Values.global.config.msbServiceName }}:{{ .Values.global.config.msbPort }}"
+              value: "{{ .Values.global.config.msbprotocol }}{{ (eq "true" (include "common.needTLS" .)) | ternary "s" "" }}://{{ .Values.global.config.msbServiceName }}:{{ .Values.global.config.msbPort }}"
+            {{- if and (include "common.needTLS" .) (eq .Values.global.config.ssl_enabled true) }}
             - name: SSL_ENABLED
-              value: "{{ .Values.global.config.ssl_enabled }}"
+              value: "true"
+            {{- else }}
+            - name: SSL_ENABLED
+              value: "false"
+            {{- end }}
             - name: MYSQL_ADDR
-              value: "{{ .Values.config.mariadbService }}:{{ .Values.config.mariadbPort }}"
+              value: '{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}'
             - name: REDIS_HOST
               value: "{{ .Values.global.config.redisServiceName }}"
             - name: REDIS_PORT
@@ -95,16 +107,12 @@ spec:
             - name: REG_TO_MSB_WHEN_START
               value: "{{ .Values.global.config.reg_to_msb_when_start }}"
           volumeMounts:
-          - name: {{ include "common.fullname" . }}-localtime
-            mountPath: /etc/localtime
-            readOnly: true
           - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
+            mountPath: {{ .Values.log.path }}
           - name: {{ include "common.fullname" . }}-logconfig
             mountPath: /opt/vfc/gvnfm-vnfmgr/config/log.yml
             subPath: log.yml
-          resources:
-{{ include "common.resources" . | indent 12 }}
+          resources: {{ include "common.resources" . | nindent 12 }}
         {{- if .Values.nodeSelector }}
         nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
@@ -115,32 +123,13 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: {{ include "common.name" . }}-filebeat-onap
-          image: {{ include "repositoryGenerator.image.logging" . }}
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - name: {{ include "common.fullname" . }}-filebeat-conf
-            mountPath: /usr/share/filebeat/filebeat.yml
-            subPath: filebeat.yml
-          - name: {{ include "common.fullname" . }}-logs
-            mountPath: /var/log/onap
-          - name: {{ include "common.fullname" . }}-data-filebeat
-            mountPath: /usr/share/filebeat/data
-
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
-        - name: {{ include "common.fullname" . }}-localtime
-          hostPath:
-            path: /etc/localtime
         - name:  {{ include "common.fullname" . }}-logs
           emptyDir: {}
         - name: {{ include "common.fullname" . }}-logconfig
           configMap:
             name : {{ include "common.fullname" . }}-logging-configmap
 
-        - name: {{ include "common.fullname" . }}-filebeat-conf
-          configMap:
-            name: {{ include "common.release" . }}-vfc-filebeat-configmap
-        - name: {{ include "common.fullname" . }}-data-filebeat
-          emptyDir: {}
-      imagePullSecrets:
-      - name: "{{ include "common.namespace" . }}-docker-registry-key"
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
+      {{- include "common.imagePullSecrets" . | nindent 6 }}