pan3793 commented on code in PR #45464:
URL: https://github.com/apache/spark/pull/45464#discussion_r1519858538
##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s/KubernetesExecutorBackend.scala:
##########
@@ -28,6 +28,46 @@ import org.apache.spark.rpc._
import org.apache.spark.scheduler.cluster.CoarseGrainedClusterMessages._
import org.apache.spark.util.Utils
+/**
+ * Custom implementation of CoarseGrainedExecutorBackend for Kubernetes
resource manager.
+ * This class provides kubernetes executor attributes.
+ */
+private[spark] class KubernetesExecutorBackend(
+ rpcEnv: RpcEnv,
+ appId: String,
+ driverUrl: String,
+ executorId: String,
+ bindAddress: String,
+ hostname: String,
+ podName: String,
+ cores: Int,
+ env: SparkEnv,
+ resourcesFile: Option[String],
+ resourceProfile: ResourceProfile)
+ extends CoarseGrainedExecutorBackend(
+ rpcEnv,
+ driverUrl,
+ executorId,
+ bindAddress,
+ hostname,
+ cores,
+ env,
+ resourcesFile,
+ resourceProfile) with Logging {
+
+ override def extractAttributes: Map[String, String] = {
+ super.extractAttributes ++
+ Map(
+ "LOG_FILES" -> "log",
+ "APP_ID" -> appId,
+ "EXECUTOR_ID" -> executorId,
+ "HOSTNAME" -> hostname,
+ "POD_NAME" -> podName
Review Comment:
the external log service for K8s is likely to use `namespace` and `pod name`
to query the logs, could you please expose NAMESPACE too?
--
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]