Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 1 | {{/* |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 2 | # Copyright (C) 2018 AT&T Intellectual Property. |
| 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. |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 15 | */}} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 16 | |
milaszki | e4cb01a | 2020-07-07 12:45:36 +0000 | [diff] [blame] | 17 | apiVersion: apps/v1 |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
| 28 | replicas: {{ .Values.replicaCount }} |
milaszki | e4cb01a | 2020-07-07 12:45:36 +0000 | [diff] [blame] | 29 | selector: |
| 30 | matchLabels: |
| 31 | app: {{ include "common.name" . }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 36 | release: {{ include "common.release" . }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 37 | spec: |
| 38 | initContainers: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 39 | - name: {{ include "common.name" . }}-readiness |
| 40 | command: |
| 41 | - /app/ready.py |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 42 | args: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 43 | {{- if .Values.global.mariadbGalera.localCluster }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 44 | - --container-name |
| 45 | - {{ index .Values "mariadb-galera" "nameOverride" }} |
Krzysztof Opasiak | 9df4c55 | 2020-02-14 16:45:20 +0100 | [diff] [blame] | 46 | {{- else }} |
Krzysztof Opasiak | 9df4c55 | 2020-02-14 16:45:20 +0100 | [diff] [blame] | 47 | - --job-name |
| 48 | - {{ include "common.release" . }}-{{ index .Values "mariadb-init" "nameOverride" }}-config-job |
| 49 | {{- end }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 50 | env: |
| 51 | - name: NAMESPACE |
| 52 | valueFrom: |
| 53 | fieldRef: |
| 54 | apiVersion: v1 |
| 55 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 415cdee | 2020-11-19 17:20:58 +0100 | [diff] [blame] | 56 | image: {{ include "repositoryGenerator.image.readiness" . }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 57 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 58 | containers: |
| 59 | - name: {{ include "common.name" . }} |
bt2983 | 91566f0 | 2020-05-10 17:06:09 -0600 | [diff] [blame] | 60 | command: |
| 61 | - bash |
| 62 | args: |
| 63 | - '-c' |
| 64 | - 'export POL_BASIC_AUTH=`echo -n $POL_BASIC_AUTH_USER:$POL_BASIC_AUTH_PASSWORD | base64`; /startService.sh' |
Sylvain Desbureaux | 415cdee | 2020-11-19 17:20:58 +0100 | [diff] [blame] | 65 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | env: |
| 68 | - name: SPRING_PROFILE |
| 69 | value: "{{ .Values.config.springProfile }}" |
| 70 | - name: NENG_DB_USER |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 71 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "login") | indent 10}} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 72 | - name: NENG_DB_PASS |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 73 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "password") | indent 10}} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 74 | - name: NENG_DB_URL |
Sylvain Desbureaux | 93a5b49 | 2020-11-27 11:07:42 +0100 | [diff] [blame] | 75 | value: jdbc:mysql://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "db" "name" }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 76 | - name: POL_CLIENT_AUTH |
| 77 | value: "{{ .Values.config.polClientAuth }}" |
bt2983 | 91566f0 | 2020-05-10 17:06:09 -0600 | [diff] [blame] | 78 | - name: POL_BASIC_AUTH_USER |
| 79 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pol-basic-auth-secret" "key" "login") | indent 10}} |
| 80 | - name: POL_BASIC_AUTH_PASSWORD |
| 81 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pol-basic-auth-secret" "key" "password") | indent 10}} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 82 | - name: POL_URL |
| 83 | value: "{{ .Values.config.polUrl }}" |
| 84 | - name: POL_ENV |
| 85 | value: "{{ .Values.config.polEnv }}" |
| 86 | - name: POL_REQ_ID |
| 87 | value: "{{ .Values.config.polReqId }}" |
| 88 | - name: AAI_CERT_PASS |
| 89 | value: "{{ .Values.config.aaiCertPass }}" |
| 90 | - name: AAI_CERT_PATH |
| 91 | value: "{{ .Values.config.aaiCertPath }}" |
| 92 | - name: AAI_URI |
| 93 | value: "{{ .Values.config.aaiUri }}" |
Alexis de Talhouët | db36b42 | 2018-09-27 22:43:18 +0200 | [diff] [blame] | 94 | - name: AAI_AUTH |
| 95 | value: "{{ .Values.config.aaiAuth }}" |
Dan Timoney | 7ec6cb6 | 2021-10-26 10:59:36 -0400 | [diff] [blame] | 96 | - name: DISABLE_HOST_VERIFICATION |
| 97 | value: "{{ .Values.config.disableHostVerification }}" |
Alexis de Talhouët | db36b42 | 2018-09-27 22:43:18 +0200 | [diff] [blame] | 98 | volumeMounts: |
| 99 | - name: certs |
| 100 | mountPath: /opt/etc/config/aai_keystore |
| 101 | subPath: aai_keystore |
| 102 | readOnly: true |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 103 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 104 | {{ include "common.resources" . | indent 12 }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 105 | {{- if .Values.nodeSelector }} |
| 106 | nodeSelector: |
| 107 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 108 | {{- end -}} |
| 109 | {{- if .Values.affinity }} |
| 110 | affinity: |
| 111 | {{ toYaml .Values.affinity | indent 10 }} |
| 112 | {{- end }} |
Alexis de Talhouët | db36b42 | 2018-09-27 22:43:18 +0200 | [diff] [blame] | 113 | volumes: |
| 114 | - name: certs |
| 115 | secret: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 116 | secretName: {{ include "common.release" . }}-aai-keystore |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 117 | imagePullSecrets: |
| 118 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |