[DCAEGEN2] Deploy DCAE microservices via Helm
[oom.git] / kubernetes / dcaegen2-services / common / dcaegen2-services-common / templates / _configmap.tpl
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications Copyright © 2019 AT&T
4 # Copyright (c) 2021 J. F. Lucas.  All rights reserved.
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.
17 */}}
18
19 {{/*
20 dcaegen2-services-common.configMap:
21 This template produces Kubernetes configMap(s) needed by a
22 DCAE microservice.
23
24 The template expects the full chart context as input.  A chart for a
25 DCAE microservice references this template using:
26 {{ include "dcaegen2-services-common.configMap" . }}
27 The template directly references data in .Values, and indirectly (through its
28 use of templates from the ONAP "common" collection) references data in
29 .Release.
30
31 The template always produces a configMap containing the microservice's
32 initial configuration data.  This configMap is used by an initContainer
33 that loads the configuration into Consul.  (See the documentation for
34 dcaegen2-services-common.microserviceDeployment for more details.)
35
36 If the microservice is using a logging sidecar (again, see the documentation
37 for dcaegen2-services-common.microserviceDeployment for more details), the
38 template generates an additiona configMap that supplies configuration
39 information for the logging sidecar.
40 */}}
41
42 {{- define "dcaegen2-services-common.configMap" -}}
43 apiVersion: v1
44 kind: ConfigMap
45 metadata:
46     name: {{ include "common.fullname" . }}-application-config-configmap
47     namespace: {{ include "common.namespace" . }}
48     labels: {{ include "common.labels" . | nindent 6 }}
49 data:
50   application_config.yaml: |
51 {{ .Values.applicationConfig | toYaml | indent 4 }}
52
53 {{- if .Values.logDirectory }}
54 ---
55 apiVersion: v1
56 kind: ConfigMap
57 metadata:
58   name: {{ include "common.fullname" . }}-filebeat-configmap
59   namespace: {{ include "common.namespace" . }}
60   labels: {{ include "common.labels" . | nindent 6 }}
61 data:
62   filebeat.yml: |-
63 {{ include "dcaegen2-services-common.filebeatConfiguration" . | indent 4 }}
64 {{- end }}
65 {{- end }}