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

FluentD file buffer #322

Merged
merged 34 commits into from
Dec 2, 2019
Merged

FluentD file buffer #322

merged 34 commits into from
Dec 2, 2019

Conversation

vsinghal13
Copy link
Contributor

@vsinghal13 vsinghal13 commented Nov 26, 2019

Description

Add option to use fluentD file buffer instead of in-memory buffer. Default will be memory .
Later on, we might add the functionality to write to an external volume, instead of local file system.

Testing performed
  • ci/build.sh
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

@@ -22,47 +22,120 @@
@id sumologic.endpoint.metrics.apiserver
endpoint "#{ENV['SUMO_ENDPOINT_METRICS_APISERVER']}"
@include metrics.output.conf
<buffer>
{{- if eq .Values.sumologic.fluentdBuffer "file" }}
@type file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent looks off on these, e.g. https://github.com/SumoLogic/sumologic-kubernetes-collection/pull/322/files#diff-77aa48b7684fe90d242ce9fdae9da300R58

I think they need to be something like

      {{- if eq .Values.sumologic.fluentdBuffer "file" }}
      @type file
      path /fluentd/buffer/metrics.kubelet
      {{- else }}
      @type memory
      {{- end }}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch! Changed the indentation.

@@ -17,6 +17,15 @@
@type sumologic
@id sumologic.endpoint.logs.kubelet
@include logs.output.conf
<buffer>
{{- if eq .Values.sumologic.fluentdBuffer "file" }}
@type file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed indent here?

@@ -159,6 +159,9 @@ sumologic:
# watchResourceEventsOverrides:
# pods: "v1"
# events: "events.k8s.io/v1beta1"

## Option to specify the fluentD buffer as file/memory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "fluentD" --> "Fluentd" to match our docs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also can we make this

fluentd:
  buffer: "memory"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"FluentD" seems to be used in the values.yaml. Should update all those as well?

Copy link
Contributor

@samjsong samjsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, maybe in a future PR we can consider using Helm templating to make the metrics output conf more DRY, like the way they do in the fluentbit helm chart: https://github.com/helm/charts/blob/master/stable/fluent-bit/templates/config.yaml#L47

@lei-sumo
Copy link
Contributor

lei-sumo commented Dec 2, 2019

Is this PR sufficient to be released separately? Or do we need to waiting external volume? Also is there a doc/spec for the expected behavior (flush at shutdown, etc)?

@vsinghal13
Copy link
Contributor Author

Is this PR sufficient to be released separately? Or do we need to waiting external volume? Also is there a doc/spec for the expected behavior (flush at shutdown, etc)?

I will be creating a separate PR for the doc/spec. This PR will use the local file system to store the buffer files. In future, we can provide additional option to use external volumes to store the buffer.

@vsinghal13 vsinghal13 merged commit aa80337 into master Dec 2, 2019
@vsinghal13 vsinghal13 deleted the vsinghal-file-buffer branch December 2, 2019 21:03
@@ -57,55 +54,87 @@ data:
@id sumologic.endpoint.metrics.apiserver
endpoint "#{ENV['SUMO_ENDPOINT_METRICS_APISERVER']}"
@include metrics.output.conf
<buffer>
@type memory

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vsinghal13 is this change is only for helm based installation? For non-helm, we are still going to buffer to memory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -30,12 +30,13 @@
verify_ssl "#{ENV['VERIFY_SSL']}"
proxy_uri "#{ENV['PROXY_URI']}"
<buffer>
{{- if eq .Values.sumologic.fluentd.buffer "file" }}
@type file
path /fluentd/buffer/events

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vsinghal13 is this path local to node? If yes, all pods inside that node will store buffer in the same file?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2019-12-18 at 8 48 25 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the path is local to node. Each buffer section needs to have a unique path. The pods will store will store in different paths based on the config path provided in the respective buffer section.

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.

5 participants