-
Notifications
You must be signed in to change notification settings - Fork 344
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
Allow for configuring the injected sidecar container's securityContext #1186
Comments
If there's a security context for individual containers in a pod, the Jaeger Agent container should indeed use the security context from the Jaeger's CR. The fix would be somewhere around here: jaeger-operator/pkg/inject/sidecar.go Lines 230 to 279 in d941663
And here's the Dockerfile for Jaeger Agent: https://github.com/jaegertracing/jaeger/blob/master/cmd/agent/Dockerfile |
Sounds good! I'll create a PR to add the securityContext and will also propose to update the Dockerfile. |
Unfortunately, I can't just use the Jaeger CommonSpec's securityContext as that is a `PodSecurityContext` whereas the sidecar can only have a `SecurityContext`. This required me to add an additional config option `containerSecurityContext`. This does add some redundancy as the `Jaeger.Spec.SecurityContext` is not reused. Is `sidecarContainerSecurityContext` a better name for this config option as the other agent deployments do use the default pod security context? Resolves #1186
Unfortunately, I can't just use the Jaeger CommonSpec's securityContext as that is a `PodSecurityContext` whereas the sidecar can only have a `SecurityContext`. This required me to add an additional config option `containerSecurityContext`. This does add some redundancy as the `Jaeger.Spec.SecurityContext` is not reused. Is `sidecarContainerSecurityContext` a better name for this config option as the other agent deployments do use the default pod security context? Resolves jaegertracing#1186 Signed-off-by: Prageeth Warnak <[email protected]>
Currently, the securityContext of the injected jaeger-agent container can not be configured, causing the agent container to fail with "container has runAsNonRoot and image will run as root" when running in a cluster with strict PSPs.
We could reuse the securityContext from the common jaeger spec (as in #1166) or add a a securityContext element to the Spec.Agent type.
In addition, a lot of headaches may be avoided by setting the the jaeger-agent container user to a non-root one by default. This should be realtively straight-forward as I don't think the jaeger-agent requires any privileges or disk access. I'd like to create a PR for this, but I can't find the jaeger-agent image's Dockerfile.
The text was updated successfully, but these errors were encountered: