2-Olly
efk-stack
Fluent Bit S3 Plugin.yaml

Documentation

apiVersion: v1 kind: Namespace metadata: name: s3-logs

apiVersion: v1 kind: ConfigMap metadata: name: fluent-bit-config namespace: s3-logs data: parsers.conf: |- [PARSER] Name docker Format json Time_Key time Time_Format %Y-%m-%dT%H:%M:%S.%L fluent-bit.conf: |- [SERVICE] Flush 1 Daemon Off Log_Level info Parsers_File parsers.conf HTTP_Server On HTTP_Listen 0.0.0.0 HTTP_Port 2020

[INPUT] Name tail Path /var/log/containers/.log Parser docker Tag kube. Mem_Buf_Limit 5MB Skip_Long_Lines On

[FILTER] Name kubernetes Match kube.* Merge_Log On Merge_Log_Trim On Labels On Annotations Off K8S-Logging.Parser Off K8S-Logging.Exclude Off

[OUTPUT] Name s3 Match * bucket uat-test region ap-south-1 total_file_size 10M upload_timeout 1m use_put_object On s3_key_format /logs/%Y/%m/%d/%H/%HOSTNAME-$UUID.gz compression gzip

apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: fluent-bit-read rules:

  • apiGroups: [""] resources:
    • namespaces
    • pods verbs:
    • get
    • list
    • watch

apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: fluent-bit-read roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: fluent-bit-read subjects:

  • kind: ServiceAccount name: fluent-bit namespace: s3-logs

apiVersion: v1 kind: ServiceAccount metadata: name: fluent-bit namespace: s3-logs

apiVersion: apps/v1 kind: DaemonSet metadata: name: fluent-bit namespace: s3-logs labels: k8s-app: fluent-bit spec: selector: matchLabels: k8s-app: fluent-bit template: metadata: labels: k8s-app: fluent-bit spec: serviceAccountName: fluent-bit tolerations:

  • key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule volumes:
  • name: varlog hostPath: path: /var/log
  • name: varlibdockercontainers hostPath: path: /var/lib/docker/containers
  • name: config configMap: name: fluent-bit-config containers:
  • name: fluent-bit image: fluent/fluent-bit:latest imagePullPolicy: IfNotPresent resources: limits: memory: 500Mi cpu: 500m requests: memory: 200Mi cpu: 200m volumeMounts:
    • name: varlog mountPath: /var/log
    • name: varlibdockercontainers mountPath: /var/lib/docker/containers readOnly: true
    • name: config mountPath: /fluent-bit/etc/fluent-bit.conf subPath: fluent-bit.conf env:
    • name: AWS_ACCESS_KEY_ID value: "xx"
    • name: AWS_SECRET_ACCESS_KEY value: "xx"

💬 Need a Quick Summary?

Hey! Don't have time to read everything? I get it. 😊
Click below and I'll give you the main points and what matters most on this page.
Takes about 5 seconds • Uses Perplexity AI