Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 2 | # Copyright © 2017 Amdocs, AT&T, Bell Canada |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 3 | # Modifications Copyright © 2018 ZTE |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +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 | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
Mandeep Khinda | b1f9efe | 2018-03-28 19:01:55 +0000 | [diff] [blame] | 17 | |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 18 | apiVersion: apps/v1 |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 19 | kind: Deployment |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 20 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 21 | spec: |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 22 | selector: {{- include "common.selectors" . | nindent 4 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 23 | replicas: {{ .Values.replicaCount }} |
| 24 | template: |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 25 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 26 | spec: |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 27 | initContainers: |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 28 | - name: {{ include "common.name" . }}-readiness |
| 29 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 30 | - /app/ready.py |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 31 | args: |
| 32 | - --container-name |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 33 | - "sdc-onboarding-be" |
efiacor | 3422fe9 | 2022-07-12 13:19:53 +0100 | [diff] [blame] | 34 | {{- if not .Values.global.kafka.useKafka }} |
Sylvain Desbureaux | 29903c3 | 2021-12-06 14:39:02 +0100 | [diff] [blame] | 35 | - --container-name |
| 36 | - "message-router" |
efiacor | 3422fe9 | 2022-07-12 13:19:53 +0100 | [diff] [blame] | 37 | {{- end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 38 | env: |
| 39 | - name: NAMESPACE |
| 40 | valueFrom: |
| 41 | fieldRef: |
| 42 | apiVersion: v1 |
| 43 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 44 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 45 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 46 | resources: |
| 47 | limits: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame^] | 48 | cpu: "100m" |
| 49 | memory: "0.5Gi" |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 50 | requests: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame^] | 51 | cpu: "3m" |
| 52 | memory: "0.02Gi" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 53 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 54 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 55 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 56 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 57 | - /app/ready.py |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 58 | args: |
| 59 | - --job-name |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 60 | - {{ include "common.release" . }}-sdc-onboarding-be |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 61 | env: |
| 62 | - name: NAMESPACE |
| 63 | valueFrom: |
| 64 | fieldRef: |
| 65 | apiVersion: v1 |
| 66 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 67 | resources: |
| 68 | limits: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame^] | 69 | cpu: "100m" |
| 70 | memory: "0.5Gi" |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 71 | requests: |
Andreas Geissler | 4753743 | 2024-02-27 08:55:23 +0100 | [diff] [blame^] | 72 | cpu: "3m" |
| 73 | memory: "0.02Gi" |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 74 | containers: |
| 75 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 76 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 77 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 78 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 79 | {{ if eq .Values.liveness.enabled true }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 80 | livenessProbe: |
Yang Xu | e5d5e68 | 2019-06-19 18:20:31 -0400 | [diff] [blame] | 81 | httpGet: |
shrek2000 | f336f6d | 2020-02-25 16:11:26 +0200 | [diff] [blame] | 82 | path: /sdc2/rest/healthCheck |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 83 | port: {{ .Values.service.internalPort }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 84 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 85 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 86 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 87 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 88 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 89 | {{ end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 90 | readinessProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 91 | httpGet: |
| 92 | path: /sdc2/rest/healthCheck |
| 93 | port: {{ .Values.service.internalPort }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 94 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 95 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Yang Xu | 8560854 | 2019-06-16 23:25:32 -0400 | [diff] [blame] | 96 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 97 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 98 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 99 | startupProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 100 | httpGet: |
| 101 | path: /sdc2/rest/healthCheck |
| 102 | port: {{ .Values.service.internalPort }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 103 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 104 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 105 | timeoutSeconds: {{ .Values.startup.timeoutSeconds }} |
| 106 | successThreshold: {{ .Values.startup.successThreshold }} |
| 107 | failureThreshold: {{ .Values.startup.failureThreshold }} |
gummar | a72e6de | 2020-03-12 11:15:56 +0000 | [diff] [blame] | 108 | resources: {{ include "common.resources" . | nindent 12 }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 109 | env: |
| 110 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 111 | value: {{ .Values.env.name }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 112 | - name: JAVA_OPTIONS |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 113 | value: {{ .Values.config.javaOptions }} |
| 114 | - name: cassandra_ssl_enabled |
| 115 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 116 | - name: HOST_IP |
| 117 | valueFrom: |
| 118 | fieldRef: |
| 119 | fieldPath: status.podIP |
efiacor | 3422fe9 | 2022-07-12 13:19:53 +0100 | [diff] [blame] | 120 | {{- if .Values.global.kafka.useKafka }} |
| 121 | - name: SASL_JAAS_CONFIG |
efiacor | 2f1c2a2 | 2022-11-29 11:39:41 +0000 | [diff] [blame] | 122 | valueFrom: |
| 123 | secretKeyRef: |
| 124 | name: {{ include "common.name" . }}-ku |
| 125 | key: sasl.jaas.config |
efiacor | 3422fe9 | 2022-07-12 13:19:53 +0100 | [diff] [blame] | 126 | - name: USE_KAFKA |
| 127 | value: {{ .Values.global.kafka.useKafka | quote }} |
| 128 | {{- end }} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 129 | volumeMounts: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 130 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 131 | mountPath: /app/jetty/chef-solo/environments/ |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 132 | - name: localtime |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 133 | mountPath: /etc/localtime |
| 134 | readOnly: true |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 135 | - name: logs |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 136 | mountPath: /var/log/onap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 137 | - name: logback |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 138 | mountPath: /tmp/logback.xml |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 139 | subPath: logback.xml |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 140 | lifecycle: |
| 141 | postStart: |
| 142 | exec: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 143 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/app/jetty/config/catalog-be/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 144 | # side car containers |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 145 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | 1383b4c | 2021-04-06 12:33:31 +0200 | [diff] [blame] | 146 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame] | 147 | volumes: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 148 | - name: localtime |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 149 | hostPath: |
| 150 | path: /etc/localtime |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 151 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 152 | - name: logback |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 153 | configMap: |
| 154 | name : {{ include "common.fullname" . }}-logging-configmap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 155 | - name: sdc-environments |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 156 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 157 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 158 | defaultMode: 0755 |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 159 | - name: logs |
Mandeep Khinda | 403c1c1 | 2018-04-19 23:15:43 +0000 | [diff] [blame] | 160 | emptyDir: {} |
Mandeep Khinda | a1047f4 | 2018-03-22 02:12:15 +0000 | [diff] [blame] | 161 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 162 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |