Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

otelcol.exporter.loadbalancing fails with no configuration has been provided, try setting KUBERNETES_MASTER environment variable #33820

Closed
bvsvas opened this issue Jul 1, 2024 · 3 comments
Labels
bug Something isn't working exporter/loadbalancing needs triage New item requiring triage

Comments

@bvsvas
Copy link

bvsvas commented Jul 1, 2024

Component(s)

exporter/loadbalancing

What happened?

Description

Loadbalancing exporter fails to start.

Error message:

2024-07-01T10:20:51.981Z        debug   extension@v0.103.0/extension.go:170     Beta component. May change in the future.       {"kind": "extension", "name": "health_check"}
2024-07-01T10:20:51.982Z        debug   exporter@v0.103.0/exporter.go:278       Beta component. May change in the future.       {"kind": "exporter", "data_type": "traces", "name": "loadbalancing"}
Error: failed to build pipelines: failed to create "loadbalancing" exporter for data type "traces": invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
2024/07/01 10:20:51 collector server run finished with error: failed to build pipelines: failed to create "loadbalancing" exporter for data type "traces": invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

Note: It works if I change k8s resolver to dns resolver. This error comes only with k8s resolver (configuration in the below).

Steps to Reproduce

  1. Create OpenTelemetry Collector with loadbalance exporter

Image: otel/opentelemetry-collector-contrib:0.103.0

Loadbalance exporter configuration

    extensions:
      health_check:
        endpoint: 0.0.0.0:13133
        path: "/health"
    exporters:
      loadbalancing:
        protocol:
          otlp:
            timeout: 1s
            tls:
              insecure: true
        resolver:
          k8s:
            service: dx-otelcol-ingester-service.dxotel
            ports:
            - 4318
            - 4317
    processors:
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
    service:
      telemetry:
        logs:
          level: debug
      extensions: [health_check]
      pipelines:
        metrics:
          exporters:
            - loadbalancing
          processors: []
          receivers:
            - otlp
        traces:
          exporters:
            - loadbalancing
          processors: []
          receivers:
            - otlp

Deployment: (only container section pasted here)

   containers:
      - command:
        - /otelcol-contrib
        - --config=/etc/otel/conf/dx-collector-lb.yaml
        env:
        - name: OTEL_POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: OTEL_POD_IP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.podIP
        - name: KUBERNETES_MASTER
          value: https://kubernetes.default.svc
        - name: KUBERNETES_SERVICE_HOST
          value: kubernetes.default.svc
        - name: KUBERNETES_SERVICE_PORT
          value: "443"
        image: otel/opentelemetry-collector-contrib:0.103.0
        imagePullPolicy: Always
        name: otel-lb
        ports:
        - containerPort: 4317
          name: otlp-grpc
          protocol: TCP
        - containerPort: 4318
          name: otlp-http
          protocol: TCP
        resources: {}
        securityContext: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /etc/otel/conf
          name: otel-collector-configmap-vol

Note: Created role and role binding with endpoint, services, pods as well.

Expected Result

otelcol pod up and running with loadbalancing exporter.

Actual Result

pod is in CrashLoopBackOff with error.

Collector version

0.103.0

Environment information

Environment

OS: CentOS v8
Kubernetes Server: v1.28.3

OpenTelemetry Collector configuration

extensions:
      health_check:
        endpoint: 0.0.0.0:13133
        path: "/health"
    exporters:
      loadbalancing:
        protocol:
          otlp:
            timeout: 1s
            tls:
              insecure: true
        resolver:
          k8s:
            service: dx-otelcol-ingester-service.dxotel
            ports:
            - 4318
            - 4317
    processors:
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
    service:
      telemetry:
        logs:
          level: debug
      extensions: [health_check]
      pipelines:
        metrics:
          exporters:
            - loadbalancing
          processors: []
          receivers:
            - otlp
        traces:
          exporters:
            - loadbalancing
          processors: []
          receivers:
            - otlp

Log output

2024-07-01T10:31:56.738Z        info    service@v0.103.0/service.go:115 Setting up own telemetry...
2024-07-01T10:31:56.738Z        info    service@v0.103.0/telemetry.go:96        Serving metrics {"address": ":8888", "level": "Normal"}
2024-07-01T10:31:56.738Z        debug   extension@v0.103.0/extension.go:170     Beta component. May change in the future.       {"kind": "extension", "name": "health_check"}
2024-07-01T10:31:56.738Z        info    exporter@v0.103.0/exporter.go:280       Development component. May change in the future.        {"kind": "exporter", "data_type": "metrics", "name": "loadbalancing"}
Error: failed to build pipelines: failed to create "loadbalancing" exporter for data type "metrics": invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
2024/07/01 10:31:56 collector server run finished with error: failed to build pipelines: failed to create "loadbalancing" exporter for data type "metrics": invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

Additional context

No response

@bvsvas bvsvas added bug Something isn't working needs triage New item requiring triage labels Jul 1, 2024
Copy link
Contributor

github-actions bot commented Jul 1, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@codefromthecrypt
Copy link
Contributor

@bvsvas
Copy link
Author

bvsvas commented Jul 2, 2024

Yes, it seems the issue was related to the Kubernetes cluster setup on our local environment. We reinstalled the Kubernetes cluster, and it appears to be working fine now.

@bvsvas bvsvas closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exporter/loadbalancing needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

2 participants