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: |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 26 | initContainers: |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 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 |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 41 | resources: |
| 42 | limits: |
| 43 | cpu: "100m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 44 | memory: "500Mi" |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame] | 45 | requests: |
| 46 | cpu: "3m" |
Andreas Geissler | 8cbb3d9 | 2024-03-12 16:44:56 +0100 | [diff] [blame] | 47 | memory: "20Mi" |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 48 | |
| 49 | containers: |
| 50 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | cbc703c | 2020-11-19 17:52:07 +0100 | [diff] [blame] | 51 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 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: |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 59 | port: {{ .Values.service.internalPort }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 60 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 61 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 62 | {{ end }} |
| 63 | readinessProbe: |
| 64 | tcpSocket: |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 65 | port: {{ .Values.service.internalPort }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 66 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 67 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 68 | env: |
| 69 | - name: WEBPROTOCOL |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 70 | value: {{ .Values.config.webProtocol }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 71 | - name: WEBPORT |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 72 | value : {{ .Values.config.webPort | quote }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 73 | - name: SDNRPROTOCOL |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 74 | value : {{ .Values.config.sdnrProtocol }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 75 | - name: SDNRHOST |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 76 | value : {{ .Values.config.sdnrHost }}.{{ include "common.namespace" . }} |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 77 | - name: SDNRPORT |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 78 | value : {{ .Values.config.sdnrPort | quote }} |
Alexander Dehn | 8789a72 | 2020-10-16 14:29:05 +0000 | [diff] [blame] | 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 }} |
demskeq8 | b43e92c | 2021-02-12 15:43:48 +0100 | [diff] [blame] | 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" }}" |
demskeq8 | 95bf73a | 2023-05-09 12:31:07 +0000 | [diff] [blame] | 93 | - name: SDNRWEBSOCKETPORT |
| 94 | value: "{{ .Values.sdnrWebsocketPort | default "8182" }}" |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 95 | volumeMounts: |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 96 | - mountPath: /etc/localtime |
| 97 | name: localtime |
| 98 | readOnly: true |
| 99 | |
| 100 | resources: {{ include "common.resources" . | nindent 12 }} |
Satoshi Fujii | 54bfd17 | 2021-07-04 16:39:41 +0000 | [diff] [blame] | 101 | {{- if .Values.nodeSelector }} |
| 102 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} |
| 103 | {{- end }} |
| 104 | {{- if .Values.affinity }} |
| 105 | affinity: {{ toYaml .Values.affinity | nindent 8 }} |
| 106 | {{- end }} |
farida azmy | 32c5ed8 | 2021-08-04 14:46:09 +0200 | [diff] [blame] | 107 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Andreas Geissler | 2af5079 | 2023-03-27 17:11:27 +0200 | [diff] [blame] | 108 | volumes: |
Alexander Dehn | 9b797d6 | 2020-04-21 09:53:50 +0000 | [diff] [blame] | 109 | - name: localtime |
| 110 | hostPath: |
| 111 | path: /etc/localtime |
| 112 | |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame] | 113 | {{- include "common.imagePullSecrets" . | nindent 6 }} |