lhotari edited a comment on pull request #13376:
URL: https://github.com/apache/pulsar/pull/13376#issuecomment-1017249436


   Since some users might want to continue to run as root user to keep the 
existing behavior unchanged, it would be useful to add a feature to the Apache 
Pulsar Helm chart to be able to set security contexts for assigning the user to 
root user. That could reduce the risk of making the change to a non-root user.
   
   For debugging, I think it would be useful to document the way to get a shell 
in a container when that is needed.
   This is possible with "Ephemeral Containers" in k8s (beta in v1.23, [alpha 
since v1.16, requires the EphemeralContainers feature gate to be 
enabled](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features)):
   
https://kubernetes.io/docs/tasks/debug-application-cluster/debug-running-pod/#ephemeral-container
   
   Debugging with an ephemeral container would also require using 
`shareProcessNamespace: true` as described in
   
https://kubernetes.io/docs/tasks/configure-pod-container/share-process-namespace/
 . The consequence of this is also that the PID for the Java process might not 
be 1 anymore. 
   One of the gaps of `kubectl debug` is that it cannot currently create a 
privileged container with a specified user id. It's possible to create such 
containers with ephemeral containers (when the user has access and a security 
policy controller doesn't prevent it), so it's a gap in `kubectl debug`. These 
gaps will most likely be covered in the future in kubectl or kubectl plugins.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to