首页 > 解决方案 > 为什么 Fluentd Azure blob 插件在 kubernetes 中不起作用

问题描述

我已经使用以下命令在我的 AKS 集群中安装了 fluentd helm install fluentd bitnami-azure/fluentd --namespace mynamespace --set forwarder.configMap=fluentd-aksconfig

下面是我的 configmap.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-aksconfig
  namespace: mynamespace
data:
  fluentd.conf: |
    <match **>
          @type azure-storage-append-blob
          azure_storage_account    mystorageaccount
          azure_storage_access_key myaccesskey
          azure_container          aksfluentd
          auto_create_container    true
          path logs/
          azure_object_key_format  %{path}%{time_slice}_%{index}.log
          time_slice_format        %Y%m%d-%H
          # if you want to use %{tag} or %Y/%m/%d/ like syntax in path / azure_blob_name_format,
          # need to specify tag for %{tag} and time for %Y/%m/%d in <buffer> argument.
          <buffer tag,time>
            @type file
            path /var/log/fluent/azurestorageappendblob
            timekey 120 # 2 minutes
            timekey_wait 60
            timekey_use_utc true # use utc
          </buffer>
    </match> 

以下是从 pod 获得的错误。它显示没有名为“azure-storage-append-blob”的插件。如何解决这个问题?

日志:

[38;5;6mfluentd [38;5;5m10:03:45.15 [0m [38;5;6mfluentd [38;5;5m10:03:45.15 [0m[1m欢迎使用Bitnami fluentd容器[0m [38;5; 6mfluentd [38;5;5m10:03:45.16 [0m通过观看[1m订阅项目更新https://github.com/bitnami/bitnami-docker-fluentd[0m [38;5;6mfluentd [38;5;5m10:03 :45.16 [0m提交问题和功能请求 [1mhttps://github.com/bitnami/bitnami-docker-fluentd/issues[0m [38;5;6mfluentd [38;5;5m10:03:45.16 [0m向我们发送您的反馈在 [1mcontainers@bitnami.com[0m [38;5;6mfluentd [38;5;5m10:03:45.16 [0m [38;5;6mfluentd [38;5;5m10:03:45.16 [0m[38;5; 2mINFO [0m ==> ** 开始 Fluentd 设置 ** [38;5;6mfluentd [38;5;5m10:03:45.38 [0m[38;5;2mINFO [0m ==> ** Fluentd 设置完成!** [38;5;6mfluentd [38;5;5m10:03:45.39 [0m[38;5;2mINFO [0m ==> ** 开始 Fluentd ** 2020-02-18 10:03:/opt/bitnami/fluentd/conf/fluentd.conf" error_class=Fluent::ConfigError error="未知输出插件'azure-storage-append-blob'。运行“gem search -rd fluent-plugin”来查找插件” /opt/bitnami/fluentd/conf/fluentd.conf" error_class=Fluent::ConfigError error="未知输出插件'azure-storage-append-blob'。运行“gem search -rd fluent-plugin”来查找插件”

标签: azurekubernetesazure-blob-storagefluentdazure-aks

解决方案


默认情况下未安装azure-storage-append-blob插件。所以你需要安装它。关于如何安装 Fluentd 插件的文档在这里


推荐阅读