sarutak commented on code in PR #57977:
URL: https://github.com/apache/spark/pull/57977#discussion_r3772817281


##########
core/src/main/scala/org/apache/spark/SparkContext.scala:
##########
@@ -451,7 +451,8 @@ class SparkContext(config: SparkConf) extends Logging {
     // Set Spark driver host and port system properties. This explicitly sets 
the configuration
     // instead of relying on the default value of the config constant.
     if (SparkMasterRegex.isK8s(master) &&
-        _conf.getBoolean("spark.kubernetes.executor.useDriverPodIP", true)) {
+        _conf.getBoolean("spark.kubernetes.executor.useDriverPodIP", true) &&
+        !Utils.isAnyLocalAddress(_conf.get(DRIVER_BIND_ADDRESS))) {

Review Comment:
   nit: When the wildcard fallback is taken, could we add a log line so users 
know why DRIVER_BIND_ADDRESS wasn't used as the advertised address? e.g.:
   ```
   logInfo(log"spark.kubernetes.executor.useDriverPodIP is true but bind 
address " +
     log"${MDC(LogKeys.BIND_ADDRESS, _conf.get(DRIVER_BIND_ADDRESS))} is a 
wildcard; " +
     log"preserving advertised driver host ${MDC(LogKeys.HOST, 
_conf.get(DRIVER_HOST_ADDRESS))}")
   ```
     
     This would help users debug cases where they set useDriverPodIP=true but 
the bind address is intentionally `0.0.0.0` or `::`.
   



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