Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +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 |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 4 | # Modifications Copyright © 2021 Orange |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
Jakub Latusek | d8eaff6 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 17 | */}} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 18 | |
kwasiel | 59cc6a4 | 2020-07-23 10:02:49 +0000 | [diff] [blame] | 19 | apiVersion: apps/v1 |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 20 | kind: Deployment |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 21 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 22 | spec: |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 23 | selector: {{- include "common.selectors" . | nindent 4 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 24 | replicas: {{ .Values.replicaCount }} |
| 25 | template: |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 26 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 27 | spec: |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 28 | initContainers: |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 29 | - name: {{ include "common.name" . }}-job-completion |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 30 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 31 | imagePullPolicy: "{{ .Values.global.pullPolicy | default .Values.pullPolicy }}" |
| 32 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 33 | - /app/ready.py |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 34 | args: |
| 35 | - --job-name |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 36 | - {{ include "common.release" . }}-sdc-onboarding-be |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 37 | env: |
| 38 | - name: NAMESPACE |
| 39 | valueFrom: |
| 40 | fieldRef: |
| 41 | apiVersion: v1 |
| 42 | fieldPath: metadata.namespace |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 43 | resources: |
| 44 | limits: |
| 45 | cpu: 100m |
| 46 | memory: 100Mi |
| 47 | requests: |
| 48 | cpu: 3m |
| 49 | memory: 20Mi |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 50 | containers: |
| 51 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 0a1eaf3 | 2020-11-19 17:56:08 +0100 | [diff] [blame] | 52 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 54 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 55 | {{ if eq .Values.liveness.enabled true }} |
| 56 | livenessProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 57 | httpGet: |
| 58 | path: /onboarding-api/v1.0/healthcheck |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 59 | port: {{ .Values.service.internalPort }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 60 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 61 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Brian Freeman | 6142d94 | 2019-10-02 09:50:19 -0500 | [diff] [blame] | 62 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 63 | successThreshold: {{ .Values.liveness.successThreshold }} |
| 64 | failureThreshold: {{ .Values.liveness.failureThreshold }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 65 | {{ end }} |
| 66 | readinessProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 67 | httpGet: |
| 68 | path: /onboarding-api/v1.0/healthcheck |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 69 | port: {{ .Values.service.internalPort }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 70 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 71 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 72 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
| 73 | successThreshold: {{ .Values.readiness.successThreshold }} |
| 74 | failureThreshold: {{ .Values.readiness.failureThreshold }} |
| 75 | startupProbe: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 76 | httpGet: |
| 77 | path: /onboarding-api/v1.0/healthcheck |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 78 | port: {{ .Values.service.internalPort }} |
Sylvain Desbureaux | 8c9416b | 2021-05-05 11:12:48 +0200 | [diff] [blame] | 79 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 80 | periodSeconds: {{ .Values.startup.periodSeconds }} |
| 81 | timeoutSeconds: {{ .Values.startup.timeoutSeconds }} |
| 82 | successThreshold: {{ .Values.startup.successThreshold }} |
| 83 | failureThreshold: {{ .Values.startup.failureThreshold }} |
ChrisC | 3217234 | 2020-10-02 16:39:13 +0200 | [diff] [blame] | 84 | resources: {{ include "common.resources" . | nindent 12 }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 85 | env: |
| 86 | - name: ENVNAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 87 | value: {{ .Values.env.name }} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 88 | - name: JAVA_OPTIONS |
| 89 | value: {{ .Values.config.javaOptions }} |
| 90 | - name: SDC_CLUSTER_NAME |
ChrisC | 742a7b2 | 2020-09-04 11:29:57 +0200 | [diff] [blame] | 91 | value: "SDC-CS-{{ .Values.env.name }}" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 92 | - name: cassandra_ssl_enabled |
| 93 | value: {{ .Values.config.cassandraSslEnabled | quote }} |
| 94 | - name: HOST_IP |
| 95 | valueFrom: |
| 96 | fieldRef: |
| 97 | fieldPath: status.podIP |
| 98 | - name: SDC_USER |
| 99 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 100 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_user} |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 101 | - name: SDC_PASSWORD |
| 102 | valueFrom: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 103 | secretKeyRef: {name: {{ include "common.release" . }}-sdc-cs-secrets, key: sdc_password} |
kooper | 543d3aa | 2019-05-02 10:27:15 +0000 | [diff] [blame] | 104 | - name: SDC_CERT_DIR |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 105 | value: "" |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 106 | volumeMounts: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 107 | - name: sdc-environments |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 108 | mountPath: /app/jetty/chef-solo/environments/ |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 109 | - name: localtime |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 110 | mountPath: /etc/localtime |
| 111 | readOnly: true |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 112 | - name: logs |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 113 | mountPath: /var/log/onap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 114 | - name: logback |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 115 | mountPath: /tmp/logback.xml |
| 116 | subPath: logback.xml |
| 117 | lifecycle: |
| 118 | postStart: |
| 119 | exec: |
Joanna Jeremicz | fe52bf5 | 2021-04-21 14:31:29 +0200 | [diff] [blame] | 120 | command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/app/jetty/config/onboarding-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 | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 121 | # side car containers |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 122 | {{ include "common.log.sidecar" . | nindent 8 }} |
farida azmy | 1383b4c | 2021-04-06 12:33:31 +0200 | [diff] [blame] | 123 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Andreas Geissler | dd34ead | 2023-03-20 17:16:45 +0100 | [diff] [blame^] | 124 | volumes: |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 125 | - name: localtime |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 126 | hostPath: |
| 127 | path: /etc/localtime |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 128 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 129 | - name: logback |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 130 | configMap: |
| 131 | name : {{ include "common.fullname" . }}-logging-configmap |
othman touijer | 2b764d0 | 2022-01-05 14:40:37 +0100 | [diff] [blame] | 132 | - name: sdc-environments |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 133 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 134 | name: {{ include "common.release" . }}-sdc-environments-configmap |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 135 | defaultMode: 0755 |
Maciej Wereski | 771ec2a | 2021-10-14 13:59:12 +0000 | [diff] [blame] | 136 | - name: logs |
Mandeep Khinda | 51a8b1b | 2018-04-24 20:05:32 +0000 | [diff] [blame] | 137 | emptyDir: {} |
| 138 | imagePullSecrets: |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 139 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |