This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 249
Add out_kafka daemonset #11
Closed
Closed
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
732d848
Copies output/elasticsearch/
solsson ecd371b
Configures current dev build of out_kafka,
solsson 9b62cea
Bumps to latest build, tag 0.2
solsson 1403cc9
Upgrades to :0.3 but keeps unencoded format
solsson b988dd0
New build from https://github.com/fluent/fluent-bit/issues/94
solsson e045ef1
Elaborates on a naming convention
solsson 15d82a5
Uses the bootstrap service, to avoid error messages in smaller clusters
solsson 8765262
Recommends that we retry sending, forever - TODO: memory limits
solsson 7945b66
Upgrades to latest fluent-bit-kafka-dev image, librdkafka 0.11.3
solsson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: fluent-bit-config | ||
namespace: logging | ||
labels: | ||
k8s-app: fluent-bit | ||
data: | ||
# Configuration files: server, input, filters and output | ||
# ====================================================== | ||
fluent-bit.conf: | | ||
[SERVICE] | ||
Flush 1 | ||
Log_Level info | ||
Daemon off | ||
Parsers_File parsers.conf | ||
|
||
@INCLUDE input-kubernetes.conf | ||
@INCLUDE filter-kubernetes.conf | ||
@INCLUDE output-kafka.conf | ||
|
||
input-kubernetes.conf: | | ||
[INPUT] | ||
Name tail | ||
Tag kube.* | ||
Path /var/log/containers/*.log | ||
Parser docker | ||
DB /var/log/flb_kube.db | ||
Mem_Buf_Limit 5MB | ||
Skip_Long_Lines On | ||
Refresh_Interval 10 | ||
|
||
filter-kubernetes.conf: | | ||
[FILTER] | ||
Name kubernetes | ||
Match kube.* | ||
Kube_URL https://kubernetes.default.svc:443 | ||
Merge_JSON_Log On | ||
|
||
output-kafka.conf: | | ||
[OUTPUT] | ||
Name kafka | ||
Match * | ||
Brokers bootstrap.kafka:9092 | ||
Topics ops.kube-logs-fluentbit.stream.json.001 | ||
Timestamp_Key @timestamp | ||
|
||
parsers.conf: | | ||
[PARSER] | ||
Name apache | ||
Format regex | ||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name apache2 | ||
Format regex | ||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name apache_error | ||
Format regex | ||
Regex ^\[[^ ]* (?<time>[^\]]*)\] \[(?<level>[^\]]*)\](?: \[pid (?<pid>[^\]]*)\])?( \[client (?<client>[^\]]*)\])? (?<message>.*)$ | ||
|
||
[PARSER] | ||
Name nginx | ||
Format regex | ||
Regex ^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name json-test | ||
Format json | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name docker | ||
Format json | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name syslog | ||
Format regex | ||
Regex ^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$ | ||
Time_Key time | ||
Time_Format %b %d %H:%M:%S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: DaemonSet | ||
metadata: | ||
name: fluent-bit | ||
namespace: logging | ||
labels: | ||
k8s-app: fluent-bit-logging | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: fluent-bit-logging | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
containers: | ||
- name: fluent-bit | ||
image: fluent/fluent-bit-kafka-dev:0.4@sha256:97621767bbe271cdda04c25702f57dc5e256ccddcf89386b1d6f539af74c46e6 | ||
volumeMounts: | ||
- name: varlog | ||
mountPath: /var/log | ||
- name: varlibdockercontainers | ||
mountPath: /var/lib/docker/containers | ||
readOnly: true | ||
- name: fluent-bit-config | ||
mountPath: /fluent-bit/etc/ | ||
- name: mnt | ||
mountPath: /mnt | ||
readOnly: true | ||
terminationGracePeriodSeconds: 10 | ||
volumes: | ||
- name: varlog | ||
hostPath: | ||
path: /var/log | ||
- name: varlibdockercontainers | ||
hostPath: | ||
path: /var/lib/docker/containers | ||
- name: fluent-bit-config | ||
configMap: | ||
name: fluent-bit-config | ||
- name: mnt | ||
hostPath: | ||
path: /mnt | ||
serviceAccountName: fluent-bit | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
operator: Exists | ||
effect: NoSchedule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: DaemonSet | ||
metadata: | ||
name: fluent-bit | ||
namespace: logging | ||
labels: | ||
k8s-app: fluent-bit-logging | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: fluent-bit-logging | ||
version: v1 | ||
kubernetes.io/cluster-service: "true" | ||
spec: | ||
containers: | ||
- name: fluent-bit | ||
image: fluent/fluent-bit-kafka-dev:0.4@sha256:97621767bbe271cdda04c25702f57dc5e256ccddcf89386b1d6f539af74c46e6 | ||
volumeMounts: | ||
- name: varlog | ||
mountPath: /var/log | ||
- name: varlibdockercontainers | ||
mountPath: /var/lib/docker/containers | ||
readOnly: true | ||
- name: fluent-bit-config | ||
mountPath: /fluent-bit/etc/ | ||
terminationGracePeriodSeconds: 10 | ||
volumes: | ||
- name: varlog | ||
hostPath: | ||
path: /var/log | ||
- name: varlibdockercontainers | ||
hostPath: | ||
path: /var/lib/docker/containers | ||
- name: fluent-bit-config | ||
configMap: | ||
name: fluent-bit-config | ||
serviceAccountName: fluent-bit | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
operator: Exists | ||
effect: NoSchedule |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was unaware of this but now I found fluent/fluent-bit#309 (comment). I guess the daemonset pods need some monitoring, like a gauge for the number of messages in buffer.
If one message fails it's quite unlikely that the next will be sent, so I think
Retry_Limit
=False
makes sense to preserve ordering, in combination with a very narrow memory limit. It's a decent alternative to buffer monitoring, because if the pod hits the memory limit it will be replaced and generic monitoring on readiness (for example using prometheus-operator and this example) will alert about the issue.