blob: 96f499a21f4840a84021c79b80ee2db2bf1814f9 [file] [log] [blame]
Alexander Dehn9b797d62020-04-21 09:53:50 +00001# Copyright © 2020 highstreet technologies GmbH
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020015nclude "common.repository" . }}apiVersion: apps/v1
Alexander Dehn9b797d62020-04-21 09:53:50 +000016kind: Deployment
17metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
18spec:
19 serviceName: "sdnc-web"
20 replicas: {{ .Values.replicaCount }}
21 selector: {{- include "common.selectors" . | nindent 4 }}
22 template:
23 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
24 spec:
25 initContainers: {{ include "common.certInitializer.initContainer" . | indent 6 }}
26 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020027 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Alexander Dehn9b797d62020-04-21 09:53:50 +000028 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
29 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020030 - /app/ready.py
Alexander Dehn9b797d62020-04-21 09:53:50 +000031 args:
32 - --container-name
33 - {{ .Values.config.sdncChartName }}
34 env:
35 - name: NAMESPACE
36 valueFrom:
37 fieldRef:
38 apiVersion: v1
39 fieldPath: metadata.namespace
40
41 containers:
42 - name: {{ include "common.name" . }}
43 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
44 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45 ports: {{- include "common.containerPorts" . | indent 10 }}
46 # disable liveness probe when breakpoints set in debugger
47 # so K8s doesn't restart unresponsive container
48 {{ if .Values.liveness.enabled }}
49 livenessProbe:
50 tcpSocket:
51 port: {{ .Values.service.internalPort }}
52 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
53 periodSeconds: {{ .Values.liveness.periodSeconds }}
54 {{ end }}
55 readinessProbe:
56 tcpSocket:
57 port: {{ .Values.service.internalPort }}
58 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
59 periodSeconds: {{ .Values.readiness.periodSeconds }}
60 env:
61 - name: WEBPROTOCOL
62 value: {{ .Values.config.webProtocol }}
63 - name: WEBPORT
64 value: {{ .Values.config.webPort | quote }}
65 - name: SDNRPROTOCOL
66 value: {{ .Values.config.sdnrProtocol }}
67 - name: SDNRHOST
68 value: {{ .Values.config.sdnrHost }}.{{ include "common.namespace" . }}
69 - name: SDNRPORT
70 value: {{ .Values.config.sdnrPort | quote }}
71 - name: SSL_CERT_DIR
72 value: {{ .Values.config.sslCertDir }}
73 - name: SSL_CERTIFICATE
74 value: {{ .Values.config.sslCertiticate }}
75 - name: SSL_CERTIFICATE_KEY
76 value: {{ .Values.config.sslCertKey }}
77 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
78 - mountPath: /etc/localtime
79 name: localtime
80 readOnly: true
81
82 resources: {{ include "common.resources" . | nindent 12 }}
83 {{- if .Values.nodeSelector }}
84 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
85 {{- end -}}
86 {{- if .Values.affinity }}
87 affinity:
88{{ toYaml .Values.affinity | indent 10 }}
89 {{- end }}
90 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
91 - name: localtime
92 hostPath:
93 path: /etc/localtime
94
95 imagePullSecrets:
96 - name: "{{ include "common.namespace" . }}-docker-registry-key"