Priyadharshini | 7dc0385 | 2020-08-27 04:36:03 -0700 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright © 2020 Wipro Limited. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | */}} |
| 16 | apiVersion: apps/v1 |
| 17 | kind: Deployment |
| 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 19 | spec: |
| 20 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 21 | replicas: {{ index .Values.replicaCount }} |
| 22 | minReadySeconds: {{ index .Values.minReadySeconds }} |
| 23 | strategy: |
| 24 | type: {{ index .Values.updateStrategy.type }} |
| 25 | rollingUpdate: |
| 26 | maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }} |
| 27 | maxSurge: {{ index .Values.updateStrategy.maxSurge }} |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: {{- include "common.labels" . | nindent 8 }} |
| 31 | spec: |
| 32 | initContainers: {{ include "so.certificate.container_importer" . | nindent 6 }} |
| 33 | containers: |
| 34 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 747982c | 2020-11-19 17:40:05 +0100 | [diff] [blame] | 35 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 36 | resources: {{ include "common.resources" . | nindent 10 }} |
Priyadharshini | 7dc0385 | 2020-08-27 04:36:03 -0700 | [diff] [blame] | 37 | env: |
| 38 | - name: DB_HOST |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 39 | value: {{ include "common.mariadbService" . }} |
Priyadharshini | 7dc0385 | 2020-08-27 04:36:03 -0700 | [diff] [blame] | 40 | - name: DB_PORT |
krishnaa96 | 92b606b | 2020-10-30 11:29:21 +0530 | [diff] [blame] | 41 | value: {{ include "common.mariadbPort" . | quote }} |
Priyadharshini | 7dc0385 | 2020-08-27 04:36:03 -0700 | [diff] [blame] | 42 | - name: DB_USERNAME |
| 43 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }} |
| 44 | - name: DB_PASSWORD |
| 45 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }} |
| 46 | - name: DB_ADMIN_USERNAME |
| 47 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 10 }} |
| 48 | - name: DB_ADMIN_PASSWORD |
| 49 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 10 }} |
| 50 | - name: MSO_KEY |
| 51 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "oof-adapter-mso-key" "key" "password") | indent 10 }} |
| 52 | - name: OOF_LOGIN |
| 53 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "oof-auth" "key" "login") | indent 10 }} |
| 54 | - name: OOF_PASSWORD |
| 55 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "oof-auth" "key" "password") | indent 10 }} |
| 56 | {{ include "so.certificates.env" . | indent 8 | trim }} |
| 57 | envFrom: |
| 58 | - configMapRef: |
| 59 | name: {{ include "common.fullname" . }}-configmap |
| 60 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 61 | volumeMounts: {{ include "so.certificate.volumeMount" . | nindent 8 }} |
| 62 | - name: logs |
| 63 | mountPath: /app/logs |
| 64 | - name: config |
| 65 | mountPath: /app/config |
| 66 | readOnly: true |
| 67 | - name: {{ include "common.fullname" . }}-logs |
| 68 | mountPath: /var/log/onap |
| 69 | {{ include "so.helpers.livenessProbe" .| indent 8 }} |
| 70 | ports: {{- include "common.containerPorts" . | nindent 12 }} |
| 71 | # Filebeat sidecar container |
Maciej Wereski | df9ba22 | 2021-11-05 14:38:18 +0000 | [diff] [blame] | 72 | {{ include "common.log.sidecar" . | nindent 6 }} |
farida azmy | 87f4622 | 2021-04-06 15:25:15 +0200 | [diff] [blame] | 73 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Priyadharshini | 7dc0385 | 2020-08-27 04:36:03 -0700 | [diff] [blame] | 74 | volumes: {{ include "so.certificate.volumes" . | nindent 6 }} |
| 75 | - name: logs |
| 76 | emptyDir: {} |
| 77 | - name: config |
| 78 | configMap: |
| 79 | name: {{ include "common.fullname" . }}-app-configmap |
| 80 | - name: {{ include "common.fullname" . }}-log-conf |
| 81 | configMap: |
| 82 | name: {{ include "common.fullname" . }}-log |
Maciej Wereski | df9ba22 | 2021-11-05 14:38:18 +0000 | [diff] [blame] | 83 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
Priyadharshini | 7dc0385 | 2020-08-27 04:36:03 -0700 | [diff] [blame] | 84 | - name: {{ include "common.fullname" . }}-logs |
| 85 | emptyDir: {} |
| 86 | imagePullSecrets: |
| 87 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |