Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / sdnc / components / 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: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector: {{- include "common.selectors" . | nindent 4 }}
22   replicas: {{ .Values.replicaCount }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       initContainers:
27       - name: {{ include "common.name" . }}-readiness
28         command:
29         - /app/ready.py
30         args:
31 {{- if .Values.global.mariadbGalera.localCluster }}
32         - --service-name
33         - {{ include "common.mariadbService" . }}
34 {{- else }}
35         - --job-name
36         - {{ include "common.release" . }}-{{ index .Values "mariadb-init" "nameOverride" }}-config-job
37 {{- end }}
38         env:
39         - name: NAMESPACE
40           valueFrom:
41             fieldRef:
42               apiVersion: v1
43               fieldPath: metadata.namespace
44         image: {{ include "repositoryGenerator.image.readiness" . }}
45         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46         resources:
47           limits:
48             cpu: "100m"
49             memory: "500Mi"
50           requests:
51             cpu: "3m"
52             memory: "20Mi"
53       containers:
54       - name: {{ include "common.name" . }}
55         command:
56           - bash
57         args:
58           - '-c'
59           - 'export POL_BASIC_AUTH=`echo -n $POL_BASIC_AUTH_USER:$POL_BASIC_AUTH_PASSWORD | base64`; /startService.sh'
60         image: {{ include "repositoryGenerator.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-init" "config" "mysqlDatabase" }}
71         - name: POL_CLIENT_AUTH
72           value: "{{ .Values.config.polClientAuth }}"
73         - name: POL_BASIC_AUTH_USER
74           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pol-basic-auth-secret" "key" "login") | indent 10}}
75         - name: POL_BASIC_AUTH_PASSWORD
76           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pol-basic-auth-secret" "key" "password") | indent 10}}
77         - name: POL_URL
78           {{- if (include "common.needTLS" .) }}
79           value: "{{ .Values.config.polUrl.https }}"
80           {{- else }}
81           value: "{{ .Values.config.polUrl.http }}"
82           {{- end }}
83         - name: POL_ENV
84           value: "{{ .Values.config.polEnv }}"
85         - name: POL_REQ_ID
86           value: "{{ .Values.config.polReqId }}"
87         - name: AAI_CERT_PASS
88           value: "{{ .Values.config.aaiCertPass }}"
89         - name: AAI_CERT_PATH
90           value: "{{ .Values.config.aaiCertPath }}"
91         - name: AAI_URI
92           {{- if (include "common.needTLS" .) }}
93           value: "{{ .Values.config.aaiUri.https }}"
94           {{- else }}
95           value: "{{ .Values.config.aaiUri.http }}"
96           {{- end }}
97         - name: AAI_AUTH
98           value: "{{ .Values.config.aaiAuth }}"
99         - name: DISABLE_HOST_VERIFICATION
100           value: "{{ .Values.config.disableHostVerification }}"
101         volumeMounts:
102         - name: certs
103           mountPath: /opt/etc/config/aai_keystore
104           subPath: aai_keystore
105           readOnly: true
106         resources: {{ include "common.resources" . | nindent 10 }}
107         {{- if .Values.nodeSelector }}
108         nodeSelector:
109 {{ toYaml .Values.nodeSelector | indent 10 }}
110         {{- end -}}
111         {{- if .Values.affinity }}
112         affinity:
113 {{ toYaml .Values.affinity | indent 10 }}
114         {{- end }}
115       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
116       volumes:
117       - name: certs
118         secret:
119             secretName: {{ include "common.release" . }}-aai-keystore
120       {{- include "common.imagePullSecrets" . | nindent 6 }}