kubernetes Fluent-bit Opentelemetry INPUT上的连接拒绝错误

kr98yfug  于 2023-08-03  发布在  Kubernetes
关注(0)|答案(1)|浏览(137)

我正在尝试使用Opentelemetry INPUT plugin将日志从 Opentelemetry Collector Contrib(导出)发送到 Fluent-bit。但我在OTel Contrib pod中得到错误:

2023-06-30T14:17:07.770Z    warn    zapgrpc/zapgrpc.go:191  [core] [Channel #3 SubChannel #4] grpc: addrConn.createTransport failed to connect to {
  "Addr": "opentelemetry-fluent-bit.myNs.svc.cluster.local:4318",
  "ServerName": "opentelemetry-fluent-bit.myNS.svc.cluster.local:4318",
  "Attributes": null,
  "BalancerAttributes": null,
  "Type": 0,
  "Metadata": null
}. Err: connection error: desc = "transport: Error while dialing dial tcp 10.96.150.150:4318: connect: connection refused"  {"grpc_log": true}

字符串
它们都在Kubernetes上作为Pod运行(在Doker Desktop中)。
下面是我的流利位yaml:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: opentelemetry-fluent-bit
  namespace: myNS
  labels:
    app: opentelemetry-fluent-bit
spec:
  # replicas: 1
  selector:
    matchLabels:
      app: opentelemetry-fluent-bit
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      namespace: myNS
      labels:
        app: opentelemetry-fluent-bit
    spec:
      containers:
        - name: fluent-bit
          image: fluent/fluent-bit
          ports:
          - name: http
            containerPort: 4318
            protocol: TCP
          volumeMounts:
            - name: fluent-bit-config-vol
              mountPath: /fluent-bit/etc/
          resources:
            limits:
              memory: 1500Mi
              cpu: 500m
            requests:
              memory: 500Mi
              cpu: 500m
      serviceAccountName: otel-collector
      volumes:
        - name: fluent-bit-config-vol
          configMap:
            name: fluent-bit-config
      nodeSelector:
        kubernetes.io/os: linux
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: fluent-bit-config
  namespace: myNS
data:
  # Configuration files: server, input, filters and output
  # ======================================================
  fluent-bit.conf: |
    [SERVICE]
        Flush         1
        Parsers_File  parsers.conf

    [INPUT]
        name              opentelemetry
        listen            127.0.0.1
        port              4318

    [OUTPUT]
        name              stdout
        match             *

  parsers.conf: |
    [PARSER]
        Name               jsonparser
        Format             json

---
apiVersion: v1
kind: Service
metadata:
  name: opentelemetry-fluent-bit
  namespace: myNS
  labels:
    app: opentelemetry-fluent-bit
spec:
  type: ClusterIP
  ports:
    - name: http
      port: 4318
      protocol: TCP
      targetPort: http
  selector:
    app: opentelemetry-fluent-bit


这里是OTel Contrib中的yaml部分:

...
exporters:
      
      otlp/fb:
        endpoint: http://opentelemetry-fluent-bit.myNS.svc.cluster.local:4318
        tls:
          insecure: true
...


有提示吗?谢谢。

相关问题