blob: 3e9e849052244a86e5dd4b67433b6eef83b7b751 [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
17apiVersion: extensions/v1beta1
18kind: 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 }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
bt29832f7e05a2018-09-19 22:49:19 -060034 spec:
35 initContainers:
Krzysztof Opasiak9df4c552020-02-14 16:45:20 +010036{{- if .Values.global.mariadbGalera.localCluster }}
bt29832f7e05a2018-09-19 22:49:19 -060037 - command:
38 - /root/ready.py
39 args:
40 - --container-name
41 - {{ index .Values "mariadb-galera" "nameOverride" }}
Krzysztof Opasiak9df4c552020-02-14 16:45:20 +010042{{- 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 }}
bt29832f7e05a2018-09-19 22:49:19 -060049 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 Opasiakc0a57f82020-03-23 15:50:13 +010066 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "login") | indent 10}}
bt29832f7e05a2018-09-19 22:49:19 -060067 - name: NENG_DB_PASS
Krzysztof Opasiakc0a57f82020-03-23 15:50:13 +010068 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "password") | indent 10}}
bt29832f7e05a2018-09-19 22:49:19 -060069 - name: NENG_DB_URL
Krzysztof Opasiak9df4c552020-02-14 16:45:20 +010070 value: jdbc:mysql://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
bt29832f7e05a2018-09-19 22:49:19 -060071 - 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ëtdb36b422018-09-27 22:43:18 +020087 - 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
bt29832f7e05a2018-09-19 22:49:19 -060094 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +000095{{ include "common.resources" . | indent 12 }}
bt29832f7e05a2018-09-19 22:49:19 -060096 {{- 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ëtdb36b422018-09-27 22:43:18 +0200104 volumes:
105 - name: certs
106 secret:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100107 secretName: {{ include "common.release" . }}-aai-keystore
bt29832f7e05a2018-09-19 22:49:19 -0600108 imagePullSecrets:
109 - name: "{{ include "common.namespace" . }}-docker-registry-key"