Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
himamulch opened this issue Jul 2, 2024 · 3 comments
Closed

Comments

@himamulch
Copy link

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
Copy link
Contributor

fyuan1316 commented Jul 2, 2024

Spec: corev1.PodSpec{
ServiceAccountName: ServiceAccountName(params.OtelCol),
InitContainers: params.OtelCol.Spec.InitContainers,
Containers: append(params.OtelCol.Spec.AdditionalContainers, Container(params.Config, params.Log, params.OtelCol, true)),
Volumes: Volumes(params.Config, params.OtelCol),
DNSPolicy: manifestutils.GetDNSPolicy(params.OtelCol.Spec.HostNetwork, params.OtelCol.Spec.PodDNSConfig),
DNSConfig: &params.OtelCol.Spec.PodDNSConfig,
HostNetwork: params.OtelCol.Spec.HostNetwork,
ShareProcessNamespace: &params.OtelCol.Spec.ShareProcessNamespace,
Tolerations: params.OtelCol.Spec.Tolerations,
NodeSelector: params.OtelCol.Spec.NodeSelector,
SecurityContext: params.OtelCol.Spec.PodSecurityContext,
PriorityClassName: params.OtelCol.Spec.PriorityClassName,
Affinity: params.OtelCol.Spec.Affinity,
TerminationGracePeriodSeconds: params.OtelCol.Spec.TerminationGracePeriodSeconds,
TopologySpreadConstraints: params.OtelCol.Spec.TopologySpreadConstraints,
},
},

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
Copy link
Contributor

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
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants