Skip to content

[Python]feat: Run auto-instrumentation init container as non-root user#736

Open
Miqueasher wants to merge 1 commit into
mainfrom
nonroot-user-fix-python
Open

[Python]feat: Run auto-instrumentation init container as non-root user#736
Miqueasher wants to merge 1 commit into
mainfrom
nonroot-user-fix-python

Conversation

@Miqueasher
Copy link
Copy Markdown
Contributor

@Miqueasher Miqueasher commented Apr 24, 2026

Problem

Customers enforcing runAsNonRoot: true via Pod Security Standards cannot use ADOT auto-instrumentation. Kubernetes checks the image metadata for a USER directive, finds none (defaults to UID 0 / root), and rejects the pod with:
Error: container has runAsNonRoot and image will run as root

Summary

Enables customers using the Kubernetes Restricted Pod Security Standard to use ADOT auto-instrumentation
Without this change, customers enforcing runAsNonRoot: true at the namespace or pod level cannot use ADOT auto-instrumentation because Kubernetes rejects the init container with:
container has runAsNonRoot and image will run as root

Follows the upstream OTel Operator fix (open-telemetry/opentelemetry-operator#2272)

Changes

Add USER 65534:65534 to the auto-instrumentation Dockerfile so the init container runs as non-root by default

Testing

Validated on EKS cluster (us-east-1, EKS v1.34.6) with CW Observability add-on v5.3.1

For more in-depth analysis please see Test Results
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Miqueasher Miqueasher requested a review from a team as a code owner April 24, 2026 20:54
@Miqueasher Miqueasher added the skip changelog doesn't need a CHANGELOG entry label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changelog doesn't need a CHANGELOG entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant