Jack Lucas | d41dbdb | 2021-02-16 11:07:28 -0500 | [diff] [blame] | 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" -}} |
Jack Lucas | b880f89 | 2021-06-07 16:40:31 -0400 | [diff] [blame^] | 43 | {{- $appConf := .Values.applicationConfig | default (dict) -}} |
Jack Lucas | d41dbdb | 2021-02-16 11:07:28 -0500 | [diff] [blame] | 44 | apiVersion: v1 |
| 45 | kind: ConfigMap |
| 46 | metadata: |
| 47 | name: {{ include "common.fullname" . }}-application-config-configmap |
| 48 | namespace: {{ include "common.namespace" . }} |
| 49 | labels: {{ include "common.labels" . | nindent 6 }} |
| 50 | data: |
| 51 | application_config.yaml: | |
Jack Lucas | b880f89 | 2021-06-07 16:40:31 -0400 | [diff] [blame^] | 52 | {{ $appConf | toYaml | indent 4 }} |
Jack Lucas | d41dbdb | 2021-02-16 11:07:28 -0500 | [diff] [blame] | 53 | |
| 54 | {{- if .Values.logDirectory }} |
| 55 | --- |
| 56 | apiVersion: v1 |
| 57 | kind: ConfigMap |
| 58 | metadata: |
| 59 | name: {{ include "common.fullname" . }}-filebeat-configmap |
| 60 | namespace: {{ include "common.namespace" . }} |
| 61 | labels: {{ include "common.labels" . | nindent 6 }} |
| 62 | data: |
| 63 | filebeat.yml: |- |
| 64 | {{ include "dcaegen2-services-common.filebeatConfiguration" . | indent 4 }} |
| 65 | {{- end }} |
| 66 | {{- end }} |