blob: c99855d86c1ef7e1189a39f260e29a2de14710d3 [file] [log] [blame]
Jakub Latuseke0e8ca72020-10-21 13:36:29 +02001{{/*
Alexander Dehn9b797d62020-04-21 09:53:50 +00002# 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.
Jakub Latuseke0e8ca72020-10-21 13:36:29 +020015*/}}
Alexander Dehn9b797d62020-04-21 09:53:50 +000016
Alexander Dehn8789a722020-10-16 14:29:05 +000017apiVersion: apps/v1
Alexander Dehn9b797d62020-04-21 09:53:50 +000018kind: Deployment
19metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20spec:
Alexander Dehn9b797d62020-04-21 09:53:50 +000021 replicas: {{ .Values.replicaCount }}
22 selector: {{- include "common.selectors" . | nindent 4 }}
23 template:
24 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25 spec:
Andreas Geissler2af50792023-03-27 17:11:27 +020026 initContainers:
Alexander Dehn9b797d62020-04-21 09:53:50 +000027 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureauxcbc703c2020-11-19 17:52:07 +010028 image: {{ include "repositoryGenerator.image.readiness" . }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000029 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
30 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020031 - /app/ready.py
Alexander Dehn9b797d62020-04-21 09:53:50 +000032 args:
33 - --container-name
34 - {{ .Values.config.sdncChartName }}
35 env:
36 - name: NAMESPACE
37 valueFrom:
38 fieldRef:
39 apiVersion: v1
40 fieldPath: metadata.namespace
41
42 containers:
43 - name: {{ include "common.name" . }}
Sylvain Desbureauxcbc703c2020-11-19 17:52:07 +010044 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000045 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 ports: {{- include "common.containerPorts" . | indent 10 }}
47 # disable liveness probe when breakpoints set in debugger
48 # so K8s doesn't restart unresponsive container
49 {{ if .Values.liveness.enabled }}
50 livenessProbe:
51 tcpSocket:
Andreas Geissler2af50792023-03-27 17:11:27 +020052 port: {{ .Values.service.internalPort }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000053 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
54 periodSeconds: {{ .Values.liveness.periodSeconds }}
55 {{ end }}
56 readinessProbe:
57 tcpSocket:
Andreas Geissler2af50792023-03-27 17:11:27 +020058 port: {{ .Values.service.internalPort }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000059 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60 periodSeconds: {{ .Values.readiness.periodSeconds }}
61 env:
62 - name: WEBPROTOCOL
Andreas Geissler2af50792023-03-27 17:11:27 +020063 value: {{ .Values.config.webProtocol }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000064 - name: WEBPORT
Andreas Geissler2af50792023-03-27 17:11:27 +020065 value : {{ .Values.config.webPort | quote }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000066 - name: SDNRPROTOCOL
Andreas Geissler2af50792023-03-27 17:11:27 +020067 value : {{ .Values.config.sdnrProtocol }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000068 - name: SDNRHOST
Andreas Geissler2af50792023-03-27 17:11:27 +020069 value : {{ .Values.config.sdnrHost }}.{{ include "common.namespace" . }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000070 - name: SDNRPORT
Andreas Geissler2af50792023-03-27 17:11:27 +020071 value : {{ .Values.config.sdnrPort | quote }}
Alexander Dehn8789a722020-10-16 14:29:05 +000072 {{ if .Values.config.transportpce.enabled }}
73 - name: TRPCEURL
74 value: {{ .Values.config.transportpce.transportpceUrl }}
75 {{ end }}
76 {{ if .Values.config.topologyserver.enabled }}
77 - name: TOPOURL
78 value: {{ .Values.config.topologyserver.topologyserverUrl }}
79 - name: TILEURL
80 value: {{ .Values.config.topologyserver.tileserverUrl }}
81 {{ end }}
demskeq8b43e92c2021-02-12 15:43:48 +010082 - name: ENABLE_OAUTH
83 value: "{{ .Values.config.oauth.enabled | default "false" }}"
84 - name: ENABLE_ODLUX_RBAC
85 value: "{{ .Values.config.oauth.odluxRbac.enabled | default "false" }}"
demskeq895bf73a2023-05-09 12:31:07 +000086 - name: SDNRWEBSOCKETPORT
87 value: "{{ .Values.sdnrWebsocketPort | default "8182" }}"
Andreas Geissler2af50792023-03-27 17:11:27 +020088 volumeMounts:
Alexander Dehn9b797d62020-04-21 09:53:50 +000089 - mountPath: /etc/localtime
90 name: localtime
91 readOnly: true
92
93 resources: {{ include "common.resources" . | nindent 12 }}
Satoshi Fujii54bfd172021-07-04 16:39:41 +000094 {{- if .Values.nodeSelector }}
95 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
96 {{- end }}
97 {{- if .Values.affinity }}
98 affinity: {{ toYaml .Values.affinity | nindent 8 }}
99 {{- end }}
farida azmy32c5ed82021-08-04 14:46:09 +0200100 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Andreas Geissler2af50792023-03-27 17:11:27 +0200101 volumes:
Alexander Dehn9b797d62020-04-21 09:53:50 +0000102 - name: localtime
103 hostPath:
104 path: /etc/localtime
105
106 imagePullSecrets:
107 - name: "{{ include "common.namespace" . }}-docker-registry-key"