open-telemetry / opentelemetry-operator

Kubernetes Operator for OpenTelemetry Collector
Apache License 2.0
1.16k stars 412 forks source link

OpenTelemetryCollector should have specific serviceAnnotations, podAnnotations, serviceLabels and podLabels settings #2884

Open diranged opened 4 months ago

diranged commented 4 months ago

Component(s)

collector

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

Today the operator copies the annotations and labels from the OpenTelemetryCollector objects to all of the resources it creates. This causes problems with tools like ArgoCD which use Annotations for resource tracking, so then the --annotations-filter flag was created. This is an unideal hack though because it's an all or nothing thing... and it means that we propagate labels and annotations to lots of resources where they don't make sense. For example, the service.kubernetes.io/topology-mode label has to be added to all the resources (clutster roles, pods, deployments, etc) when we really only want it on the service.

Describe the solution you'd like

I don't think that the Operator should automatically copy these Annotations or Labels at all ... and instead they should be defined as parameters.

Describe alternatives you've considered

No response

Additional context

No response

taer commented 1 month ago

I see https://github.com/open-telemetry/opentelemetry-operator/blob/main/docs/api.md#opentelemetrycollectorspec-1 has an option for podAnnotations, but not podLabels

Rohlik commented 1 week ago

We would also love to see support for podLabels for our use case, where we set a team label based on the owner's team and use that later on to route alerts.