blob: 97fece8a542dd6ff83327046906861aa911c0ced [file] [log] [blame]
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +01001{{/*
bt29832f7e05a2018-09-19 22:49:19 -06002# 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 Opasiakc0a57f82020-03-23 15:50:13 +010015*/}}
bt29832f7e05a2018-09-19 22:49:19 -060016
milaszkie4cb01a2020-07-07 12:45:36 +000017apiVersion: apps/v1
bt29832f7e05a2018-09-19 22:49:19 -060018kind: Deployment
19metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
bt29832f7e05a2018-09-19 22:49:19 -060026 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
milaszkie4cb01a2020-07-07 12:45:36 +000029 selector:
30 matchLabels:
31 app: {{ include "common.name" . }}
bt29832f7e05a2018-09-19 22:49:19 -060032 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
bt29832f7e05a2018-09-19 22:49:19 -060037 spec:
38 initContainers:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020039 - name: {{ include "common.name" . }}-readiness
40 command:
41 - /app/ready.py
bt29832f7e05a2018-09-19 22:49:19 -060042 args:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020043{{- if .Values.global.mariadbGalera.localCluster }}
bt29832f7e05a2018-09-19 22:49:19 -060044 - --container-name
45 - {{ index .Values "mariadb-galera" "nameOverride" }}
Krzysztof Opasiak9df4c552020-02-14 16:45:20 +010046{{- else }}
Krzysztof Opasiak9df4c552020-02-14 16:45:20 +010047 - --job-name
48 - {{ include "common.release" . }}-{{ index .Values "mariadb-init" "nameOverride" }}-config-job
49{{- end }}
bt29832f7e05a2018-09-19 22:49:19 -060050 env:
51 - name: NAMESPACE
52 valueFrom:
53 fieldRef:
54 apiVersion: v1
55 fieldPath: metadata.namespace
Sylvain Desbureaux415cdee2020-11-19 17:20:58 +010056 image: {{ include "repositoryGenerator.image.readiness" . }}
bt29832f7e05a2018-09-19 22:49:19 -060057 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
bt29832f7e05a2018-09-19 22:49:19 -060058 containers:
59 - name: {{ include "common.name" . }}
bt298391566f02020-05-10 17:06:09 -060060 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 Desbureaux415cdee2020-11-19 17:20:58 +010065 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
bt29832f7e05a2018-09-19 22:49:19 -060066 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67 env:
68 - name: SPRING_PROFILE
69 value: "{{ .Values.config.springProfile }}"
70 - name: NENG_DB_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010071 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "login") | indent 10}}
bt29832f7e05a2018-09-19 22:49:19 -060072 - name: NENG_DB_PASS
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010073 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "password") | indent 10}}
bt29832f7e05a2018-09-19 22:49:19 -060074 - name: NENG_DB_URL
Sylvain Desbureaux93a5b492020-11-27 11:07:42 +010075 value: jdbc:mysql://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "db" "name" }}
bt29832f7e05a2018-09-19 22:49:19 -060076 - name: POL_CLIENT_AUTH
77 value: "{{ .Values.config.polClientAuth }}"
bt298391566f02020-05-10 17:06:09 -060078 - 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}}
bt29832f7e05a2018-09-19 22:49:19 -060082 - name: POL_URL
Radoslaw Chmiel96397bc2022-06-02 19:28:13 +020083 {{- if (include "common.needTLS" .) }}
84 value: "{{ .Values.config.polUrl.https }}"
85 {{- else }}
86 value: "{{ .Values.config.polUrl.http }}"
87 {{- end }}
bt29832f7e05a2018-09-19 22:49:19 -060088 - name: POL_ENV
89 value: "{{ .Values.config.polEnv }}"
90 - name: POL_REQ_ID
91 value: "{{ .Values.config.polReqId }}"
92 - name: AAI_CERT_PASS
93 value: "{{ .Values.config.aaiCertPass }}"
94 - name: AAI_CERT_PATH
95 value: "{{ .Values.config.aaiCertPath }}"
96 - name: AAI_URI
Radoslaw Chmiel96397bc2022-06-02 19:28:13 +020097 {{- if (include "common.needTLS" .) }}
98 value: "{{ .Values.config.aaiUri.https }}"
99 {{- else }}
100 value: "{{ .Values.config.aaiUri.http }}"
101 {{- end }}
Alexis de Talhouëtdb36b422018-09-27 22:43:18 +0200102 - name: AAI_AUTH
103 value: "{{ .Values.config.aaiAuth }}"
Dan Timoney7ec6cb62021-10-26 10:59:36 -0400104 - name: DISABLE_HOST_VERIFICATION
105 value: "{{ .Values.config.disableHostVerification }}"
Alexis de Talhouëtdb36b422018-09-27 22:43:18 +0200106 volumeMounts:
107 - name: certs
108 mountPath: /opt/etc/config/aai_keystore
109 subPath: aai_keystore
110 readOnly: true
bt29832f7e05a2018-09-19 22:49:19 -0600111 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000112{{ include "common.resources" . | indent 12 }}
bt29832f7e05a2018-09-19 22:49:19 -0600113 {{- if .Values.nodeSelector }}
114 nodeSelector:
115{{ toYaml .Values.nodeSelector | indent 10 }}
116 {{- end -}}
117 {{- if .Values.affinity }}
118 affinity:
119{{ toYaml .Values.affinity | indent 10 }}
120 {{- end }}
Alexis de Talhouëtdb36b422018-09-27 22:43:18 +0200121 volumes:
122 - name: certs
123 secret:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100124 secretName: {{ include "common.release" . }}-aai-keystore
bt29832f7e05a2018-09-19 22:49:19 -0600125 imagePullSecrets:
126 - name: "{{ include "common.namespace" . }}-docker-registry-key"