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