blob: 46f52b805ea98e07de04b8a6ebec6ed30d6d795c [file] [log] [blame]
Jack Lucasd41dbdb2021-02-16 11:07:28 -05001{{/*
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{{/*
20dcaegen2-services-common.configMap:
21This template produces Kubernetes configMap(s) needed by a
22DCAE microservice.
23
24The template expects the full chart context as input. A chart for a
25DCAE microservice references this template using:
26{{ include "dcaegen2-services-common.configMap" . }}
27The template directly references data in .Values, and indirectly (through its
28use of templates from the ONAP "common" collection) references data in
29.Release.
30
31The template always produces a configMap containing the microservice's
32initial configuration data. This configMap is used by an initContainer
33that loads the configuration into Consul. (See the documentation for
34dcaegen2-services-common.microserviceDeployment for more details.)
35
36If the microservice is using a logging sidecar (again, see the documentation
37for dcaegen2-services-common.microserviceDeployment for more details), the
38template generates an additiona configMap that supplies configuration
39information for the logging sidecar.
40*/}}
41
42{{- define "dcaegen2-services-common.configMap" -}}
43apiVersion: v1
44kind: ConfigMap
45metadata:
46 name: {{ include "common.fullname" . }}-application-config-configmap
47 namespace: {{ include "common.namespace" . }}
48 labels: {{ include "common.labels" . | nindent 6 }}
49data:
50 application_config.yaml: |
51{{ .Values.applicationConfig | toYaml | indent 4 }}
52
53{{- if .Values.logDirectory }}
54---
55apiVersion: v1
56kind: ConfigMap
57metadata:
58 name: {{ include "common.fullname" . }}-filebeat-configmap
59 namespace: {{ include "common.namespace" . }}
60 labels: {{ include "common.labels" . | nindent 6 }}
61data:
62 filebeat.yml: |-
63{{ include "dcaegen2-services-common.filebeatConfiguration" . | indent 4 }}
64{{- end }}
65{{- end }}