Dynatrace Operator version 1.11.0+
When Dynatrace Operator injects an init-container into your pods, it configures the security context based on your pod or container settings. You can use annotations to explicitly configure the runAsUser and runAsGroup values for the Dynatrace Operator injected init-container.
Apply these annotations at the pod level:
init-container.dynatrace.com/securityContext.runAsUser: Configures the runAsUser value for the init-container. Must be a positive integer. If not provided or invalid, the default behavior applies.
init-container.dynatrace.com/securityContext.runAsGroup: Configures the runAsGroup value for the init-container. Must be a positive integer. If not provided or invalid, the default behavior applies.
When these annotations are not provided, the init-container applies the following logic:
runAsUser or runAsGroup is configured on the first user container or at the pod level, the init-container copies those settingsrunAsUser: 1001 and runAsGroup: 1001apiVersion: v1kind: Podmetadata:name: my-appannotations:init-container.dynatrace.com/securityContext.runAsUser: "1000"init-container.dynatrace.com/securityContext.runAsGroup: "1000"spec:containers:- name: appimage: my-app:latest