blob: 71b7846dc9650a24493b9ec4b7a89b698e53a449 [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
Andreas Geissler8c55fdd2023-07-20 11:15:42 +020019metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
bt29832f7e05a2018-09-19 22:49:19 -060020spec:
Andreas Geissler8c55fdd2023-07-20 11:15:42 +020021 selector: {{- include "common.selectors" . | nindent 4 }}
bt29832f7e05a2018-09-19 22:49:19 -060022 replicas: {{ .Values.replicaCount }}
23 template:
Andreas Geissler8c55fdd2023-07-20 11:15:42 +020024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
bt29832f7e05a2018-09-19 22:49:19 -060025 spec:
26 initContainers:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020027 - name: {{ include "common.name" . }}-readiness
28 command:
29 - /app/ready.py
bt29832f7e05a2018-09-19 22:49:19 -060030 args:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020031{{- if .Values.global.mariadbGalera.localCluster }}
bt29832f7e05a2018-09-19 22:49:19 -060032 - --container-name
33 - {{ index .Values "mariadb-galera" "nameOverride" }}
Krzysztof Opasiak9df4c552020-02-14 16:45:20 +010034{{- else }}
Krzysztof Opasiak9df4c552020-02-14 16:45:20 +010035 - --job-name
36 - {{ include "common.release" . }}-{{ index .Values "mariadb-init" "nameOverride" }}-config-job
37{{- end }}
bt29832f7e05a2018-09-19 22:49:19 -060038 env:
39 - name: NAMESPACE
40 valueFrom:
41 fieldRef:
42 apiVersion: v1
43 fieldPath: metadata.namespace
Sylvain Desbureaux415cdee2020-11-19 17:20:58 +010044 image: {{ include "repositoryGenerator.image.readiness" . }}
bt29832f7e05a2018-09-19 22:49:19 -060045 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
bt29832f7e05a2018-09-19 22:49:19 -060046 containers:
47 - name: {{ include "common.name" . }}
bt298391566f02020-05-10 17:06:09 -060048 command:
49 - bash
50 args:
51 - '-c'
52 - 'export POL_BASIC_AUTH=`echo -n $POL_BASIC_AUTH_USER:$POL_BASIC_AUTH_PASSWORD | base64`; /startService.sh'
Sylvain Desbureaux415cdee2020-11-19 17:20:58 +010053 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
bt29832f7e05a2018-09-19 22:49:19 -060054 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 env:
56 - name: SPRING_PROFILE
57 value: "{{ .Values.config.springProfile }}"
58 - name: NENG_DB_USER
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010059 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "login") | indent 10}}
bt29832f7e05a2018-09-19 22:49:19 -060060 - name: NENG_DB_PASS
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010061 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "password") | indent 10}}
bt29832f7e05a2018-09-19 22:49:19 -060062 - name: NENG_DB_URL
Sylvain Desbureaux93a5b492020-11-27 11:07:42 +010063 value: jdbc:mysql://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "db" "name" }}
bt29832f7e05a2018-09-19 22:49:19 -060064 - name: POL_CLIENT_AUTH
65 value: "{{ .Values.config.polClientAuth }}"
bt298391566f02020-05-10 17:06:09 -060066 - name: POL_BASIC_AUTH_USER
67 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pol-basic-auth-secret" "key" "login") | indent 10}}
68 - name: POL_BASIC_AUTH_PASSWORD
69 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pol-basic-auth-secret" "key" "password") | indent 10}}
bt29832f7e05a2018-09-19 22:49:19 -060070 - name: POL_URL
Radoslaw Chmiel96397bc2022-06-02 19:28:13 +020071 {{- if (include "common.needTLS" .) }}
72 value: "{{ .Values.config.polUrl.https }}"
73 {{- else }}
74 value: "{{ .Values.config.polUrl.http }}"
75 {{- end }}
bt29832f7e05a2018-09-19 22:49:19 -060076 - name: POL_ENV
77 value: "{{ .Values.config.polEnv }}"
78 - name: POL_REQ_ID
79 value: "{{ .Values.config.polReqId }}"
80 - name: AAI_CERT_PASS
81 value: "{{ .Values.config.aaiCertPass }}"
82 - name: AAI_CERT_PATH
83 value: "{{ .Values.config.aaiCertPath }}"
84 - name: AAI_URI
Radoslaw Chmiel96397bc2022-06-02 19:28:13 +020085 {{- if (include "common.needTLS" .) }}
86 value: "{{ .Values.config.aaiUri.https }}"
87 {{- else }}
88 value: "{{ .Values.config.aaiUri.http }}"
89 {{- end }}
Alexis de Talhouëtdb36b422018-09-27 22:43:18 +020090 - name: AAI_AUTH
91 value: "{{ .Values.config.aaiAuth }}"
Dan Timoney7ec6cb62021-10-26 10:59:36 -040092 - name: DISABLE_HOST_VERIFICATION
93 value: "{{ .Values.config.disableHostVerification }}"
Alexis de Talhouëtdb36b422018-09-27 22:43:18 +020094 volumeMounts:
95 - name: certs
96 mountPath: /opt/etc/config/aai_keystore
97 subPath: aai_keystore
98 readOnly: true
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010099 resources: {{ include "common.resources" . | nindent 10 }}
bt29832f7e05a2018-09-19 22:49:19 -0600100 {{- if .Values.nodeSelector }}
101 nodeSelector:
102{{ toYaml .Values.nodeSelector | indent 10 }}
103 {{- end -}}
104 {{- if .Values.affinity }}
105 affinity:
106{{ toYaml .Values.affinity | indent 10 }}
107 {{- end }}
Alexis de Talhouëtdb36b422018-09-27 22:43:18 +0200108 volumes:
109 - name: certs
110 secret:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100111 secretName: {{ include "common.release" . }}-aai-keystore
bt29832f7e05a2018-09-19 22:49:19 -0600112 imagePullSecrets:
113 - name: "{{ include "common.namespace" . }}-docker-registry-key"