Jakub Latusek | e0e8ca7 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 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. |
Jakub Latusek | e0e8ca7 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 16 | |
Alexander Dehn | 8789a72 | 2020-10-16 14:29:05 +0000 | [diff] [blame] | 17 | apiVersion: apps/v1 |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 18 | kind: Deployment |
| 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 20 | spec: |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 21 | replicas: {{ .Values.replicaCount }} |
| 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 23 | template: |
| 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 25 | spec: |
| 26 | initContainers: {{ include "common.certInitializer.initContainer" . | indent 6 }} |
| 27 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 28 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 29 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 30 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 31 | - /app/ready.py |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 32 | 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 Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 44 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 45 | 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: |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 52 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 53 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 54 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 55 | {{ end }} |
| 56 | readinessProbe: |
| 57 | tcpSocket: |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 58 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 59 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 60 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 61 | env: |
| 62 | - name: WEBPROTOCOL |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 63 | value: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.webProtocol .Values.config.webPlainProtocol }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 64 | - name: WEBPORT |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 65 | value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.webPort .Values.config.webPlainPort | quote }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 66 | - name: SDNRPROTOCOL |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 67 | value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdnrProtocol .Values.config.sdnrPlainProtocol }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 68 | - name: SDNRHOST |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 69 | value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdnrHost .Values.config.sdnrPlainHost }}.{{ include "common.namespace" . }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 70 | - name: SDNRPORT |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 71 | value : {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.config.sdnrPort .Values.config.sdnrPlainPort | quote }} |
| 72 | {{ if (include "common.needTLS" .) }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 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 }} |
Radoslaw Chmiel | 58662a3 | 2022-06-02 19:37:35 +0200 | [diff] [blame] | 79 | {{ end }} |
Alexander Dehn | 8789a72 | 2020-10-16 14:29:05 +0000 | [diff] [blame] | 80 | {{ if .Values.config.transportpce.enabled }} |
| 81 | - name: TRPCEURL |
| 82 | value: {{ .Values.config.transportpce.transportpceUrl }} |
| 83 | {{ end }} |
| 84 | {{ if .Values.config.topologyserver.enabled }} |
| 85 | - name: TOPOURL |
| 86 | value: {{ .Values.config.topologyserver.topologyserverUrl }} |
| 87 | - name: TILEURL |
| 88 | value: {{ .Values.config.topologyserver.tileserverUrl }} |
| 89 | {{ end }} |
demskeq8 | b43e92c | 2021-02-12 15:43:48 +0100 | [diff] [blame] | 90 | - name: ENABLE_OAUTH |
| 91 | value: "{{ .Values.config.oauth.enabled | default "false" }}" |
| 92 | - name: ENABLE_ODLUX_RBAC |
| 93 | value: "{{ .Values.config.oauth.odluxRbac.enabled | default "false" }}" |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 94 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
| 95 | - mountPath: /etc/localtime |
| 96 | name: localtime |
| 97 | readOnly: true |
| 98 | |
| 99 | resources: {{ include "common.resources" . | nindent 12 }} |
Satoshi Fujii | 54bfd17 | 2021-07-04 16:39:41 +0000 | [diff] [blame] | 100 | {{- if .Values.nodeSelector }} |
| 101 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} |
| 102 | {{- end }} |
| 103 | {{- if .Values.affinity }} |
| 104 | affinity: {{ toYaml .Values.affinity | nindent 8 }} |
| 105 | {{- end }} |
farida azmy | 32c5ed8 | 2021-08-04 14:46:09 +0200 | [diff] [blame] | 106 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 107 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
| 108 | - name: localtime |
| 109 | hostPath: |
| 110 | path: /etc/localtime |
| 111 | |
| 112 | imagePullSecrets: |
| 113 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |