blob: 7c1f262ec2f1e4bc536947962f5615064d9946d1 [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:
21 serviceName: "sdnc-web"
22 replicas: {{ .Values.replicaCount }}
23 selector: {{- include "common.selectors" . | nindent 4 }}
24 template:
25 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26 spec:
27 initContainers: {{ include "common.certInitializer.initContainer" . | indent 6 }}
28 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020029 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Alexander Dehn9b797d62020-04-21 09:53:50 +000030 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
31 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020032 - /app/ready.py
Alexander Dehn9b797d62020-04-21 09:53:50 +000033 args:
34 - --container-name
35 - {{ .Values.config.sdncChartName }}
36 env:
37 - name: NAMESPACE
38 valueFrom:
39 fieldRef:
40 apiVersion: v1
41 fieldPath: metadata.namespace
42
43 containers:
44 - name: {{ include "common.name" . }}
45 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
46 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47 ports: {{- include "common.containerPorts" . | indent 10 }}
48 # disable liveness probe when breakpoints set in debugger
49 # so K8s doesn't restart unresponsive container
50 {{ if .Values.liveness.enabled }}
51 livenessProbe:
52 tcpSocket:
53 port: {{ .Values.service.internalPort }}
54 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
55 periodSeconds: {{ .Values.liveness.periodSeconds }}
56 {{ end }}
57 readinessProbe:
58 tcpSocket:
59 port: {{ .Values.service.internalPort }}
60 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
61 periodSeconds: {{ .Values.readiness.periodSeconds }}
62 env:
63 - name: WEBPROTOCOL
64 value: {{ .Values.config.webProtocol }}
65 - name: WEBPORT
66 value: {{ .Values.config.webPort | quote }}
67 - name: SDNRPROTOCOL
68 value: {{ .Values.config.sdnrProtocol }}
69 - name: SDNRHOST
70 value: {{ .Values.config.sdnrHost }}.{{ include "common.namespace" . }}
71 - name: SDNRPORT
72 value: {{ .Values.config.sdnrPort | quote }}
73 - name: SSL_CERT_DIR
74 value: {{ .Values.config.sslCertDir }}
75 - name: SSL_CERTIFICATE
76 value: {{ .Values.config.sslCertiticate }}
77 - name: SSL_CERTIFICATE_KEY
78 value: {{ .Values.config.sslCertKey }}
Alexander Dehn8789a722020-10-16 14:29:05 +000079 {{ 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
Alexander Dehn9b797d62020-04-21 09:53:50 +000090 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
91 - mountPath: /etc/localtime
92 name: localtime
93 readOnly: true
94
95 resources: {{ include "common.resources" . | nindent 12 }}
96 {{- if .Values.nodeSelector }}
97 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
98 {{- end -}}
99 {{- if .Values.affinity }}
100 affinity:
101{{ toYaml .Values.affinity | indent 10 }}
102 {{- end }}
103 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
104 - name: localtime
105 hostPath:
106 path: /etc/localtime
107
108 imagePullSecrets:
109 - name: "{{ include "common.namespace" . }}-docker-registry-key"