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: |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 27 | {{ include "common.certInitializer.initContainer" . | indent 6 | trim }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 28 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 29 | - /app/ready.py |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 30 | args: |
| 31 | - --container-name |
| 32 | - msb-discovery |
| 33 | env: |
| 34 | - name: NAMESPACE |
| 35 | valueFrom: |
| 36 | fieldRef: |
| 37 | apiVersion: v1 |
| 38 | fieldPath: metadata.namespace |
Sylvain Desbureaux | fd2f8b8 | 2020-11-21 22:50:06 +0100 | [diff] [blame] | 39 | image: {{ include "repositoryGenerator.image.readiness" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 40 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 41 | name: {{ include "common.name" . }}-readiness |
| 42 | containers: |
| 43 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | fd2f8b8 | 2020-11-21 22:50:06 +0100 | [diff] [blame] | 44 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 45 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 46 | ports: {{- include "common.containerPorts" . | indent 10 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 47 | # disable liveness probe when breakpoints set in debugger |
| 48 | # so K8s doesn't restart unresponsive container |
| 49 | {{- if eq .Values.liveness.enabled true }} |
| 50 | livenessProbe: |
| 51 | tcpSocket: |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 52 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 53 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 54 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 55 | {{ end -}} |
| 56 | readinessProbe: |
| 57 | tcpSocket: |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 58 | port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 59 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 60 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 61 | env: |
| 62 | - name: CONSUL_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 63 | value: msb-consul.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 64 | - name: SDCLIENT_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 65 | value: msb-discovery.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 66 | - name: ROUTE_LABELS |
| 67 | value: {{ .Values.config.routeLabels }} |
| 68 | volumeMounts: |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 69 | {{ include "common.certInitializer.volumeMount" . | indent 10 | trim }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 70 | - mountPath: /etc/localtime |
| 71 | name: localtime |
| 72 | readOnly: true |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 73 | - mountPath: /usr/local/apiroute-works/logs |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 74 | name: {{ include "common.fullname" . }}-logs |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 75 | {{- if (include "common.needTLS" .) }} |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 76 | - mountPath: /usr/local/openresty/nginx/msb-enabled/msbhttps.conf |
| 77 | name: {{ include "common.fullname" . }}-nginx-conf |
| 78 | subPath: msbhttps.conf |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 79 | {{- end }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 80 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 81 | {{ include "common.resources" . | indent 12 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 82 | {{- if .Values.nodeSelector }} |
| 83 | nodeSelector: |
| 84 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 85 | {{- end -}} |
| 86 | {{- if .Values.affinity }} |
| 87 | affinity: |
| 88 | {{ toYaml .Values.affinity | indent 10 }} |
| 89 | {{- end }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 90 | # side car containers |
Maciej Wereski | 0763e6e | 2021-11-18 11:48:25 +0100 | [diff] [blame] | 91 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | a4478e8 | 2021-10-11 13:48:11 +0200 | [diff] [blame] | 92 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 93 | volumes: |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 94 | {{ include "common.certInitializer.volumes" . | indent 8 | trim }} |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 95 | - name: {{ include "common.fullname" . }}-log-conf |
| 96 | configMap: |
| 97 | name: {{ include "common.fullname" . }}-log |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 98 | {{- if (include "common.needTLS" .) }} |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 99 | - name: {{ include "common.fullname" . }}-nginx-conf |
| 100 | configMap: |
| 101 | name: {{ include "common.fullname" . }}-nginx |
Andreas Geissler | 8d87db2 | 2022-09-15 21:14:00 +0200 | [diff] [blame] | 102 | {{- end }} |
Maciej Wereski | 0763e6e | 2021-11-18 11:48:25 +0100 | [diff] [blame] | 103 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 8 }} |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 104 | - name: {{ include "common.fullname" . }}-logs |
| 105 | emptyDir: {} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 106 | - name: localtime |
| 107 | hostPath: |
| 108 | path: /etc/localtime |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 109 | imagePullSecrets: |
| 110 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |