blob: 1dff4d0f777c1f9c9900db17358a4f121a2946be [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" -}}
Jack Lucasb880f892021-06-07 16:40:31 -040043{{- $appConf := .Values.applicationConfig | default (dict) -}}
Jack Lucasd41dbdb2021-02-16 11:07:28 -050044apiVersion: v1
45kind: ConfigMap
46metadata:
47 name: {{ include "common.fullname" . }}-application-config-configmap
48 namespace: {{ include "common.namespace" . }}
49 labels: {{ include "common.labels" . | nindent 6 }}
50data:
51 application_config.yaml: |
Jack Lucasb880f892021-06-07 16:40:31 -040052{{ $appConf | toYaml | indent 4 }}
Jack Lucasd41dbdb2021-02-16 11:07:28 -050053
54{{- if .Values.logDirectory }}
55---
56apiVersion: v1
57kind: ConfigMap
58metadata:
59 name: {{ include "common.fullname" . }}-filebeat-configmap
60 namespace: {{ include "common.namespace" . }}
61 labels: {{ include "common.labels" . | nindent 6 }}
62data:
63 filebeat.yml: |-
64{{ include "dcaegen2-services-common.filebeatConfiguration" . | indent 4 }}
65{{- end }}
66{{- end }}