Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Utilize the tpl function for logstashConfig and logstashPipeline #630

Closed

Description

Describe the feature:
When creating configmaps from the logstashPipeline and logstashConfig objects defined in values.yaml, it would be useful to use the tpl function. For example, this would change

{{- if .Values.logstashPipeline }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "logstash.fullname" . }}-pipeline
  labels:
    app: "{{ template "logstash.fullname" . }}"
    chart: "{{ .Chart.Name }}"
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
data:
{{- range $path, $config := .Values.logstashPipeline }}
  {{ $path }}: |
{{ $config | indent 4 -}}
{{- end -}}
{{- end -}}

to:

{{- if .Values.logstashPipeline }}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "logstash.fullname" . }}-pipeline
  labels:
    app: "{{ template "logstash.fullname" . }}"
    chart: "{{ .Chart.Name }}"
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
data:
{{- range $path, $config := .Values.logstashPipeline }}
  {{ $path }}: |
{{ tpl $config | indent 4 -}}
{{- end -}}
{{- end -}}

This is a small change, but it would give users a lot more power when supplying configs through the values.yaml.

Describe a specific use case for the feature:
Someone could use this to track the pipeline configs in a separate file than their values.yaml, allowing better organization and tracking. Instead of filling out the whole config via:

logstashPipeline:
  logstash.conf: |
    # Insert config here...

Someone could do:

logstashPipeline:
  logstash.conf: |
    {{ .Files.get "configs/logstash.yaml" }}

It would also allow the config files to have fields templated out as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions