Jakub Latusek | be89684 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Prateekinlinux | 445a18e | 2018-08-01 06:48:33 +0000 | [diff] [blame] | 2 | # Copyright © 2018 Amdocs, Bell Canada , ZTE |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 3 | # Copyright © 2021 Orange |
Prateekinlinux | 445a18e | 2018-08-01 06:48:33 +0000 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
Jakub Latusek | be89684 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
Grzegorz-Lis | 055b6ce | 2020-07-23 10:03:54 +0200 | [diff] [blame] | 17 | apiVersion: apps/v1 |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 18 | kind: Deployment |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 19 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 20 | spec: |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 21 | selector: {{- include "common.selectors" . | nindent 4 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
| 23 | template: |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 25 | spec: |
| 26 | initContainers: |
| 27 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 28 | - /app/ready.py |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 29 | args: |
| 30 | - --container-name |
| 31 | - msb-discovery |
| 32 | env: |
| 33 | - name: NAMESPACE |
| 34 | valueFrom: |
| 35 | fieldRef: |
| 36 | apiVersion: v1 |
| 37 | fieldPath: metadata.namespace |
Sylvain Desbureaux | fd2f8b8 | 2020-11-21 22:50:06 +0100 | [diff] [blame] | 38 | image: {{ include "repositoryGenerator.image.readiness" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 39 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 40 | name: {{ include "common.name" . }}-readiness |
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" |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 48 | containers: |
| 49 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | fd2f8b8 | 2020-11-21 22:50:06 +0100 | [diff] [blame] | 50 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 52 | ports: {{- include "common.containerPorts" . | indent 10 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 53 | # disable liveness probe when breakpoints set in debugger |
| 54 | # so K8s doesn't restart unresponsive container |
| 55 | {{- if eq .Values.liveness.enabled true }} |
| 56 | livenessProbe: |
| 57 | tcpSocket: |
vladimir turok | d804418 | 2023-07-27 16:28:36 +0200 | [diff] [blame] | 58 | port: {{ .Values.service.internalPort }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 59 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 60 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 61 | {{ end -}} |
| 62 | readinessProbe: |
| 63 | tcpSocket: |
vladimir turok | d804418 | 2023-07-27 16:28:36 +0200 | [diff] [blame] | 64 | port: {{ .Values.service.internalPort }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 65 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 66 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 67 | env: |
| 68 | - name: CONSUL_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 69 | value: msb-consul.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 70 | - name: SDCLIENT_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 71 | value: msb-discovery.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 72 | - name: ROUTE_LABELS |
| 73 | value: {{ .Values.config.routeLabels }} |
| 74 | volumeMounts: |
| 75 | - mountPath: /etc/localtime |
| 76 | name: localtime |
| 77 | readOnly: true |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 78 | - mountPath: /usr/local/apiroute-works/logs |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 79 | name: {{ include "common.fullname" . }}-logs |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 80 | resources: {{ include "common.resources" . | nindent 12 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 81 | {{- if .Values.nodeSelector }} |
| 82 | nodeSelector: |
| 83 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 84 | {{- end -}} |
| 85 | {{- if .Values.affinity }} |
| 86 | affinity: |
| 87 | {{ toYaml .Values.affinity | indent 10 }} |
| 88 | {{- end }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 89 | # side car containers |
Maciej Wereski | 0763e6e | 2021-11-18 11:48:25 +0100 | [diff] [blame] | 90 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | a4478e8 | 2021-10-11 13:48:11 +0200 | [diff] [blame] | 91 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 92 | volumes: |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 93 | - name: {{ include "common.fullname" . }}-log-conf |
| 94 | configMap: |
| 95 | name: {{ include "common.fullname" . }}-log |
Maciej Wereski | 0763e6e | 2021-11-18 11:48:25 +0100 | [diff] [blame] | 96 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }} |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 97 | - name: {{ include "common.fullname" . }}-logs |
| 98 | emptyDir: {} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 99 | - name: localtime |
| 100 | hostPath: |
| 101 | path: /etc/localtime |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame^] | 102 | {{- include "common.imagePullSecrets" . | nindent 6 }} |