# Copyright © 2018 AT&T USA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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: apps/v1
kind: Deployment
metadata:
  name: {{ include "common.fullname" . }}
  namespace: {{ include "common.namespace" . }}
  labels:
    app: {{ include "common.fullname" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ include "common.release" . }}
spec:
  selector:
    matchLabels:
      app: {{ include "common.name" . }}
  replicas: {{ index .Values.replicaCount }}
  minReadySeconds: {{ index .Values.minReadySeconds }}
  strategy:
    type: {{ index .Values.updateStrategy.type }}
    rollingUpdate:
      maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }}
      maxSurge: {{ index .Values.updateStrategy.maxSurge }}
  template:
    metadata:
      labels:
        app: {{ include "common.name" . }}
        release: {{ include "common.release" . }}
    spec:
      initContainers:
      {{ include "so.certificate.container_importer" . | indent 6 | trim }}
      - name: {{ include "common.name" . }}-readiness
        command:
        - /app/ready.py
        args:
        - --job-name
        - {{ include "common.release" . }}-so-mariadb-config-job
        env:
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
      containers:
      - name: {{ include "common.name" . }}
        image: {{ include "common.repository" . }}/{{ .Values.image }}
        resources: {{ include "common.resources" . | nindent 12 }}
        {{- if .Values.global.aafEnabled }}
        command:
        - sh
        args:
        - -c
        - |
          export $(grep '^c' {{ .Values.soHelpers.certInitializer.credsPath }}/mycreds.prop | xargs -0)
          export TRUSTSTORE_PASSWORD="${cadi_truststore_password}"
          {{- if .Values.global.security.aaf.enabled }}
          export KEYSTORE_PASSWORD="${cadi_keystore_password}"
          {{- end }}
          /app/start-app.sh
        {{- end }}
        env:
        - name: DB_HOST
          valueFrom:
            secretKeyRef:
              name: {{ include "common.release" . }}-so-db-secrets
              key: mariadb.readwrite.host
        - name: DB_PORT
          valueFrom:
            secretKeyRef:
              name: {{ include "common.release" . }}-so-db-secrets
              key: mariadb.readwrite.port
        - name: DB_USERNAME
          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }}
        - name: DB_PASSWORD
          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }}
        - name: DB_ADMIN_USERNAME
          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 10 }}
        - name: DB_ADMIN_PASSWORD
          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 10 }}
        {{ include "so.certificates.env" . | indent 8 | trim }}
        envFrom:
        - configMapRef:
            name: {{ include "common.fullname" . }}-configmap
        imagePullPolicy:  {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
        volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 8 }}
        - name: logs
          mountPath: /app/logs
        - name: config
          mountPath: /app/config
          readOnly: true
        - name: {{ include "common.fullname" . }}-logs
          mountPath: /var/log/onap
{{ include "so.helpers.livenessProbe" .| indent 8 }}
        ports:
        - containerPort: {{ index .Values.containerPort }}
          name: {{ .Values.service.portName }}
          protocol: TCP
      # Filebeat sidecar container
      - name: {{ include "common.name" . }}-filebeat-onap
        image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
        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" . }}-data-filebeat
          mountPath: /usr/share/filebeat/data
        - name: logs
          mountPath: /var/log/onap/so
        - name: {{ include "common.fullname" . }}-logs
          mountPath: /var/log/onap
      volumes: {{ include "so.certificate.volumes" . | nindent 6 }}
      - name: logs
        emptyDir: {}
      - name: config
        configMap:
            name: {{ include "common.fullname" . }}-app-configmap
      - name: {{ include "common.fullname" . }}-log-conf
        configMap:
          name: {{ include "common.fullname" . }}-log
      - name: {{ include "common.fullname" . }}-filebeat-conf
        configMap:
          name: {{ .Release.Name }}-so-filebeat-configmap
      - name: {{ include "common.fullname" . }}-data-filebeat
        emptyDir: {}
      - name:  {{ include "common.fullname" . }}-logs
        emptyDir: {}
      imagePullSecrets:
        - name: "{{ include "common.namespace" . }}-docker-registry-key"
