自定义 Kubernetes 集群日志记录至 Google Cloud Logging。

huangapple go评论74阅读模式
英文:

Custom kubernetes cluster logging to Google Cloud Logging

问题

我有一个自定义的Kubernetes集群。
我想要在Google Cloud日志中观看日志。
我已经阅读了许多关于Elasticsearch的解决方案,但我更喜欢使用GCL。
我开始阅读关于FluentD / FluentBit的内容,但现在我不知道如何启动它。
我找不到任何相关文档。
我应该从哪里开始?

更新
我在Azure上有一个K8S集群,我想要使用Google Cloud日志。

更新
我找到了名为"stackdriver"的FluentBit输出插件。
问题是,当我使用下面的配置时,我收到了一个错误消息。

配置:

      outputs: |
        [OUTPUT]
            Name stackdriver
            Match *
            service_account_email {{ .Values.stackdriver.service_account_email }}
            service_account_secret {{ .Values.stackdriver.service_account_secret }}        

helm template . 命令显示一切都正常。
但当我安装模板时,出现以下错误:

    [2023/01/11 13:35:12] [ info] [output:stackdriver:stackdriver.0] metadata_server set to http://metadata.google.internal
    [2023/01/11 13:35:12] [ warn] [output:stackdriver:stackdriver.0] client_email is not defined, using a default one
    [2023/01/11 13:35:12] [ warn] [output:stackdriver:stackdriver.0] private_key is not defined, fetching it from metadata server
    [2023/01/11 13:35:12] [ warn] [net] getaddrinfo(host='metadata.google.internal', err=-2): Name or service not known
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] failed to create metadata connection
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] can't fetch token from the metadata server
    [2023/01/11 13:35:12] [ warn] [output:stackdriver:stackdriver.0] token retrieval failed
    [2023/01/11 13:35:12] [ warn] [net] getaddrinfo(host='metadata.google.internal', err=-2): Name or service not known
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] failed to create metadata connection
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] can't fetch project id from the metadata server
    [2023/01/11 13:35:12] [error] [output] failed to initialize 'stackdriver' plugin
英文:

I have a custom kuberentes cluster. <br>
I would like to watch the logs in the Google Cloud Logging. <br>
I've already read a lot solutions for Elasticsearch but I would prefer the GCL. <br>
I start read about the FluentD / FluentBit but now I don't know how to start it. <br>
<br>
I couldn't find any documentation for that. <br>
Where should I start?

UPDATE: <br>
K8S Cluster on Azure and I would like to use the Google Cloud Logging.

UPDATE: <br>
I found the fluentBit OUTPUT plugin named stackdriver. <br>
The problem now when I use the config below I get an error message.

Config:

      outputs: |
        [OUTPUT]
            Name stackdriver
            Match *
            service_account_email {{ .Values.stackdriver.service_account_email }}
            service_account_secret {{ .Values.stackdriver.service_account_secret }}        

The helm template . command shows that its good. <br>
But when I install the template this is the error:

    [2023/01/11 13:35:12] [ info] [output:stackdriver:stackdriver.0] metadata_server set to http://metadata.google.internal
    [2023/01/11 13:35:12] [ warn] [output:stackdriver:stackdriver.0] client_email is not defined, using a default one
    [2023/01/11 13:35:12] [ warn] [output:stackdriver:stackdriver.0] private_key is not defined, fetching it from metadata server
    [2023/01/11 13:35:12] [ warn] [net] getaddrinfo(host=&#39;metadata.google.internal&#39;, err=-2): Name or service not known
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] failed to create metadata connection
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] can&#39;t fetch token from the metadata server
    [2023/01/11 13:35:12] [ warn] [output:stackdriver:stackdriver.0] token retrieval failed
    [2023/01/11 13:35:12] [ warn] [net] getaddrinfo(host=&#39;metadata.google.internal&#39;, err=-2): Name or service not known
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] failed to create metadata connection
    [2023/01/11 13:35:12] [error] [output:stackdriver:stackdriver.0] can&#39;t fetch project id from the metadata server
    [2023/01/11 13:35:12] [error] [output] failed to initialize &#39;stackdriver&#39; plugin

答案1

得分: 0

在那个版本中存在一个错误: github.com/fluent/fluent-bit/issues/6691

英文:

There was a bug in that version: github.com/fluent/fluent-bit/issues/6691

huangapple
  • 本文由 发表于 2023年1月9日 16:34:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75054764.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定