2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications Copyright © 2019 AT&T
4 # Copyright (c) 2021 J. F. Lucas. All rights reserved.
5 # Copyright (c) 2021 Nordix Foundation.
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
21 dcaegen2-services-common.configMap:
22 This template produces Kubernetes configMap(s) needed by a
25 The template expects the full chart context as input. A chart for a
26 DCAE microservice references this template using:
27 {{ include "dcaegen2-services-common.configMap" . }}
28 The template directly references data in .Values, and indirectly (through its
29 use of templates from the ONAP "common" collection) references data in
32 The template always produces a configMap containing the microservice's
33 initial configuration data. This configMap is used by an initContainer
34 that loads the configuration into Consul. (See the documentation for
35 dcaegen2-services-common.microserviceDeployment for more details.)
37 If the microservice is using a logging sidecar (again, see the documentation
38 for dcaegen2-services-common.microserviceDeployment for more details), the
39 template generates an additiona configMap that supplies configuration
40 information for the logging sidecar.
43 {{- define "dcaegen2-services-common.configMap" -}}
44 {{- $appConf := .Values.applicationConfig | default (dict) -}}
48 name: {{ include "common.fullname" . }}-application-config-configmap
49 namespace: {{ include "common.namespace" . }}
50 labels: {{ include "common.labels" . | nindent 6 }}
52 application_config.yaml: |
53 {{ $appConf | toYaml | indent 4 }}
55 {{- if .Values.logDirectory }}
60 name: {{ include "common.fullname" . }}-filebeat-configmap
61 namespace: {{ include "common.namespace" . }}
62 labels: {{ include "common.labels" . | nindent 6 }}
65 {{ include "dcaegen2-services-common.filebeatConfiguration" . | indent 4 }}
68 {{- if .Values.drFeedConfig }}
73 name: {{ include "common.fullname" . }}-feeds-config
74 namespace: {{ include "common.namespace" . }}
75 labels: {{ include "common.labels" . | nindent 6 }}
77 {{- range $i, $feed := .Values.drFeedConfig }}
78 feedConfig-{{$i}}.json: |-
79 {{ $feed | toJson | indent 2 }}
83 {{- if .Values.drPubConfig }}
88 name: {{ include "common.fullname" . }}-drpub-config
89 namespace: {{ include "common.namespace" . }}
90 labels: {{ include "common.labels" . | nindent 6 }}
92 {{- range $i, $drpub := .Values.drPubConfig }}
93 drpubConfig-{{$i}}.json: |-
94 {{ $drpub | toJson | indent 2 }}
98 {{- if .Values.drSubConfig }}
103 name: {{ include "common.fullname" . }}-drsub-config
104 namespace: {{ include "common.namespace" . }}
105 labels: {{ include "common.labels" . | nindent 6 }}
107 {{- range $i, $drsub := .Values.drSubConfig }}
108 drsubConfig-{{$i}}.json: |-
109 {{ $drsub | toJson | indent 2 }}
113 {{- if .Values.mrTopicsConfig }}
118 name: {{ include "common.fullname" . }}-topics-config
119 namespace: {{ include "common.namespace" . }}
120 labels: {{ include "common.labels" . | nindent 6 }}
122 {{- range $i, $topics := .Values.mrTopicsConfig }}
123 topicsConfig-{{$i}}.json: |-
124 {{ $topics | toJson | indent 2 }}