Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / so / components / so-etsi-sol005-adapter / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 AT&T USA
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 apiVersion: apps/v1
17 kind: Deployment
18 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
19 spec:
20   selector: {{- include "common.selectors" . | nindent 4 }}
21   replicas: {{ index .Values.replicaCount }}
22   minReadySeconds: {{ .Values.minReadySeconds }}
23   strategy:
24     type: {{ .Values.updateStrategy.type }}
25     rollingUpdate:
26       maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
27       maxSurge: {{ .Values.updateStrategy.maxSurge }}
28   template:
29     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
30     spec:
31       initContainers:
32       {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
33       containers:
34       - name: {{ include "common.name" . }}
35         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
36         resources: {{ include "common.resources" . | nindent 10 }}
37         env:
38         - name: DB_HOST
39           value: {{ include "common.mariadbService" . }}
40         - name: DB_PORT
41           value: {{ include "common.mariadbPort" . | quote }}
42         - name: DB_USERNAME
43           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "login") | indent 10 }}
44         - name: DB_PASSWORD
45           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-user-creds" "key" "password") | indent 10 }}
46         - name: DB_ADMIN_USERNAME
47           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "login") | indent 10 }}
48         - name: DB_ADMIN_PASSWORD
49           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-admin-creds" "key" "password") | indent 10 }}
50         envFrom:
51         - configMapRef:
52             name: {{ include "common.fullname" . }}-configmap
53         imagePullPolicy:  {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
54         volumeMounts:
55         - name: logs
56           mountPath: /app/logs
57         - name: config
58           mountPath: /app/config
59           readOnly: true
60         livenessProbe:
61           httpGet:
62             path: {{- .Values.livenessProbe.path|indent 2}}
63             port: {{ .Values.containerPort }}
64             scheme: {{- .Values.livenessProbe.scheme| indent 2}}
65           initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds}}
66           periodSeconds: {{ .Values.livenessProbe.periodSeconds}}
67           timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds}}
68           successThreshold: {{ .Values.livenessProbe.successThreshold}}
69           failureThreshold: {{ .Values.livenessProbe.failureThreshold}}
70         ports: {{ include "common.containerPorts" . | nindent 10  }}
71       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
72       volumes:
73       - name: logs
74         emptyDir: {}
75       - name: config
76         configMap:
77             name: {{ include "common.fullname" . }}-app-configmap
78       {{- include "common.imagePullSecrets" . | nindent 6 }}