opentelemetry-operator icon indicating copy to clipboard operation
opentelemetry-operator copied to clipboard

Use 0.0.0.0 as otlp receiver default address

Open frzifus opened this issue 1 year ago • 8 comments

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:

  • [ ] Double check if we miss some components
  • [ ] Add upgrade routine to remove component.UseLocalHostAsDefaultHost feature-gate.
  • [ ] Remove component.UseLocalHostAsDefaultHost from defaulting webhook

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 avatar Jul 14 '24 11:07 frzifus

cc @jaronoff97 @pavolloffay @swiatekm

frzifus avatar Jul 14 '24 11:07 frzifus

$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 .

pavolloffay avatar Jul 15 '24 07:07 pavolloffay

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.

matthagenbuch avatar Jul 15 '24 18:07 matthagenbuch

Something you want to work on @led0nk? :)

frzifus avatar Jul 17 '24 17:07 frzifus

Yes, please

led0nk avatar Jul 17 '24 21:07 led0nk

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

frzifus avatar Jul 18 '24 13:07 frzifus

would this featuregate be enabled by default and eventually removed?

jaronoff97 avatar Jul 18 '24 13:07 jaronoff97

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

frzifus avatar Jul 18 '24 13:07 frzifus