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