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 | |
| 17 | apiVersion: extensions/v1beta1 |
| 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 }} |
| 29 | template: |
| 30 | metadata: |
| 31 | labels: |
| 32 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 33 | release: {{ include "common.release" . }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 34 | spec: |
| 35 | initContainers: |
Krzysztof Opasiak | 9df4c55 | 2020-02-14 16:45:20 +0100 | [diff] [blame] | 36 | {{- if .Values.global.mariadbGalera.localCluster }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 37 | - command: |
| 38 | - /root/ready.py |
| 39 | args: |
| 40 | - --container-name |
| 41 | - {{ index .Values "mariadb-galera" "nameOverride" }} |
Krzysztof Opasiak | 9df4c55 | 2020-02-14 16:45:20 +0100 | [diff] [blame] | 42 | {{- else }} |
| 43 | - command: |
| 44 | - /root/job_complete.py |
| 45 | args: |
| 46 | - --job-name |
| 47 | - {{ include "common.release" . }}-{{ index .Values "mariadb-init" "nameOverride" }}-config-job |
| 48 | {{- end }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 49 | env: |
| 50 | - name: NAMESPACE |
| 51 | valueFrom: |
| 52 | fieldRef: |
| 53 | apiVersion: v1 |
| 54 | fieldPath: metadata.namespace |
| 55 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 56 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 57 | name: {{ include "common.name" . }}-readiness |
| 58 | containers: |
| 59 | - name: {{ include "common.name" . }} |
| 60 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 62 | env: |
| 63 | - name: SPRING_PROFILE |
| 64 | value: "{{ .Values.config.springProfile }}" |
| 65 | - name: NENG_DB_USER |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 66 | {{- 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] | 67 | - name: NENG_DB_PASS |
Krzysztof Opasiak | c0a57f8 | 2020-03-23 15:50:13 +0100 | [diff] [blame] | 68 | {{- 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] | 69 | - name: NENG_DB_URL |
Krzysztof Opasiak | 9df4c55 | 2020-02-14 16:45:20 +0100 | [diff] [blame] | 70 | value: jdbc:mysql://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 71 | - name: POL_CLIENT_AUTH |
| 72 | value: "{{ .Values.config.polClientAuth }}" |
| 73 | - name: POL_BASIC_AUTH |
| 74 | value: "{{ .Values.config.polBasicAuth }}" |
| 75 | - name: POL_URL |
| 76 | value: "{{ .Values.config.polUrl }}" |
| 77 | - name: POL_ENV |
| 78 | value: "{{ .Values.config.polEnv }}" |
| 79 | - name: POL_REQ_ID |
| 80 | value: "{{ .Values.config.polReqId }}" |
| 81 | - name: AAI_CERT_PASS |
| 82 | value: "{{ .Values.config.aaiCertPass }}" |
| 83 | - name: AAI_CERT_PATH |
| 84 | value: "{{ .Values.config.aaiCertPath }}" |
| 85 | - name: AAI_URI |
| 86 | value: "{{ .Values.config.aaiUri }}" |
Alexis de Talhouët | db36b42 | 2018-09-27 22:43:18 +0200 | [diff] [blame] | 87 | - name: AAI_AUTH |
| 88 | value: "{{ .Values.config.aaiAuth }}" |
| 89 | volumeMounts: |
| 90 | - name: certs |
| 91 | mountPath: /opt/etc/config/aai_keystore |
| 92 | subPath: aai_keystore |
| 93 | readOnly: true |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 94 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 95 | {{ include "common.resources" . | indent 12 }} |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 96 | {{- if .Values.nodeSelector }} |
| 97 | nodeSelector: |
| 98 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 99 | {{- end -}} |
| 100 | {{- if .Values.affinity }} |
| 101 | affinity: |
| 102 | {{ toYaml .Values.affinity | indent 10 }} |
| 103 | {{- end }} |
Alexis de Talhouët | db36b42 | 2018-09-27 22:43:18 +0200 | [diff] [blame] | 104 | volumes: |
| 105 | - name: certs |
| 106 | secret: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 107 | secretName: {{ include "common.release" . }}-aai-keystore |
bt2983 | 2f7e05a | 2018-09-19 22:49:19 -0600 | [diff] [blame] | 108 | imagePullSecrets: |
| 109 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |