-
Notifications
You must be signed in to change notification settings - Fork 33
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
Support send data to remote Otel collector #931
Comments
This is an exhaustive card, thanks for the research work @jvanz 👏 I envision the user setting the otel configuration values (the endpoint address and the name of the Secret/ConfigMap holding the CA) with our helm chart. This will then be translated by the helm chart either using env variables or flags. I think the tricky part is how to propagate that to the policy-server, especially the CA to be trusted. That's because the kubewarden-controller isn't aware of the origin of the CA (what is the name and namespace of the Secret/ConfigMap). Another option could be to let the user configure this detail on the PolicyServer CRD. The kubewarden defaults helm chart could take care of that with the helm chart, but the user would be in charge of managing this detail for their custom PolicyServer instances. Each approach has its pros and cons. I think we should discuss about them together |
Good spike!
We have:
I suppose we either hardcode things:
Or we pass them into the PolicyServer CRD. At this point I vote to bite the bullet and add it to the CRD, simplifies custom PolicyServer instances. |
Thanks! Ah, sorry, I should be more precise what I think that we should do. The acceptance criteria is too generic.
Yes, that's what I have in mind as well.
What I have in mind is that we should add another field in the CRD to allow user to mount secret with the certificate in the policy server deployment. Following the same patner we do for the environment variable. |
Thanks for the spike! It looks like we could help OpenTelemetry by adding the missing environment variables. I checked the codebase, and |
On second thought, we have PolicyServer's |
@kubewarden/kubewarden-developers I've created three issue to keep track of the changes in the controller, policy server and helm chart. Can you please review it as well? Let me know if I forgot to add something from our conversation earlier Today. |
This epic is done and released on Kubewarden |
This epic describe the changes required to allow Kubewarden to integrate with other kinds of OpenTelemetry collector deployments modes. Right now, the only supported is to send data to OpenTelemetry collector running as sidecar. However sidecar does not allow fetch metadata from the Kubernetes cluster. Therefore, we decided to review how we integrate with Otel collectors. This is a spin off of this issue
This epic has two major goals:
To allow us to integrate better with Otel collectors we need to allow the Kubewarden controller and the Policy server created by it to send data to collectors running somewhere else in the cluster. This means that we need to configure the exporter in the controller and the policy server to send data to a remote endpoint. Gladly, most of the configuration of the used libraries (go and rust) allow the users to configure the endpoint using environment variables. Besides that, controller already have a CLI flag that allow Otel endpoint customization which the default values is localhost (the sidecar endpoint). Policy server code does not have this CLI flag. But the rust library allow customization using environment variables
For the Go code, both traces and metrics exporters in the OpenTelemetry packages have environment variables used to define endpoints, certificates and many more configuration to send data to the Otel collector. For example:
Therefore, we can use this environment variables to configure the exporter with minimum need of change in the code base. But it's necessary to configure this values in the controller deployment and allow the mounting of the certificate files in the pods.
For the Rust code base, it's also possible to define the endpoint using environment variables. However, it's not possible to define the path of the certificate to be used as in the Go packages (there is an open issue for that). Therefore, the policy server code should be change to add the certificate defined by the user using a environment variable or a CLI flag.
Acceptance criteria
The text was updated successfully, but these errors were encountered: