blob: ffff46fab50efbba70ba556729b50090e73ece11 [file] [log] [blame]
Jack Lucasd41dbdb2021-02-16 11:07:28 -05001{{/*
2#============LICENSE_START========================================================
3# ================================================================================
4# Copyright (c) 2021 J. F. Lucas. All rights reserved.
vv770de8c5c682021-04-15 12:21:36 -04005# Copyright (c) 2021 AT&T Intellectual Property. All rights reserved.
Piotr Marcinkiewicz70625182021-04-29 17:02:37 +02006# Copyright (c) 2021 Nokia. All rights reserved.
Jack Lucasd41dbdb2021-02-16 11:07:28 -05007# ================================================================================
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19# ============LICENSE_END=========================================================
20*/}}
21{{/*
Jack Lucascbca57d2021-04-05 09:49:46 -040022For internal use only!
23
24dcaegen2-services-common._ms-specific-env-vars:
25This template generates a list of microservice-specific environment variables
26as specified in .Values.applicationEnv. The
27dcaegen2-services-common.microServiceDeployment uses this template
28to add the microservice-specific environment variables to the microservice's container.
29These environment variables are in addition to a standard set of environment variables
30provided to all microservices.
31
32The template expects a single argument, pointing to the caller's global context.
33
34Microservice-specific environment variables can be specified in two ways:
35 1. As literal string values.
36 2. As values that are sourced from a secret, identified by the secret's
37 uid and the key within the secret that provides the value.
38
39The following example shows an example of each type. The example assumes
40that a secret has been created using the OOM common secret mechanism, with
41a secret uid "example-secret" and a key called "password".
42
43applicationEnv:
44 APPLICATION_PASSWORD:
45 secretUid: example-secret
46 key: password
47 APPLICATION_EXAMPLE: "An example value"
48
49The example would set two environment variables on the microservice's container,
50one called "APPLICATION_PASSWORD" with the value set from the "password" key in
51the secret with uid "example-secret", and one called "APPLICATION_EXAMPLE" set to
52the the literal string "An example value".
53*/}}
54{{- define "dcaegen2-services-common._ms-specific-env-vars" -}}
55 {{- $global := . }}
56 {{- if .Values.applicationEnv }}
57 {{- range $envName, $envValue := .Values.applicationEnv }}
58 {{- if kindIs "string" $envValue }}
59- name: {{ $envName }}
60 value: {{ $envValue | quote }}
61 {{- else }}
62 {{ if or (not $envValue.secretUid) (not $envValue.key) }}
63 {{ fail (printf "Env %s definition is not a string and does not contain secretUid or key fields" $envName) }}
64 {{- end }}
65- name: {{ $envName }}
66 {{- include "common.secret.envFromSecretFast" (dict "global" $global "uid" $envValue.secretUid "key" $envValue.key) | indent 2 }}
67 {{- end -}}
68 {{- end }}
69 {{- end }}
70{{- end -}}
71{{/*
Jack Lucase5f71602021-05-10 12:00:02 -040072For internal use only!
73
74dcaegen2-services-common._externalVolumes:
75This template generates a list of volumes associated with the pod,
76based on information provided in .Values.externalVolumes. This
77template works in conjunction with dcaegen2-services-common._externalVolumeMounts
78to give the microservice access to data in volumes created else.
79This initial implementation supports ConfigMaps only, as this is the only
80external volume mounting required by current microservices.
81
Jack Lucasb880f892021-06-07 16:40:31 -040082.Values.externalVolumes is a list of objects. Each object has 3 required fields and 2 optional fields:
Jack Lucase5f71602021-05-10 12:00:02 -040083 - name: the name of the resource (in the current implementation, it must be a ConfigMap)
84 that is to be set up as a volume. The value is a case sensitive string. Because the
85 names of resources are sometimes set at deployment time (for instance, to prefix the Helm
86 release to the name), the string can be a Helm template fragment that will be expanded at
87 deployment time.
88 - type: the type of the resource (in the current implementation, only "ConfigMap" is supported).
89 The value is a case-INsensitive string.
90 - mountPoint: the path to the mount point for the volume in the container file system. The
91 value is a case-sensitive string.
92 - readOnly: (Optional) Boolean flag. Set to true to mount the volume as read-only.
93 Defaults to false.
Jack Lucasb880f892021-06-07 16:40:31 -040094 - optional: (Optional) Boolean flag. Set to true to make the configMap optional (i.e., to allow the
95 microservice's pod to start even if the configMap doesn't exist). If set to false, the configMap must
96 be present in order for the microservice's pod to start. Defaults to true. (Note that this
97 default is the opposite of the Kubernetes default. We've done this to be consistent with the behavior
98 of the DCAE Cloudify plugin for Kubernetes [k8splugin], which always set "optional" to true.)
Jack Lucase5f71602021-05-10 12:00:02 -040099
100Here is an example fragment from a values.yaml file for a microservice:
101
102externalVolumes:
103 - name: my-example-configmap
104 type: configmap
105 mountPath: /opt/app/config
106 - name: '{{ include "common.release" . }}-another-example'
107 type: configmap
108 mountPath: /opt/app/otherconfig
Jack Lucasb880f892021-06-07 16:40:31 -0400109 optional: false
Jack Lucase5f71602021-05-10 12:00:02 -0400110*/}}
111{{- define "dcaegen2-services-common._externalVolumes" -}}
112 {{- $global := . -}}
113 {{- if .Values.externalVolumes }}
114 {{- range $vol := .Values.externalVolumes }}
115 {{- if eq (lower $vol.type) "configmap" }}
Jack Lucasb880f892021-06-07 16:40:31 -0400116 {{- $vname := (tpl $vol.name $global) -}}
117 {{- $opt := hasKey $vol "optional" | ternary $vol.optional true }}
Jack Lucase5f71602021-05-10 12:00:02 -0400118- configMap:
119 defaultMode: 420
120 name: {{ $vname }}
Jack Lucasb880f892021-06-07 16:40:31 -0400121 optional: {{ $opt }}
Jack Lucase5f71602021-05-10 12:00:02 -0400122 name: {{ $vname }}
123 {{- end }}
124 {{- end }}
125 {{- end }}
126{{- end }}
127{{/*
128For internal use only!
129
130dcaegen2-services-common._externalVolumeMounts:
131This template generates a list of volume mounts for the microservice container,
132based on information provided in .Values.externalVolumes. This
133template works in conjunction with dcaegen2-services-common._externalVolumes
134to give the microservice access to data in volumes created else.
135This initial implementation supports ConfigMaps only, as this is the only
136external volume mounting required by current microservices.
137
138See the documentation for dcaegen2-services-common._externalVolumes for
139details on how external volumes are specified in the values.yaml file for
140the microservice.
141*/}}
142{{- define "dcaegen2-services-common._externalVolumeMounts" -}}
143 {{- $global := . -}}
144 {{- if .Values.externalVolumes }}
145 {{- range $vol := .Values.externalVolumes }}
146 {{- if eq (lower $vol.type) "configmap" }}
147 {{- $vname := (tpl $vol.name $global) -}}
148 {{- $readOnly := $vol.readOnly | default false }}
149- mountPath: {{ $vol.mountPath }}
150 name: {{ $vname }}
151 readOnly: {{ $readOnly }}
152 {{- end }}
153 {{- end }}
154 {{- end }}
155{{- end }}
156{{/*
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500157dcaegen2-services-common.microserviceDeployment:
158This template produces a Kubernetes Deployment for a DCAE microservice.
159
160All DCAE microservices currently use very similar Deployments. Having a
161common template eliminates a lot of repetition in the individual charts
162for each microservice.
163
164The template expects the full chart context as input. A chart for a
165DCAE microservice references this template using:
166{{ include "dcaegen2-services-common.microserviceDeployment" . }}
167The template directly references data in .Values, and indirectly (through its
168use of templates from the ONAP "common" collection) references data in
169.Release.
170
171The exact content of the Deployment generated from this template
172depends on the content of .Values.
173
174The Deployment always includes a single Pod, with a container that uses
175the DCAE microservice image.
176
177The Deployment Pod may also include a logging sidecar container.
178The sidecar is included if .Values.logDirectory is set. The
179logging sidecar and the DCAE microservice container share a
180volume where the microservice logs are written.
181
182The Deployment includes an initContainer that pushes the
183microservice's initial configuration (from .Values.applicationConfig)
184into Consul. All DCAE microservices retrieve their initial
185configurations by making an API call to a DCAE platform component called
186the config-binding-service. The config-binding-service currently
187retrieves configuration information from Consul.
188
189The Deployment also includes an initContainer that checks for the
190readiness of other components that the microservice relies on.
191This container is generated by the "common.readinessCheck.waitfor"
192template.
193
194If the microservice acts as a TLS client or server, the Deployment will
195include an initContainer that retrieves certificate information from
196the AAF certificate manager. The information is mounted at the
197mount point specified in .Values.certDirectory. If the microservice is
198a TLS server (indicated by setting .Values.tlsServer to true), the
199certificate information will include a server cert and key, in various
200formats. It will also include the AAF CA cert. If the microservice is
201a TLS client only (indicated by setting .Values.tlsServer to false), the
202certificate information includes only the AAF CA cert.
vv770de8c5c682021-04-15 12:21:36 -0400203
204Deployed POD may also include a Policy-sync sidecar container.
205The sidecar is included if .Values.policies is set. The
206Policy-sync sidecar polls PolicyEngine (PDP) periodically based
207on .Values.policies.duration and configuration retrieved is shared with
208DCAE Microservice container by common volume. Policy can be retrieved based on
209list of policyID or filter
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500210*/}}
211
212{{- define "dcaegen2-services-common.microserviceDeployment" -}}
213{{- $logDir := default "" .Values.logDirectory -}}
214{{- $certDir := default "" .Values.certDirectory . -}}
215{{- $tlsServer := default "" .Values.tlsServer -}}
vv770de8c5c682021-04-15 12:21:36 -0400216{{- $policy := default "" .Values.policies -}}
217
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500218apiVersion: apps/v1
219kind: Deployment
220metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
221spec:
222 replicas: 1
223 selector: {{- include "common.selectors" . | nindent 4 }}
224 template:
225 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
226 spec:
227 initContainers:
228 - command:
229 - sh
230 args:
231 - -c
232 - |
233 {{- range $var := .Values.customEnvVars }}
234 export {{ $var.name }}="{{ $var.value }}";
235 {{- end }}
236 cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done
237 env:
238 {{- range $cred := .Values.credentials }}
239 - name: {{ $cred.name }}
240 {{- include "common.secret.envFromSecretFast" (dict "global" $ "uid" $cred.uid "key" $cred.key) | indent 10 }}
241 {{- end }}
242 volumeMounts:
243 - mountPath: /config-input
244 name: app-config-input
245 - mountPath: /config
246 name: app-config
247 image: {{ include "repositoryGenerator.image.envsubst" . }}
248 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
249 name: {{ include "common.name" . }}-update-config
250
251 {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }}
252 - name: init-consul
253 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.consulLoaderImage }}
254 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
255 args:
256 - --key-yaml
257 - "{{ include "common.name" . }}|/app-config/application_config.yaml"
258 resources: {{ include "common.resources" . | nindent 2 }}
259 volumeMounts:
260 - mountPath: /app-config
261 name: app-config
262 {{- if $certDir }}
263 - name: init-tls
264 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.tlsImage }}
265 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
266 env:
267 - name: TLS_SERVER
268 value: {{ $tlsServer | quote }}
269 - name: POD_IP
270 valueFrom:
271 fieldRef:
272 apiVersion: v1
273 fieldPath: status.podIP
274 resources: {{ include "common.resources" . | nindent 2 }}
275 volumeMounts:
276 - mountPath: /opt/app/osaaf
277 name: tls-info
278 {{- end }}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200279 {{ include "dcaegen2-services-common._certPostProcessor" . | nindent 4 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500280 containers:
281 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
282 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
283 name: {{ include "common.name" . }}
284 env:
Bartosz Gardziejewski041a89a2021-05-19 08:05:00 +0200285 {{- range $cred := .Values.credentials }}
286 - name: {{ $cred.name }}
287 {{- include "common.secret.envFromSecretFast" (dict "global" $ "uid" $cred.uid "key" $cred.key) | indent 10 }}
288 {{- end }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500289 {{- if $certDir }}
290 - name: DCAE_CA_CERTPATH
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200291 value: {{ $certDir }}/cacert.pem
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500292 {{- end }}
293 - name: CONSUL_HOST
294 value: consul-server.onap
295 - name: CONFIG_BINDING_SERVICE
296 value: config-binding-service
297 - name: CBS_CONFIG_URL
298 value: https://config-binding-service:10443/service_component_all/{{ include "common.name" . }}
299 - name: POD_IP
300 valueFrom:
301 fieldRef:
302 apiVersion: v1
303 fieldPath: status.podIP
Jack Lucascbca57d2021-04-05 09:49:46 -0400304 {{- include "dcaegen2-services-common._ms-specific-env-vars" . | nindent 8 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500305 {{- if .Values.service }}
306 ports: {{ include "common.containerPorts" . | nindent 10 }}
307 {{- end }}
308 {{- if .Values.readiness }}
309 readinessProbe:
310 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds | default 5 }}
311 periodSeconds: {{ .Values.readiness.periodSeconds | default 15 }}
312 timeoutSeconds: {{ .Values.readiness.timeoutSeconds | default 1 }}
313 {{- $probeType := .Values.readiness.type | default "httpGet" -}}
314 {{- if eq $probeType "httpGet" }}
315 httpGet:
316 scheme: {{ .Values.readiness.scheme }}
317 path: {{ .Values.readiness.path }}
318 port: {{ .Values.readiness.port }}
319 {{- end }}
320 {{- if eq $probeType "exec" }}
321 exec:
322 command:
323 {{- range $cmd := .Values.readiness.command }}
324 - {{ $cmd }}
325 {{- end }}
326 {{- end }}
327 {{- end }}
328 resources: {{ include "common.resources" . | nindent 2 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500329 volumeMounts:
Bartosz Gardziejewski4bb3da32021-04-21 12:08:50 +0200330 - mountPath: /app-config
331 name: app-config
Bartosz Gardziejewski041a89a2021-05-19 08:05:00 +0200332 - mountPath: /app-config-input
333 name: app-config-input
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500334 {{- if $logDir }}
335 - mountPath: {{ $logDir}}
336 name: component-log
337 {{- end }}
338 {{- if $certDir }}
339 - mountPath: {{ $certDir }}
340 name: tls-info
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200341 {{- if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200342 {{- include "common.certManager.volumeMountsReadOnly" . | nindent 8 -}}
343 {{- end -}}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500344 {{- end }}
vv770de8c5c682021-04-15 12:21:36 -0400345 {{- if $policy }}
346 - name: policy-shared
347 mountPath: /etc/policies
348 {{- end }}
Jack Lucase5f71602021-05-10 12:00:02 -0400349 {{- include "dcaegen2-services-common._externalVolumeMounts" . | nindent 8 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500350 {{- if $logDir }}
351 - image: {{ include "repositoryGenerator.image.logging" . }}
352 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
353 name: filebeat
354 env:
355 - name: POD_IP
356 valueFrom:
357 fieldRef:
358 apiVersion: v1
359 fieldPath: status.podIP
360 resources: {{ include "common.resources" . | nindent 2 }}
361 volumeMounts:
362 - mountPath: /var/log/onap/{{ include "common.name" . }}
363 name: component-log
364 - mountPath: /usr/share/filebeat/data
365 name: filebeat-data
366 - mountPath: /usr/share/filebeat/filebeat.yml
367 name: filebeat-conf
368 subPath: filebeat.yml
369 {{- end }}
vv770de8c5c682021-04-15 12:21:36 -0400370 {{- if $policy }}
371 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.dcaePolicySyncImage }}
372 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
373 name: policy-sync
374 env:
375 - name: POD_IP
376 valueFrom:
377 fieldRef:
378 apiVersion: v1
379 fieldPath: status.podIP
380 - name: POLICY_SYNC_PDP_USER
381 valueFrom:
382 secretKeyRef:
383 name: onap-policy-xacml-pdp-api-creds
384 key: login
385 - name: POLICY_SYNC_PDP_PASS
386 valueFrom:
387 secretKeyRef:
388 name: onap-policy-xacml-pdp-api-creds
389 key: password
390 - name: POLICY_SYNC_PDP_URL
Piotr Marcinkiewicz70625182021-04-29 17:02:37 +0200391 value : http{{ if (include "common.needTLS" .) }}s{{ end }}://policy-xacml-pdp:6969
vv770de8c5c682021-04-15 12:21:36 -0400392 - name: POLICY_SYNC_OUTFILE
393 value : "/etc/policies/policies.json"
394 - name: POLICY_SYNC_V1_DECISION_ENDPOINT
395 value : "policy/pdpx/v1/decision"
396 {{- if $policy.filter }}
397 - name: POLICY_SYNC_FILTER
398 value: {{ $policy.filter }}
399 {{- end -}}
400 {{- if $policy.policyID }}
401 - name: POLICY_SYNC_ID
402 value: {{ $policy.policyID }}
403 {{- end -}}
404 {{- if $policy.duration }}
405 - name: POLICY_SYNC_DURATION
406 value: {{ $policy.duration }}
407 {{- end }}
408 resources: {{ include "common.resources" . | nindent 2 }}
409 volumeMounts:
410 - mountPath: /etc/policies
411 name: policy-shared
412 {{- if $certDir }}
413 - mountPath: /opt/ca-certificates/
414 name: tls-info
415 {{- end }}
416 {{- end }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500417 hostname: {{ include "common.name" . }}
418 volumes:
419 - configMap:
420 defaultMode: 420
421 name: {{ include "common.fullname" . }}-application-config-configmap
422 name: app-config-input
423 - emptyDir:
424 medium: Memory
425 name: app-config
426 {{- if $logDir }}
427 - emptyDir: {}
428 name: component-log
429 - emptyDir: {}
430 name: filebeat-data
431 - configMap:
432 defaultMode: 420
433 name: {{ include "common.fullname" . }}-filebeat-configmap
434 name: filebeat-conf
435 {{- end }}
436 {{- if $certDir }}
437 - emptyDir: {}
438 name: tls-info
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200439 {{ if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200440 {{ include "common.certManager.volumesReadOnly" . | nindent 6 }}
441 {{- end }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500442 {{- end }}
vv770de8c5c682021-04-15 12:21:36 -0400443 {{- if $policy }}
444 - name: policy-shared
445 emptyDir: {}
446 {{- end }}
Jack Lucase5f71602021-05-10 12:00:02 -0400447 {{- include "dcaegen2-services-common._externalVolumes" . | nindent 6 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -0500448 imagePullSecrets:
449 - name: "{{ include "common.namespace" . }}-docker-registry-key"
450{{ end -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200451
452{{/*
453 For internal use
454
455 Template to attach CertPostProcessor which merges CMPv2 truststore with AAF truststore
456 and swaps keystore files.
457*/}}
458{{- define "dcaegen2-services-common._certPostProcessor" -}}
459 {{- $certDir := default "" .Values.certDirectory . -}}
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200460 {{- if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200461 {{- $cmpv2Certificate := (index .Values.certificates 0) -}}
462 {{- $cmpv2CertificateDir := $cmpv2Certificate.mountPath -}}
463 {{- $certType := "pem" -}}
464 {{- if $cmpv2Certificate.keystore -}}
465 {{- $certType = (index $cmpv2Certificate.keystore.outputType 0) -}}
466 {{- end -}}
Piotr Marcinkiewicz70625182021-04-29 17:02:37 +0200467 {{- $truststoresPaths := printf "%s/%s:%s/%s" $certDir "cacert.pem" $cmpv2CertificateDir "cacert.pem" -}}
468 {{- $truststoresPasswordPaths := ":" -}}
469 {{- $keystoreSourcePaths := printf "%s/%s:%s/%s" $cmpv2CertificateDir "cert.pem" $cmpv2CertificateDir "key.pem" -}}
Remigiusz Janeczek9b00b562021-04-26 14:37:57 +0200470 {{- $keystoreDestinationPaths := printf "%s/%s:%s/%s" $certDir "cert.pem" $certDir "key.pem" -}}
471 {{- if not (eq $certType "pem") -}}
472 {{- $truststoresPaths = printf "%s/%s:%s/%s.%s" $certDir "trust.jks" $cmpv2CertificateDir "truststore" $certType -}}
473 {{- $truststoresPasswordPaths = printf "%s/%s:%s/%s" $certDir "trust.pass" $cmpv2CertificateDir "truststore.pass" -}}
474 {{- $keystoreSourcePaths = printf "%s/%s.%s:%s/%s" $cmpv2CertificateDir "keystore" $certType $cmpv2CertificateDir "keystore.pass" -}}
475 {{- $keystoreDestinationPaths = printf "%s/%s.%s:%s/%s.pass" $certDir "cert" $certType $certDir $certType -}}
476 {{- end }}
477 - name: cert-post-processor
478 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.certPostProcessorImage }}
479 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
480 resources:
481 {{- include "common.resources" . | nindent 4 }}
482 volumeMounts:
483 - mountPath: {{ $certDir }}
484 name: tls-info
485 {{- include "common.certManager.volumeMountsReadOnly" . | nindent 4 }}
486 env:
487 - name: TRUSTSTORES_PATHS
488 value: {{ $truststoresPaths | quote}}
489 - name: TRUSTSTORES_PASSWORDS_PATHS
490 value: {{ $truststoresPasswordPaths | quote }}
491 - name: KEYSTORE_SOURCE_PATHS
492 value: {{ $keystoreSourcePaths | quote }}
493 - name: KEYSTORE_DESTINATION_PATHS
494 value: {{ $keystoreDestinationPaths | quote }}
495 {{- end }}
496{{- end -}}
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200497
498{{/*
499 Template returns string "true" if CMPv2 certificates should be used and nothing (so it can be used in with statements)
500 when they shouldn't. Example use:
501 {{- if (include "dcaegen2-services-common.shouldUseCmpv2Certificates" .) -}}
502
503*/}}
504{{- define "dcaegen2-services-common.shouldUseCmpv2Certificates" -}}
505 {{- $certDir := default "" .Values.certDirectory . -}}
Piotr Marcinkiewicz598f2d82021-06-01 12:36:13 +0200506 {{- if (and $certDir .Values.certificates .Values.global.cmpv2Enabled .Values.useCmpv2Certificates) -}}
Remigiusz Janeczek7b095032021-05-20 19:39:44 +0200507 true
508 {{- end -}}
509{{- end -}}