Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / sdnc / components / sdnc-web / templates / deployment.yaml
1 {{/*
2 # Copyright © 2020 highstreet technologies GmbH
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   replicas: {{ .Values.replicaCount }}
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       initContainers:
27       - name: {{ include "common.name" . }}-readiness
28         image: {{ include "repositoryGenerator.image.readiness" . }}
29         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
30         command:
31         - /app/ready.py
32         args:
33         - --service-name
34         - {{ .Values.config.sdncChartName }}
35         env:
36         - name: NAMESPACE
37           valueFrom:
38             fieldRef:
39               apiVersion: v1
40               fieldPath: metadata.namespace
41         resources:
42           limits:
43             cpu: "100m"
44             memory: "500Mi"
45           requests:
46             cpu: "3m"
47             memory: "20Mi"
48
49       containers:
50         - name: {{ include "common.name" . }}
51           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
52           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53           ports: {{- include "common.containerPorts" . | indent 10 }}
54           # disable liveness probe when breakpoints set in debugger
55           # so K8s doesn't restart unresponsive container
56           {{ if .Values.liveness.enabled }}
57           livenessProbe:
58             tcpSocket:
59               port: {{ .Values.service.internalPort }}
60             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
61             periodSeconds: {{ .Values.liveness.periodSeconds }}
62           {{ end }}
63           readinessProbe:
64             tcpSocket:
65               port: {{ .Values.service.internalPort }}
66             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
67             periodSeconds: {{ .Values.readiness.periodSeconds }}
68           env:
69           - name: WEBPROTOCOL
70             value: {{ .Values.config.webProtocol }}
71           - name: WEBPORT
72             value : {{ .Values.config.webPort | quote }}
73           - name: SDNRPROTOCOL
74             value : {{ .Values.config.sdnrProtocol }}
75           - name: SDNRHOST
76             value : {{ .Values.config.sdnrHost }}.{{ include "common.namespace" . }}
77           - name: SDNRPORT
78             value : {{ .Values.config.sdnrPort | quote }}
79           {{ if .Values.config.transportpce.enabled }}
80           - name: TRPCEURL
81             value: {{ .Values.config.transportpce.transportpceUrl }}
82           {{ end }}
83           {{ if .Values.config.topologyserver.enabled }}
84           - name: TOPOURL
85             value: {{ .Values.config.topologyserver.topologyserverUrl }}
86           - name: TILEURL
87             value: {{ .Values.config.topologyserver.tileserverUrl }}
88           {{ end }}
89           - name: ENABLE_OAUTH
90             value: "{{ .Values.config.oauth.enabled | default "false" }}"
91           - name: ENABLE_ODLUX_RBAC
92             value: "{{ .Values.config.oauth.odluxRbac.enabled | default "false" }}"
93           - name: SDNRWEBSOCKETPORT
94             value: "{{ .Values.sdnrWebsocketPort | default "8182" }}"
95           resources: {{ include "common.resources" . | nindent 12 }}
96       {{- if .Values.nodeSelector }}
97       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
98       {{- end }}
99       {{- if .Values.affinity }}
100       affinity: {{ toYaml .Values.affinity | nindent 8 }}
101       {{- end }}
102       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
103       {{- include "common.imagePullSecrets" . | nindent 6 }}