otterc commented on PR #58190:
URL: https://github.com/apache/spark/pull/58190#issuecomment-5370283168

   > When `SPARK_USER` env is absent, `Utils.getCurrentUserName()` falls back 
to `UserGroupInformation.getCurrentUser().getShortUserName()`, which _should_ 
return the proxy user, do you mean it does not set up doAs properly?
   
   I see what you mean. 
[SparkSubmit.submit()](https://github.com/apache/spark/blob/0919cd4052329fc1cb8160c5965eefd15ebb1edd/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#L168)
 wraps in `proxyUser.doAs(...)` before configurePod runs, so on the standard 
`bin/spark-submit --proxy-user` path `UGI.getCurrentUser().getShortUserName()` 
does return the proxy user and today's code works.
   
   However,  Spark Kubernetes Operator builds the driver pod by invoking the 
same feature steps, but not via `SparkSubmit.submit()`. It constructs the pod 
spec directly. Nothing wraps configurePod in proxyUser.doAs() there. 
UGI.getCurrentUser() returns the identity Spark Kubernetes Operator runs as. 
   Result: the driver pod is emitted with `SPARK_USER=spark` even when 
`spec.proxyUser=alice`.
   
   Setting the operator aside, `conf.proxyUser` is the value that's meant to be 
used here. It's already threaded through `KubernetesDriverConf`, and 
`DriverCommandFeatureStep` reads it directly. Using it in 
BasicDriverFeatureStep too keeps the feature steps consistent and removes the 
implicit dependency on being called from inside a doAs.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to