Skip to content
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
james-mchugh opened this issue May 18, 2020 · 1 comment · Fixed by #717
Closed

Utilize the tpl function for logstashConfig and logstashPipeline #630

james-mchugh opened this issue May 18, 2020 · 1 comment · Fixed by #717

Comments

@james-mchugh
Copy link

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.

@botelastic
Copy link

botelastic bot commented Sep 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants