Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add if conditions to fluentd configuration templates #1314

Merged
merged 1 commit into from Jan 11, 2021

Conversation

pmalek-sumo
Copy link
Contributor

Description

In case user overwrites default values in the following manner (i.e. without specifying a value for keys surround with conditions in this PR)

fluentd:
  buffer:
    extraConf:
...

helm commands might render errors similar to:

Error: template: sumologic/templates/statefulset.yaml:19:28: executing "sumologic/templates/statefulset.yaml" at <include (print $.Template.BasePath "/configmap.yaml") .>: error calling include: template: sumologic/templates/configmap.yaml:15:5: executing "sumologic/templates/configmap.yaml" at <tpl (.Files.Glob "conf/*.conf").AsConfig .>: error calling tpl: error during tpl function execution for "buffer.output.conf: |-\n  compress {{ .Values.fluentd.buffer.compress | quote }}\n  flush_interval {{ .Values.fluentd.buffer.flushInterval | quote }}\n  flush_thread_count {{ .Values.fluentd.buffer.numThreads | quote }}\n  chunk_limit_size {{ .Values.fluentd.buffer.chunkLimitSize | quote }}\n  total_limit_size {{ .Values.fluentd.buffer.totalLimitSize | quote }}\n  queued_chunks_limit_size {{ .Values.fluentd.buffer.queueChunkLimitSize | quote }}\n  overflow_action drop_oldest_chunk\n  retry_max_interval {{ .Values.fluentd.buffer.retryMaxInterval | quote }}\n  retry_forever {{ .Values.fluentd.buffer.retryForever | quote }}\n  {{- .Values.fluentd.buffer.extraConf | nindent 2 }}\ncommon.conf: |-\n  # Prevent fluentd from handling records containing its own logs.\n  <match fluentd.**>\n    @type null\n  </match>\n  # expose the Fluentd metrics to Prometheus\n  <source>\n    @type prometheus\n    metrics_path /metrics\n    port 24231\n  </source>\n  <source>\n    @type prometheus_output_monitor\n  </source>\n  <source>\n    @type http\n    port 9880\n    bind 0.0.0.0\n  </source>\n  {{- if .Values.fluentd.logLevel }}\n  <system>\n    log_level {{ .Values.fluentd.logLevel }}\n  </system>\n  {{- end }}": template: sumologic/templates/statefulset.yaml:11:49: executing "sumologic/templates/statefulset.yaml" at <2>: invalid value; expected string

Testing performed
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

@pmalek-sumo pmalek-sumo merged commit 55c6fd7 into main Jan 11, 2021
@pmalek-sumo pmalek-sumo deleted the add-if-conditions-to-fluentd-conf-file-templates branch January 11, 2021 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants