2 # Copyright (c) 2019 IBM, Bell Canada
3 # Copyright (c) 2020 Samsung Electronics
4 # Modification Copyright © 2022-2023 Nordix Foundation
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
23 selector: {{- include "common.selectors" . | nindent 4 }}
24 replicas: {{ .Values.replicaCount }}
28 # This allows a new pod to be ready before terminating the old one
29 # causing no downtime when replicas is set to 1
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/
37 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
40 {{- if .Values.global.mariadbGalera.localCluster }}
41 {{- if .Values.global.mariadbGalera.useOperator }}
42 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local_operator ) | indent 6 | trim }}
44 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_local ) | indent 6 | trim }}
47 {{- if .Values.global.mariadbGalera.useOperator }}
48 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global_operator ) | indent 6 | trim }}
50 {{ include "common.readinessCheck.waitFor" (dict "dot" . "wait_for" .Values.readinessCheck.wait_for_global ) | indent 6 | trim }}
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"
59 - name: CDS_DB_USERNAME
60 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-db-user-creds" "key" "login") | indent 10}}
61 - name: CDS_DB_PASSWORD
62 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cds-db-user-creds" "key" "password") | indent 10}}
63 - name: SDNC_DB_USERNAME
65 - name: SDNC_DB_PASSWORD
66 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnc-db-root-pass" "key" "password") | indent 10}}
68 - mountPath: /config-input/application.properties
69 name: {{ include "common.fullname" . }}-config
70 subPath: application.properties
72 name: processed-config
73 image: {{ include "repositoryGenerator.image.envsubst" . }}
74 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
75 name: {{ include "common.name" . }}-update-config
81 - /opt/app/onap/blueprints/deploy
82 image: {{ include "repositoryGenerator.image.busybox" . }}
83 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 - mountPath: {{ .Values.persistence.deployedBlueprint }}
86 name: {{ include "common.fullname" . }}-blueprints
90 - name: {{ include "common.name" . }}
91 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
92 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
94 - name: APP_CONFIG_HOME
95 value: {{ .Values.config.appConfigDir }}
96 - name: CLUSTER_ENABLED
97 value: {{ if (gt (int (.Values.replicaCount)) 2) }} {{ .Values.cluster.enabled | quote }} {{ else }} "false" {{ end }}
99 value: {{ .Values.cluster.clusterName }}
100 - name: CLUSTER_NODE_ID
103 fieldPath: metadata.name
104 - name: CLUSTER_CONFIG_FILE
105 value: {{ .Values.config.appConfigDir }}/hazelcast.yaml
107 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-creds" "key" "login") | indent 12 }}
108 - name: CPS_PASS_PLAIN
109 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-creds" "key" "password") | indent 12 }}
110 - name: SASL_JAAS_PASS
113 name: {{ include "common.name" . }}-ku
116 - containerPort: {{ .Values.service.http.internalPort }}
117 - containerPort: {{ .Values.service.grpc.internalPort }}
118 - containerPort: {{ .Values.service.cluster.internalPort }}
121 path: /api/v1/execution-service/health-check
122 port: {{ .Values.startup.port }}
124 - name: Authorization
125 value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
126 initialDelaySeconds: {{ .Values.startup.initialDelaySeconds }}
127 failureThreshold: {{ .Values.startup.failureThreshold }}
128 periodSeconds: {{ .Values.startup.periodSeconds }}
129 # disable liveness probe when breakpoints set in debugger
130 # so K8s doesn't restart unresponsive container
131 {{ if .Values.liveness.enabled }}
134 path: /api/v1/execution-service/health-check
135 port: {{ .Values.liveness.port }}
137 - name: Authorization
138 value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
139 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
140 periodSeconds: {{ .Values.liveness.periodSeconds }}
141 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
145 path: /api/v1/execution-service/health-check
146 port: {{ .Values.readiness.port }}
148 - name: Authorization
149 value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
150 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
151 periodSeconds: {{ .Values.readiness.periodSeconds }}
152 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
154 - mountPath: /etc/localtime
157 - mountPath: {{ .Values.config.appConfigDir }}/application.properties
158 name: processed-config
159 subPath: application.properties
160 - mountPath: {{ .Values.config.appConfigDir }}/error-messages_en.properties
161 name: {{ include "common.fullname" . }}-config
162 subPath: error-messages_en.properties
163 - mountPath: {{ .Values.config.appConfigDir }}/logback.xml
164 name: {{ include "common.fullname" . }}-config
166 - mountPath: {{ .Values.config.appConfigDir }}/hazelcast.yaml
167 name: {{ include "common.fullname" . }}-config
168 subPath: hazelcast.yaml
169 - mountPath: {{ .Values.persistence.deployedBlueprint }}
170 name: {{ include "common.fullname" . }}-blueprints
171 resources: {{ include "common.resources" . | nindent 12 }}
172 {{- if .Values.nodeSelector }}
174 {{ toYaml .Values.nodeSelector | indent 10 }}
176 {{- if .Values.affinity }}
178 {{ toYaml .Values.affinity | indent 10 }}
180 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
185 - name: {{ include "common.fullname" . }}-config
187 name: {{ include "common.fullname" . }}-configmap
189 - key: application.properties
190 path: application.properties
191 - key: error-messages_en.properties
192 path: error-messages_en.properties
195 - key: hazelcast.yaml
197 - name: {{ include "common.fullname" . }}-blueprints
198 persistentVolumeClaim:
199 claimName: {{ include "common.release" . }}-cds-blueprints
200 - name: processed-config
203 {{- include "common.imagePullSecrets" . | nindent 6 }}