Skip to content

Health check extension with default configuration doesn't work in k8s environment anymore #2827

@dmitryax

Description

@dmitryax

Describe the bug
After this change #2782, the default endpoint for health check listener got changes from :13133 to localhost:13133. This listener endpoint doesn't work by default in environments like kubernetes where health check requests are coming from the outside.

Steps to reproduce
Run the latest build in k8s environment.

What did you expect to see?
Otel collector pod is up and running.

What did you see instead?
Liveness probes to the Otel collector pod are failing on and the pod is being killed.

  Normal   Killing    27m (x2 over 27m)     kubelet            Container otel-collector failed liveness probe, will be restarted

Logs related to health_check extension:

2021-03-26T22:21:33.809Z	info	healthcheckextension/healthcheckextension.go:41	Starting health_check extension	{"component_kind": "extension", "component_type": "health_check", "component_name": "health_check", "config": {"TypeVal":"health_check","NameVal":"health_check","Port":0,"TCPAddr":{"Endpoint":"localhost:13133"}}}
2021-03-26T22:21:33.809Z	info	builder/extensions_builder.go:59	Extension started.	{"component_kind": "extension", "component_type": "health_check", "component_name": "health_check"}

What version did you use?
The latest dev build: f5bfc3c

What config did you use?
Any config with heath_check extension enabled with default config.

Environment
Kubernetes cluster

Additional context
Suggested solution: Change default configuration for health_check
from

      health_check:
        endpoint: localhost:13133

to

      health_check:
        endpoint: 0.0.0.0:13133

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions