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