Merge "Remove unneded LoadBalancer annotation"
[oom.git] / kubernetes / common / network-name-gen / templates / deployment.yaml
1 {{/*
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.
15 */}}
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 "+" "_" }}
25     release: {{ include "common.release" . }}
26     heritage: {{ .Release.Service }}
27 spec:
28   replicas: {{ .Values.replicaCount }}
29   template:
30     metadata:
31       labels:
32         app: {{ include "common.name" . }}
33         release: {{ include "common.release" . }}
34     spec:
35       initContainers:
36 {{- if .Values.global.mariadbGalera.localCluster }}
37       - command:
38         - /root/ready.py
39         args:
40         - --container-name
41         - {{ index .Values "mariadb-galera" "nameOverride" }}
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 }}
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
66           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "login") | indent 10}}
67         - name: NENG_DB_PASS
68           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "neng-db-secret" "key" "password") | indent 10}}
69         - name: NENG_DB_URL
70           value: jdbc:mysql://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
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 }}"
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
94         resources:
95 {{ include "common.resources" . | indent 12 }}
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 }}
104       volumes:
105       - name: certs
106         secret:
107             secretName: {{ include "common.release" . }}-aai-keystore
108       imagePullSecrets:
109       - name: "{{ include "common.namespace" . }}-docker-registry-key"