Jakub Latusek | 5053076 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 2 | # Copyright (c) 2019 IBM, Bell Canada |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 3 | # Copyright (c) 2020 Samsung Electronics |
efiacor | ecbae13 | 2022-03-04 15:01:30 +0000 | [diff] [blame] | 4 | # Modification Copyright © 2022 Nordix Foundation |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [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 | 5053076 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 17 | */}} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 18 | |
Grzegorz-Lis | 9bd9878 | 2020-07-27 15:22:28 +0200 | [diff] [blame] | 19 | apiVersion: apps/v1 |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 20 | kind: Deployment |
| 21 | metadata: |
| 22 | name: {{ include "common.fullname" . }} |
| 23 | namespace: {{ include "common.namespace" . }} |
| 24 | labels: |
| 25 | app: {{ include "common.name" . }} |
| 26 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 27 | release: {{ include "common.release" . }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 28 | heritage: {{ .Release.Service }} |
| 29 | spec: |
Grzegorz-Lis | 9bd9878 | 2020-07-27 15:22:28 +0200 | [diff] [blame] | 30 | selector: |
| 31 | matchLabels: |
| 32 | app: {{ include "common.name" . }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 33 | replicas: {{ .Values.replicaCount }} |
Sebastien Premont-Tendland | b679d7b | 2020-02-17 11:32:15 -0500 | [diff] [blame] | 34 | strategy: |
| 35 | type: RollingUpdate |
| 36 | rollingUpdate: |
| 37 | # This allow a new pod to be ready before terminating the old one |
| 38 | # causing no downtime when replicas is set to 1 |
| 39 | maxUnavailable: 0 |
| 40 | |
| 41 | # maxSurge to 1 is very important for the hazelcast integration |
| 42 | # we only want one pod at a time to restart not multiple |
| 43 | # and break the hazelcast cluster. We should not use % maxSurge value |
| 44 | # ref : https://hazelcast.com/blog/rolling-upgrade-hazelcast-imdg-on-kubernetes/ |
| 45 | maxSurge: 1 |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 46 | template: |
| 47 | metadata: |
| 48 | labels: |
| 49 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 50 | release: {{ include "common.release" . }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 51 | spec: |
Abdelmuhaimen Seaudi | 822eb09 | 2021-09-04 11:08:36 +0200 | [diff] [blame] | 52 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 53 | - command: |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 54 | - sh |
| 55 | args: |
| 56 | - -c |
Konrad Bańka | 031bdb7 | 2020-05-14 16:56:39 +0200 | [diff] [blame] | 57 | - "cd /config-input && for PFILE in `ls -1 .`; do envsubst '${CDS_DB_USERNAME},${CDS_DB_PASSWORD},${SDNC_DB_USERNAME},${SDNC_DB_PASSWORD}' <${PFILE} >/config/${PFILE}; done" |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 58 | env: |
| 59 | - name: CDS_DB_USERNAME |
Krzysztof Opasiak | 28d194f | 2020-03-24 03:27:32 +0100 | [diff] [blame] | 60 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-db-user-creds" "key" "login") | indent 10}} |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 61 | - name: CDS_DB_PASSWORD |
Krzysztof Opasiak | 28d194f | 2020-03-24 03:27:32 +0100 | [diff] [blame] | 62 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-db-user-creds" "key" "password") | indent 10}} |
Konrad Bańka | 031bdb7 | 2020-05-14 16:56:39 +0200 | [diff] [blame] | 63 | - name: SDNC_DB_USERNAME |
| 64 | value: root |
| 65 | - name: SDNC_DB_PASSWORD |
| 66 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnc-db-root-pass" "key" "password") | indent 10}} |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 67 | volumeMounts: |
| 68 | - mountPath: /config-input/application.properties |
| 69 | name: {{ include "common.fullname" . }}-config |
| 70 | subPath: application.properties |
| 71 | - mountPath: /config |
| 72 | name: processed-config |
Sylvain Desbureaux | 503b229 | 2020-11-21 22:29:17 +0100 | [diff] [blame] | 73 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 74 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 75 | name: {{ include "common.name" . }}-update-config |
| 76 | |
| 77 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 78 | - /app/ready.py |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 79 | args: |
| 80 | - --container-name |
Alexis de Talhouët | 63df163 | 2019-03-20 08:17:58 -0400 | [diff] [blame] | 81 | - cds-db |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 82 | env: |
| 83 | - name: NAMESPACE |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | apiVersion: v1 |
| 87 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 503b229 | 2020-11-21 22:29:17 +0100 | [diff] [blame] | 88 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 89 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 90 | name: {{ include "common.name" . }}-readiness |
jananib | b38185a | 2020-04-23 19:33:45 +0530 | [diff] [blame] | 91 | - name: fix-permission |
| 92 | command: |
| 93 | - chown |
| 94 | - -R |
root@nfs | 4b8e075 | 2020-06-10 23:15:10 +0000 | [diff] [blame] | 95 | - 1000:1000 |
jananib | b38185a | 2020-04-23 19:33:45 +0530 | [diff] [blame] | 96 | - /opt/app/onap/blueprints/deploy |
Sylvain Desbureaux | 503b229 | 2020-11-21 22:29:17 +0100 | [diff] [blame] | 97 | image: {{ include "repositoryGenerator.image.busybox" . }} |
jananib | b38185a | 2020-04-23 19:33:45 +0530 | [diff] [blame] | 98 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 99 | volumeMounts: |
| 100 | - mountPath: {{ .Values.persistence.deployedBlueprint }} |
| 101 | name: {{ include "common.fullname" . }}-blueprints |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 102 | containers: |
| 103 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 503b229 | 2020-11-21 22:29:17 +0100 | [diff] [blame] | 104 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 105 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 106 | env: |
| 107 | - name: APP_CONFIG_HOME |
| 108 | value: {{ .Values.config.appConfigDir }} |
Sebastien Premont-Tendland | b679d7b | 2020-02-17 11:32:15 -0500 | [diff] [blame] | 109 | - name: CLUSTER_ENABLED |
Julien Fontaine | 063a7a8 | 2020-12-17 13:51:38 -0500 | [diff] [blame] | 110 | value: {{ if (gt (int (.Values.replicaCount)) 2) }} {{ .Values.cluster.enabled | quote }} {{ else }} "false" {{ end }} |
Sebastien Premont-Tendland | b679d7b | 2020-02-17 11:32:15 -0500 | [diff] [blame] | 111 | - name: CLUSTER_ID |
| 112 | value: {{ .Values.cluster.clusterName }} |
Abdelmuhaimen Seaudi | 822eb09 | 2021-09-04 11:08:36 +0200 | [diff] [blame] | 113 | - name: AAF_CREDSPATH |
| 114 | value: {{ .Values.certInitializer.credsPath }} |
Sebastien Premont-Tendland | b679d7b | 2020-02-17 11:32:15 -0500 | [diff] [blame] | 115 | - name: CLUSTER_NODE_ID |
| 116 | valueFrom: |
| 117 | fieldRef: |
| 118 | fieldPath: metadata.name |
| 119 | - name: CLUSTER_CONFIG_FILE |
| 120 | value: {{ .Values.config.appConfigDir }}/hazelcast.yaml |
Michal Jagiello | 2cef564 | 2022-06-27 10:08:41 +0000 | [diff] [blame] | 121 | - name: CPS_USER |
| 122 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-creds" "key" "login") | indent 12 }} |
| 123 | - name: CPS_PASS_PLAIN |
| 124 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-creds" "key" "password") | indent 12 }} |
efiacor | ecbae13 | 2022-03-04 15:01:30 +0000 | [diff] [blame] | 125 | {{ if .Values.useStrimziKafka }} |
| 126 | - name: JAAS_PASS |
| 127 | value: {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-kafka-secret" "key" "password") | indent 12 }} |
| 128 | {{ end }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 129 | ports: |
| 130 | - containerPort: {{ .Values.service.http.internalPort }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 131 | - containerPort: {{ .Values.service.grpc.internalPort }} |
Sebastien Premont-Tendland | b679d7b | 2020-02-17 11:32:15 -0500 | [diff] [blame] | 132 | - containerPort: {{ .Values.service.cluster.internalPort }} |
Jozsef Csongvai | 08515b7 | 2021-04-28 17:04:57 -0400 | [diff] [blame] | 133 | startupProbe: |
| 134 | httpGet: |
| 135 | path: /api/v1/execution-service/health-check |
| 136 | port: {{ .Values.service.http.internalPort }} |
| 137 | httpHeaders: |
| 138 | - name: Authorization |
| 139 | value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== |
| 140 | initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }} |
| 141 | failureThreshold: {{ .Values.startup.failureThreshold }} |
| 142 | periodSeconds: {{ .Values.startup.periodSeconds }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 143 | # disable liveness probe when breakpoints set in debugger |
| 144 | # so K8s doesn't restart unresponsive container |
| 145 | {{ if .Values.liveness.enabled }} |
| 146 | livenessProbe: |
| 147 | httpGet: |
Alexis de Talhouët | 892564f | 2019-07-17 08:15:07 -0400 | [diff] [blame] | 148 | path: /api/v1/execution-service/health-check |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 149 | port: {{ .Values.service.http.internalPort }} |
Munir Ahmad | 597db66 | 2019-03-26 08:17:11 -0400 | [diff] [blame] | 150 | httpHeaders: |
| 151 | - name: Authorization |
| 152 | value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 153 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 154 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
Oleg Mitsura | 3a62118 | 2019-10-09 12:40:11 -0400 | [diff] [blame] | 155 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 156 | {{ end }} |
| 157 | readinessProbe: |
| 158 | httpGet: |
Alexis de Talhouët | 892564f | 2019-07-17 08:15:07 -0400 | [diff] [blame] | 159 | path: /api/v1/execution-service/health-check |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 160 | port: {{ .Values.service.http.internalPort }} |
Munir Ahmad | 597db66 | 2019-03-26 08:17:11 -0400 | [diff] [blame] | 161 | httpHeaders: |
| 162 | - name: Authorization |
| 163 | value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw== |
Oleg Mitsura | bad9934 | 2019-10-28 14:06:42 -0400 | [diff] [blame] | 164 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 165 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 166 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
Abdelmuhaimen Seaudi | 822eb09 | 2021-09-04 11:08:36 +0200 | [diff] [blame] | 167 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 168 | - mountPath: /etc/localtime |
| 169 | name: localtime |
| 170 | readOnly: true |
| 171 | - mountPath: {{ .Values.config.appConfigDir }}/application.properties |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 172 | name: processed-config |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 173 | subPath: application.properties |
Steve Siani | 3925d7f | 2020-03-14 12:15:50 -0400 | [diff] [blame] | 174 | - mountPath: {{ .Values.config.appConfigDir }}/error-messages_en.properties |
| 175 | name: {{ include "common.fullname" . }}-config |
| 176 | subPath: error-messages_en.properties |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 177 | - mountPath: {{ .Values.config.appConfigDir }}/logback.xml |
| 178 | name: {{ include "common.fullname" . }}-config |
| 179 | subPath: logback.xml |
Sebastien Premont-Tendland | b679d7b | 2020-02-17 11:32:15 -0500 | [diff] [blame] | 180 | - mountPath: {{ .Values.config.appConfigDir }}/hazelcast.yaml |
| 181 | name: {{ include "common.fullname" . }}-config |
| 182 | subPath: hazelcast.yaml |
Abdelmuhaimen Seaudi | 204c64e | 2019-07-25 19:04:01 +0000 | [diff] [blame] | 183 | |
| 184 | - mountPath: {{ .Values.config.appConfigDir }}/ONAP_RootCA.cer |
| 185 | name: {{ include "common.fullname" . }}-config |
| 186 | subPath: ONAP_RootCA.cer |
| 187 | |
Alexis de Talhouët | 108e28f | 2019-04-14 18:54:56 -0400 | [diff] [blame] | 188 | - mountPath: {{ .Values.persistence.deployedBlueprint }} |
| 189 | name: {{ include "common.fullname" . }}-blueprints |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 190 | resources: {{ include "common.resources" . | nindent 12 }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 191 | {{- if .Values.nodeSelector }} |
| 192 | nodeSelector: |
| 193 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 194 | {{- end -}} |
| 195 | {{- if .Values.affinity }} |
| 196 | affinity: |
| 197 | {{ toYaml .Values.affinity | indent 10 }} |
| 198 | {{- end }} |
farida azmy | ffad032 | 2021-04-09 14:18:14 +0200 | [diff] [blame] | 199 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
Abdelmuhaimen Seaudi | 822eb09 | 2021-09-04 11:08:36 +0200 | [diff] [blame] | 200 | volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 201 | - name: localtime |
| 202 | hostPath: |
| 203 | path: /etc/localtime |
| 204 | - name: {{ include "common.fullname" . }}-config |
| 205 | configMap: |
| 206 | name: {{ include "common.fullname" . }}-configmap |
| 207 | items: |
| 208 | - key: application.properties |
| 209 | path: application.properties |
Steve Siani | 3925d7f | 2020-03-14 12:15:50 -0400 | [diff] [blame] | 210 | - key: error-messages_en.properties |
| 211 | path: error-messages_en.properties |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 212 | - key: logback.xml |
| 213 | path: logback.xml |
Sebastien Premont-Tendland | b679d7b | 2020-02-17 11:32:15 -0500 | [diff] [blame] | 214 | - key: hazelcast.yaml |
| 215 | path: hazelcast.yaml |
Abdelmuhaimen Seaudi | a451fd6 | 2019-09-10 14:21:04 +0000 | [diff] [blame] | 216 | - key: ONAP_RootCA.cer |
| 217 | path: ONAP_RootCA.cer |
Alexis de Talhouët | 108e28f | 2019-04-14 18:54:56 -0400 | [diff] [blame] | 218 | - name: {{ include "common.fullname" . }}-blueprints |
| 219 | persistentVolumeClaim: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 220 | claimName: {{ include "common.release" . }}-cds-blueprints |
Krzysztof Opasiak | 32f9aaa | 2020-02-06 23:05:15 +0100 | [diff] [blame] | 221 | - name: processed-config |
| 222 | emptyDir: |
| 223 | medium: Memory |
Steve Alphonse Siani | a1b6b0e | 2019-01-25 15:23:58 -0500 | [diff] [blame] | 224 | imagePullSecrets: |
| 225 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |