open-telemetry / opentelemetry-operator

Kubernetes Operator for OpenTelemetry Collector
Apache License 2.0
1.15k stars 413 forks source link

Is it possible to have a sidecar with collector running in Deployment mode? #3092

Closed himamulch closed 1 month ago

himamulch commented 2 months ago

Component(s)

collector

Describe the issue you're reporting

Hi, I have an otel collector running as a deployment in EKS pod, using opentelemetry-operator. I have a requirement to have another container in the same collector pod. Is it possible to have this multi-container setup with the operator setup? The docs show an example of the collector running in sidecar mode which is the opposite of what I am looking for. Could you please advise. Thanks

fyuan1316 commented 2 months ago

https://github.com/open-telemetry/opentelemetry-operator/blob/ea97b6a17e7dfd23a67c09d4a84f23187e6aeb12/internal/manifests/collector/deployment.go#L59-L76

Hi @himamulch As you can see from the code, the native opentelemetry-operator does not support adding sidecar containers to the collector pod in deployment mode.

Perhaps you need to implement your own sidecar injection mechanism using the MutatingAdmissionWebhook. This is similar to how a typical istio service mesh creates sidecar container.

jaronoff97 commented 2 months ago

Right now we don't support the sidecar container definition, however, a user should be able to specify AdditionalContainers which run as a sidecar to the deployment pod.

jaronoff97 commented 1 month ago

I'm going to close this issue, please let me know if you have any issues setting additional containers