open-telemetry / opentelemetry-operator

Kubernetes Operator for OpenTelemetry Collector
Apache License 2.0
1.21k stars 440 forks source link

Use 0.0.0.0 as otlp receiver default address #3126

Closed frzifus closed 1 month ago

frzifus commented 4 months ago

Component(s)

collector

Is your feature request related to a problem? Please describe.

The 0.104.0 collector release enables component.UseLocalHostAsDefaultHost by default. Since this would be a breaking change for the users, the operator in 0.104.0 reverts this change by updating fields like :4317 or empty fields to 0.0.0.0:4317.

Describe the solution you'd like

Maybe it does make sense to use the collector default localhost in sidecar scenarios and the $POD_IP for all the other modes.


Update

Add upgrade routine and default webhook entry for the following components(source https://github.com/open-telemetry/opentelemetry-collector/issues/8510#issuecomment-1735292387):

Next:

Describe alternatives you've considered

Keep it like it is today or disable the component.UseLocalHostAsDefaultHost featuregate. (Which will be removed in the future).

Additional context

https://github.com/open-telemetry/opentelemetry-operator/pull/3119#discussion_r1674716212

frzifus commented 4 months ago

cc @jaronoff97 @pavolloffay @swiatekm

pavolloffay commented 4 months ago

$POD_IP makes more sense than 0:0:0:0 but I don't know if there is a big difference for deployment/SS pods, but maybe it matters more in e.g. daemonset .

matthagenbuch commented 4 months ago

For services running in kubernetes, the norm is to bind to the 0 address. Binding to pod_ip may be slightly more secure since it is a smaller surface area, but it could result in unexpected behavior, such as when using kubectl port-forward. As a user I would prefer binding to the 0 address by default for convention / convenience.

frzifus commented 4 months ago

Something you want to work on @led0nk? :)

led0nk commented 4 months ago

Yes, please

frzifus commented 4 months ago

Does it make sense to hide this behaviour behind a feature gate on the operator that we enable once we disable the component.UseLocalHostAsDefaultHost feature gate on the collector?

cc @pavolloffay @swiatekm @jaronoff97

jaronoff97 commented 4 months ago

would this featuregate be enabled by default and eventually removed?

frzifus commented 4 months ago

It should be enabled by default once component.UseLocalHostAsDefaultHost is removed on the collector side.