1 # Copyright (c) 2019 IBM, Bell Canada
2 # Copyright (c) 2020 Samsung Electronics
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 apiVersion: extensions/v1beta1
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24 release: {{ include "common.release" . }}
25 heritage: {{ .Release.Service }}
27 replicas: {{ .Values.replicaCount }}
31 # This allow a new pod to be ready before terminating the old one
32 # causing no downtime when replicas is set to 1
35 # maxSurge to 1 is very important for the hazelcast integration
36 # we only want one pod at a time to restart not multiple
37 # and break the hazelcast cluster. We should not use % maxSurge value
38 # ref : https://hazelcast.com/blog/rolling-upgrade-hazelcast-imdg-on-kubernetes/
43 app: {{ include "common.name" . }}
44 release: {{ include "common.release" . }}
51 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst '${CDS_DB_USERNAME},${CDS_DB_PASSWORD},${CDS_DB_ROOT_PASSWORD}' <${PFILE} >/config/${PFILE}; done"
53 - name: CDS_DB_USERNAME
54 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "cds-db-user-creds" "key" "login") | indent 10}}
55 - name: CDS_DB_PASSWORD
56 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "cds-db-user-creds" "key" "password") | indent 10}}
57 - name: CDS_DB_ROOT_PASSWORD
58 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "cds-db-root-pass" "key" "password") | indent 10}}
61 - mountPath: /config-input/application.properties
62 name: {{ include "common.fullname" . }}-config
63 subPath: application.properties
65 name: processed-config
66 image: "{{ .Values.global.envsubstImage }}"
67 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
68 name: {{ include "common.name" . }}-update-config
75 {{- if .Values.dmaapEnabled }}
84 fieldPath: metadata.namespace
85 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
86 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
87 name: {{ include "common.name" . }}-readiness
89 - name: {{ include "common.name" . }}
90 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
91 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 - name: APP_CONFIG_HOME
94 value: {{ .Values.config.appConfigDir }}
95 - name: USE_SCRIPT_COMPILE_CACHE
96 value: {{ .Values.config.useScriptCompileCache | quote }}
97 # Cluster should only be enabled when replicaCount is more than 2 and useScriptCompileCache is set to false otherwise it won't work properly
98 - name: CLUSTER_ENABLED
99 value: {{ if and (gt (int (.Values.replicaCount)) 2) (not .Values.config.useScriptCompileCache) }} {{ .Values.cluster.enabled | quote }} {{ else }} "false" {{ end }}
101 value: {{ .Values.cluster.clusterName }}
102 - name: CLUSTER_NODE_ID
105 fieldPath: metadata.name
106 - name: CLUSTER_CONFIG_FILE
107 value: {{ .Values.config.appConfigDir }}/hazelcast.yaml
109 - containerPort: {{ .Values.service.http.internalPort }}
110 - containerPort: {{ .Values.service.grpc.internalPort }}
111 - containerPort: {{ .Values.service.cluster.internalPort }}
112 # disable liveness probe when breakpoints set in debugger
113 # so K8s doesn't restart unresponsive container
114 {{ if .Values.liveness.enabled }}
117 path: /api/v1/execution-service/health-check
118 port: {{ .Values.service.http.internalPort }}
120 - name: Authorization
121 value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
122 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
123 periodSeconds: {{ .Values.liveness.periodSeconds }}
124 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
128 path: /api/v1/execution-service/health-check
129 port: {{ .Values.service.http.internalPort }}
131 - name: Authorization
132 value: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
133 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
134 periodSeconds: {{ .Values.readiness.periodSeconds }}
135 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
137 - mountPath: /etc/localtime
140 - mountPath: {{ .Values.config.appConfigDir }}/application.properties
141 name: processed-config
142 subPath: application.properties
143 - mountPath: {{ .Values.config.appConfigDir }}/error-messages_en.properties
144 name: {{ include "common.fullname" . }}-config
145 subPath: error-messages_en.properties
146 - mountPath: {{ .Values.config.appConfigDir }}/logback.xml
147 name: {{ include "common.fullname" . }}-config
149 - mountPath: {{ .Values.config.appConfigDir }}/hazelcast.yaml
150 name: {{ include "common.fullname" . }}-config
151 subPath: hazelcast.yaml
153 - mountPath: {{ .Values.config.appConfigDir }}/ONAP_RootCA.cer
154 name: {{ include "common.fullname" . }}-config
155 subPath: ONAP_RootCA.cer
157 - mountPath: {{ .Values.persistence.deployedBlueprint }}
158 name: {{ include "common.fullname" . }}-blueprints
160 {{ include "common.resources" . | indent 12 }}
161 {{- if .Values.nodeSelector }}
163 {{ toYaml .Values.nodeSelector | indent 10 }}
165 {{- if .Values.affinity }}
167 {{ toYaml .Values.affinity | indent 10 }}
173 - name: {{ include "common.fullname" . }}-config
175 name: {{ include "common.fullname" . }}-configmap
177 - key: application.properties
178 path: application.properties
179 - key: error-messages_en.properties
180 path: error-messages_en.properties
183 - key: hazelcast.yaml
185 - key: ONAP_RootCA.cer
186 path: ONAP_RootCA.cer
187 - name: {{ include "common.fullname" . }}-blueprints
188 persistentVolumeClaim:
189 claimName: {{ include "common.release" . }}-cds-blueprints
190 - name: processed-config
194 - name: "{{ include "common.namespace" . }}-docker-registry-key"