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

Enabling operator.targetallocator.mtls results in non-existent certificate mounts for non-Prometheus collectors #3456

Open
thefirstofthe300 opened this issue Nov 14, 2024 · 5 comments · May be fixed by #3496
Labels
bug Something isn't working needs triage

Comments

@thefirstofthe300
Copy link

thefirstofthe300 commented Nov 14, 2024

Component(s)

No response

What happened?

Description

After enabling the operator.targetallocator.mtls, all OTEL collector deployments are updated with MTLS certificates; however, only the deployments which create a Target Allocator actually appear to create the necessary certificates.

Steps to Reproduce

  1. Install operator
  2. Enable operator.targetallocator.mtls feature gate
  3. Create deployment without target allocator
  4. Wait infinitely for ContainerCreating to never complete.

Expected Result

Only collectors which use the target allocator mount the target allocator cert.

Actual Result

All collectors attempt to mount a target allocator cert

Kubernetes Version

1.30.6

Operator version

0.113.0

Collector version

0.113.0

Environment information

No response

Log output

No response

Additional context

No response

@thefirstofthe300 thefirstofthe300 added bug Something isn't working needs triage labels Nov 14, 2024
@jaronoff97
Copy link
Contributor

@ItielOlenick would you be able to take a look at this?

@ItielOlenick
Copy link
Contributor

The feature was developed for use with the Target Allocator.
Perhaps I should add a check to see if the TA deployment is disabled and in that case disable the feature.

I believe using mTLS between the Collector and another drop-in should be introduced as a new feature.
It shouldn’t be hard to implement—essentially, it would involve extending the current solution by dropping the Target Allocator related operator tasks and only creating the relevant secrets so they can be used by the drop-in.

@thefirstofthe300 Could you share your use case?

@thefirstofthe300
Copy link
Author

thefirstofthe300 commented Nov 24, 2024 via email

@ItielOlenick
Copy link
Contributor

Nice catch! The issue is that the secrets are never created since the TA is not deployed.
I'll create a PR with a fix ensuring that the secrets are not mounted to the collector if the TA is not deployed and the feature gate is enabled.

@thefirstofthe300 out of curiosity—why would you enable mTLS between the TA and the Collector if the TA isn't being used? Im asking since that feature is specifically designed for use with the TA.

@thefirstofthe300
Copy link
Author

thefirstofthe300 commented Nov 26, 2024

@thefirstofthe300 out of curiosity—why would you enable mTLS between the TA and the Collector if the TA isn't being used? Im asking since that feature is specifically designed for use with the TA.

We are using the TA. We have two deployments. One with the TA and one without. Due to memory consumption of the Prometheus receiver, we isolate it to its own StatefulSet deployment. We need that deployment to scrape from secure endpoints so we need the certificate management there. Our statsd and OTEL receivers run as a DaemonSet deployment and make no use of the TA. We don't want to deploy TA for that deployment and don't need to bother with certs for it.

Both of the collectors are managed by the same operator which is why we need to enable the mTLS feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
3 participants