티스토리 뷰

Cloud/Kubernetes

fluentbit with azure blob storage

Jacob_baek 2024. 8. 27. 13:32

installation

fluentbit install using helm chart

$ helm repo add fluent https://fluent.github.io/helm-charts
$ kubectl create ns logging
$ helm upgrade --install fluent-bit fluent/fluent-bit -n logging

create storage account and blob container

$ az storage account create -n fluentbitteststor -g fluentbittest-rg -l koreacentral --sku Standard_LRS

config for azure blob

$ kubectl edit configmap fluent-bit -n logging
...
    [OUTPUT]
        name                  azure_blob
        match                 *
        account_name          fluentbitteststor
        shared_key            xxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
        path                  k8slogs
        container_name        fluentbittest
        auto_create_container on
        tls                   on

https://docs.fluentbit.io/manual/pipeline/outputs/azure_blob

full configmap

  custom_parsers.conf: |
    [PARSER]
        Name docker_no_time
        Format json
        Time_Keep Off
        Time_Key time
        Time_Format %Y-%m-%dT%H:%M:%S.%L
  fluent-bit.conf: |
    [SERVICE]
        Daemon Off
        Flush 1
        Log_Level info
        Parsers_File /fluent-bit/etc/parsers.conf
        Parsers_File /fluent-bit/etc/conf/custom_parsers.conf
        HTTP_Server On
        HTTP_Listen 0.0.0.0
        HTTP_Port 2020
        Health_Check On

    [INPUT]
        Name tail
        Path /var/log/containers/*.log
        multiline.parser docker, cri
        Tag kube.*
        Mem_Buf_Limit 5MB
        Skip_Long_Lines On

    [INPUT]
        Name systemd
        Tag host.*
        Systemd_Filter _SYSTEMD_UNIT=kubelet.service
        Read_From_Tail On

    [INPUT]
        Name tail
        Path /var/log/*.log
        Tag system.*

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

    [OUTPUT]
        name                  azure_blob
        match                 *
        account_name          fluentbitteststor
        shared_key            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==
        path                  k8slogs
        container_name        fluentbittest
        auto_create_container on
        tls                   on

restart daemonset

After modifying the fluent-bit configmap, run rollout like below.

$ kubectl rollout restart ds fluent-bit -n logging
daemonset.apps/fluent-bit restarted

storage browser

'Cloud > Kubernetes' 카테고리의 다른 글

kubernetes_sd_config on Prometheus  (0) 2023.06.13
Gatekeeper monitoring and logging  (0) 2023.05.26
Eraser (Image cleaner)  (0) 2023.04.25
trivy-operator  (0) 2023.04.01
Postee  (0) 2023.03.17
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함