[MULTICLOUD] Correction for AAI service port in MultiCloud API
[oom.git] / kubernetes / multicloud / templates / deployment.yaml
index 34fe622..5e10907 100644 (file)
@@ -40,30 +40,32 @@ spec:
      containers:
      - env:
        - name: MSB_PROTO
-         value: {{ .Values.config.msbprotocol }}
+         value: "{{ if (include "common.needTLS" .) }}https{{ else }}http{{ end }}"
        - name: MSB_ADDR
-         value: {{ .Values.config.msbgateway }}.{{ include "common.namespace" . }}
+         value: "{{ .Values.config.msbgateway }}.{{ include "common.namespace" . }}"
        - name: MSB_PORT
-         value: "{{ .Values.config.msbPort }}"
+         value: "{{- if (include "common.needTLS" .) }}{{ .Values.config.msbPort }}{{ else }}{{ .Values.config.msbPlainPort }}{{ end }}"
        - name: AAI_ADDR
          value: "aai.{{ include "common.namespace" . }}"
        - name: AAI_PORT
-         value: "{{ .Values.config.aai.port }}"
+         value: "{{- if (include "common.needTLS" .) }}{{ .Values.config.aai.aaiPort }}{{ else }}{{ .Values.config.aai.aaiPlainPort }}{{ end }}"
        - name: AAI_SCHEMA_VERSION
          value: "{{ .Values.config.aai.schemaVersion }}"
        - name: AAI_USERNAME
          value: "{{ .Values.config.aai.username }}"
        - name: AAI_PASSWORD
          value: "{{ .Values.config.aai.password }}"
+       - name: AAI_PROTOCOL
+         value: "{{- if (include "common.needTLS" .) }}https{{ else }}http{{ end }}"
        - name: SSL_ENABLED
-         value: "{{ .Values.config.ssl_enabled }}"
+         value: "{{- if (include "common.needTLS" .) }}{{ .Values.config.ssl_enabled }}{{ else }}false{{ end }}"
        resources:
 {{ include "common.resources" . | indent 12 }}
        image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
        name: {{ include "common.name" . }}
        volumeMounts:
-       - mountPath: /var/log/onap
+       - mountPath: "{{ .Values.log.path }}"
          name: framework-log
        - mountPath: /opt/multivimbroker/multivimbroker/pub/config/log.yml
          name: framework-logconfig
@@ -80,7 +82,7 @@ spec:
          httpGet:
            path: /api/multicloud/v0/swagger.json
            port: {{ .Values.service.internalPort }}
-           scheme: HTTPS
+           scheme: "{{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}"
          initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
          periodSeconds: {{ .Values.liveness.periodSeconds }}
          timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
@@ -89,17 +91,7 @@ spec:
        {{ end -}}
 
       # side car containers
-     - image: {{ include "repositoryGenerator.image.logging" . }}
-       imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-       name: filebeat-onap
-       volumeMounts:
-       - mountPath: /usr/share/filebeat/filebeat.yml
-         name: filebeat-conf
-         subPath: filebeat.yml
-       - mountPath: /var/log/onap
-         name: framework-log
-       - mountPath: /usr/share/filebeat/data
-         name: framework-data-filebeat
+     {{ include "common.log.sidecar" . | nindent 5 }}
      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
      volumes:
      - name: framework-log
@@ -107,11 +99,7 @@ spec:
      - name: provider-plugin
        configMap:
          name: {{ include "common.fullname" . }}-provider-plugin-configmap
-     - name: framework-data-filebeat
-       emptyDir: {}
-     - name: filebeat-conf
-       configMap:
-         name: multicloud-filebeat-configmap
+     {{ include "common.log.volumes" . | nindent 5 }}
      - name: framework-logconfig
        configMap:
          name: {{ include "common.fullname" . }}-log-configmap