Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / sdc / components / sdc-wfd-fe / templates / deployment.yaml
1 {{/*
2 # Copyright © 2018 Amdocs, Bell Canada
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         - --service-name
32         - sdc-wfd-be
33         env:
34         - name: NAMESPACE
35           valueFrom:
36             fieldRef:
37               apiVersion: v1
38               fieldPath: metadata.namespace
39         image: {{ include "repositoryGenerator.image.readiness" . }}
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         resources:
42           limits:
43             cpu: "100m"
44             memory: "500Mi"
45           requests:
46             cpu: "3m"
47             memory: "20Mi"
48       containers:
49         - name: {{ include "common.name" . }}
50           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
51           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52           ports: {{ include "common.containerPorts" . | nindent 12  }}
53           {{ if .Values.liveness.enabled }}
54           livenessProbe:
55             tcpSocket:
56               port: {{ .Values.service.internalPort }}
57             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
58             periodSeconds: {{ .Values.liveness.periodSeconds }}
59             successThreshold: {{ .Values.liveness.successThreshold }}
60             failureThreshold: {{ .Values.liveness.failureThreshold }}
61           {{ end }}
62           readinessProbe:
63             tcpSocket:
64               port: {{ .Values.service.internalPort }}
65             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
66             periodSeconds: {{ .Values.readiness.periodSeconds }}
67             successThreshold: {{ .Values.readiness.successThreshold }}
68             failureThreshold: {{ .Values.readiness.failureThreshold }}
69           startupProbe:
70             tcpSocket:
71               port: {{ .Values.service.internalPort }}
72             initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
73             periodSeconds: {{ .Values.startup.periodSeconds }}
74             successThreshold: {{ .Values.startup.successThreshold }}
75             failureThreshold: {{ .Values.startup.failureThreshold }}
76           env:
77           - name: ENVNAME
78             value: {{ .Values.env.name }}
79           - name: JAVA_OPTIONS
80             value: {{ .Values.config.javaOptions }}
81           - name: BACKEND
82             value: "{{ .Values.config.backendServerURL.http }}"
83           - name: IS_HTTPS
84             value: "false"
85           resources: {{ include "common.resources" . | nindent 12 }}
86         {{- if .Values.nodeSelector }}
87         nodeSelector:
88 {{ toYaml .Values.nodeSelector | indent 10 }}
89         {{- end -}}
90         {{- if .Values.affinity }}
91         affinity:
92 {{ toYaml .Values.affinity | indent 10 }}
93         {{- end }}
94         # side car containers
95         {{ include "common.log.sidecar" . | nindent 8 }}
96       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
97       volumes:
98         {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }}
99         - name: logs
100           emptyDir: {}
101       {{- include "common.imagePullSecrets" . | nindent 6 }}