@@ -349,42 +349,43 @@ package object config extends Logging {
349
349
.stringConf
350
350
.createOptional
351
351
352
+ private [spark] val RESOURCE_STAGING_SERVER_SSL_NAMESPACE = " kubernetes.resourceStagingServer"
352
353
private [spark] val RESOURCE_STAGING_SERVER_CERT_PEM =
353
- ConfigBuilder (" spark.ssl.kubernetes.resourceStagingServer .serverCertPem" )
354
+ ConfigBuilder (s " spark.ssl. $RESOURCE_STAGING_SERVER_SSL_NAMESPACE .serverCertPem " )
354
355
.doc(" Certificate PEM file to use when having the Kubernetes dependency server" +
355
356
" listen on TLS." )
356
357
.stringConf
357
358
.createOptional
358
359
359
360
private [spark] val RESOURCE_STAGING_SERVER_KEYSTORE_PASSWORD_FILE =
360
- ConfigBuilder (" spark.ssl.kubernetes.resourceStagingServer .keyStorePasswordFile" )
361
+ ConfigBuilder (s " spark.ssl. $RESOURCE_STAGING_SERVER_SSL_NAMESPACE .keyStorePasswordFile " )
361
362
.doc(" File containing the keystore password for the Kubernetes dependency server." )
362
363
.stringConf
363
364
.createOptional
364
365
365
366
private [spark] val RESOURCE_STAGING_SERVER_KEYSTORE_KEY_PASSWORD_FILE =
366
- ConfigBuilder (" spark.ssl.kubernetes.resourceStagingServer .keyPasswordFile" )
367
+ ConfigBuilder (s " spark.ssl. $RESOURCE_STAGING_SERVER_SSL_NAMESPACE .keyPasswordFile " )
367
368
.doc(" File containing the key password for the Kubernetes dependency server." )
368
369
.stringConf
369
370
.createOptional
370
371
371
372
private [spark] val RESOURCE_STAGING_SERVER_SSL_ENABLED =
372
- ConfigBuilder (" spark.ssl.kubernetes.resourceStagingServer .enabled" )
373
+ ConfigBuilder (s " spark.ssl. $RESOURCE_STAGING_SERVER_SSL_NAMESPACE .enabled " )
373
374
.doc(" Whether or not to use SSL when communicating with the dependency server." )
374
375
.booleanConf
375
376
.createOptional
376
377
private [spark] val RESOURCE_STAGING_SERVER_TRUSTSTORE_FILE =
377
- ConfigBuilder (" spark.ssl.kubernetes.resourceStagingServer .trustStore" )
378
+ ConfigBuilder (s " spark.ssl. $RESOURCE_STAGING_SERVER_SSL_NAMESPACE .trustStore " )
378
379
.doc(" File containing the trustStore to communicate with the Kubernetes dependency server." )
379
380
.stringConf
380
381
.createOptional
381
382
private [spark] val RESOURCE_STAGING_SERVER_TRUSTSTORE_PASSWORD =
382
- ConfigBuilder (" spark.ssl.kubernetes.resourceStagingServer .trustStorePassword" )
383
+ ConfigBuilder (s " spark.ssl. $RESOURCE_STAGING_SERVER_SSL_NAMESPACE .trustStorePassword " )
383
384
.doc(" Password for the trustStore for talking to the dependency server." )
384
385
.stringConf
385
386
.createOptional
386
387
private [spark] val RESOURCE_STAGING_SERVER_TRUSTSTORE_TYPE =
387
- ConfigBuilder (" spark.ssl.kubernetes.resourceStagingServer .trustStoreType" )
388
+ ConfigBuilder (s " spark.ssl. $RESOURCE_STAGING_SERVER_SSL_NAMESPACE .trustStoreType " )
388
389
.doc(" Type of trustStore for communicating with the dependency server." )
389
390
.stringConf
390
391
.createOptional
@@ -397,64 +398,120 @@ package object config extends Logging {
397
398
.createOptional
398
399
399
400
private [spark] val INIT_CONTAINER_DOWNLOAD_JARS_RESOURCE_IDENTIFIER =
400
- ConfigBuilder (" spark.kubernetes.driver. initcontainer.downloadJarsResourceIdentifier" )
401
+ ConfigBuilder (" spark.kubernetes.initcontainer.downloadJarsResourceIdentifier" )
401
402
.doc(" Identifier for the jars tarball that was uploaded to the staging service." )
402
403
.internal()
403
404
.stringConf
404
405
.createOptional
405
406
406
407
private [spark] val INIT_CONTAINER_DOWNLOAD_JARS_SECRET_LOCATION =
407
- ConfigBuilder (" spark.kubernetes.driver. initcontainer.downloadJarsSecretLocation" )
408
+ ConfigBuilder (" spark.kubernetes.initcontainer.downloadJarsSecretLocation" )
408
409
.doc(" Location of the application secret to use when the init-container contacts the" +
409
410
" resource staging server to download jars." )
410
411
.internal()
411
412
.stringConf
412
- .createWithDefault(INIT_CONTAINER_DOWNLOAD_JARS_SECRET_PATH )
413
+ .createWithDefault(s " $INIT_CONTAINER_SECRET_VOLUME_MOUNT_PATH/ " +
414
+ s " $INIT_CONTAINER_SUBMITTED_JARS_SECRET_KEY" )
413
415
414
416
private [spark] val INIT_CONTAINER_DOWNLOAD_FILES_RESOURCE_IDENTIFIER =
415
- ConfigBuilder (" spark.kubernetes.driver. initcontainer.downloadFilesResourceIdentifier" )
417
+ ConfigBuilder (" spark.kubernetes.initcontainer.downloadFilesResourceIdentifier" )
416
418
.doc(" Identifier for the files tarball that was uploaded to the staging service." )
417
419
.internal()
418
420
.stringConf
419
421
.createOptional
420
422
421
423
private [spark] val INIT_CONTAINER_DOWNLOAD_FILES_SECRET_LOCATION =
422
- ConfigBuilder (" spark.kubernetes.driver. initcontainer.downloadFilesSecretLocation" )
424
+ ConfigBuilder (" spark.kubernetes.initcontainer.downloadFilesSecretLocation" )
423
425
.doc(" Location of the application secret to use when the init-container contacts the" +
424
426
" resource staging server to download files." )
425
427
.internal()
426
428
.stringConf
427
- .createWithDefault(INIT_CONTAINER_DOWNLOAD_FILES_SECRET_PATH )
429
+ .createWithDefault(
430
+ s " $INIT_CONTAINER_SECRET_VOLUME_MOUNT_PATH/ $INIT_CONTAINER_SUBMITTED_FILES_SECRET_KEY" )
431
+
432
+ private [spark] val INIT_CONTAINER_REMOTE_JARS =
433
+ ConfigBuilder (" spark.kubernetes.initcontainer.remoteJars" )
434
+ .doc(" Comma-separated list of jar URIs to download in the init-container. This is" +
435
+ " calculated from spark.jars." )
436
+ .internal()
437
+ .stringConf
438
+ .createOptional
439
+
440
+ private [spark] val INIT_CONTAINER_REMOTE_FILES =
441
+ ConfigBuilder (" spark.kubernetes.initcontainer.remoteFiles" )
442
+ .doc(" Comma-separated list of file URIs to download in the init-container. This is" +
443
+ " calculated from spark.files." )
444
+ .internal()
445
+ .stringConf
446
+ .createOptional
428
447
429
448
private [spark] val INIT_CONTAINER_DOCKER_IMAGE =
430
- ConfigBuilder (" spark.kubernetes.driver. initcontainer.docker.image" )
431
- .doc(" Image for the driver's init-container that downloads mounted dependencies." )
449
+ ConfigBuilder (" spark.kubernetes.initcontainer.docker.image" )
450
+ .doc(" Image for the driver and executor 's init-container that downloads dependencies." )
432
451
.stringConf
433
- .createWithDefault(s " spark-driver- init: $sparkVersion" )
452
+ .createWithDefault(s " spark-init: $sparkVersion" )
434
453
435
- private [spark] val DRIVER_LOCAL_JARS_DOWNLOAD_LOCATION =
436
- ConfigBuilder (" spark.kubernetes.driver. mountdependencies.jarsDownloadDir" )
437
- .doc(" Location to download local jars to in the driver. When using spark-submit, this " +
438
- " directory must be empty and will be mounted as an empty directory volume on the " +
439
- " driver pod." )
454
+ private [spark] val INIT_CONTAINER_JARS_DOWNLOAD_LOCATION =
455
+ ConfigBuilder (" spark.kubernetes.mountdependencies.jarsDownloadDir" )
456
+ .doc(" Location to download jars to in the driver and executors . When using" +
457
+ " spark-submit, this directory must be empty and will be mounted as an empty directory" +
458
+ " volume on the driver and executor pod." )
440
459
.stringConf
441
- .createWithDefault(" /var/spark-data/spark-local -jars" )
460
+ .createWithDefault(" /var/spark-data/spark-submitted -jars" )
442
461
443
- private [spark] val DRIVER_LOCAL_FILES_DOWNLOAD_LOCATION =
444
- ConfigBuilder (" spark.kubernetes.driver. mountdependencies.filesDownloadDir" )
445
- .doc(" Location to download local files to in the driver. When using spark-submit, this " +
446
- " directory must be empty and will be mounted as an empty directory volume on the " +
447
- " driver pod ." )
462
+ private [spark] val INIT_CONTAINER_FILES_DOWNLOAD_LOCATION =
463
+ ConfigBuilder (" spark.kubernetes.mountdependencies.filesDownloadDir" )
464
+ .doc(" Location to download files to in the driver and executors . When using" +
465
+ " spark-submit, this directory must be empty and will be mounted as an empty directory" +
466
+ " volume on the driver and executor pods ." )
448
467
.stringConf
449
- .createWithDefault(" /var/spark-data/spark-local -files" )
468
+ .createWithDefault(" /var/spark-data/spark-submitted -files" )
450
469
451
- private [spark] val DRIVER_MOUNT_DEPENDENCIES_INIT_TIMEOUT =
470
+ private [spark] val INIT_CONTAINER_MOUNT_TIMEOUT =
452
471
ConfigBuilder (" spark.kubernetes.mountdependencies.mountTimeout" )
453
472
.doc(" Timeout before aborting the attempt to download and unpack local dependencies from" +
454
- " the dependency staging server when initializing the driver pod." )
473
+ " remote locations and the resource staging server when initializing the driver and" +
474
+ " executor pods." )
455
475
.timeConf(TimeUnit .MINUTES )
456
476
.createWithDefault(5 )
457
477
478
+ private [spark] val EXECUTOR_INIT_CONTAINER_CONFIG_MAP =
479
+ ConfigBuilder (" spark.kubernetes.initcontainer.executor.configmapname" )
480
+ .doc(" Name of the config map to use in the init-container that retrieves submitted files" +
481
+ " for the executor." )
482
+ .internal()
483
+ .stringConf
484
+ .createOptional
485
+
486
+ private [spark] val EXECUTOR_INIT_CONTAINER_CONFIG_MAP_KEY =
487
+ ConfigBuilder (" spark.kubernetes.initcontainer.executor.configmapkey" )
488
+ .doc(" Key for the entry in the init container config map for submitted files that" +
489
+ " corresponds to the properties for this init-container." )
490
+ .internal()
491
+ .stringConf
492
+ .createOptional
493
+
494
+ private [spark] val EXECUTOR_INIT_CONTAINER_SECRET =
495
+ ConfigBuilder (" spark.kubernetes.initcontainer.executor.stagingServerSecret.name" )
496
+ .doc(" Name of the secret to mount into the init-container that retrieves submitted files." )
497
+ .internal()
498
+ .stringConf
499
+ .createOptional
500
+
501
+ private [spark] val EXECUTOR_INIT_CONTAINER_SECRET_MOUNT_DIR =
502
+ ConfigBuilder (" spark.kubernetes.initcontainer.executor.stagingServerSecret.mountDir" )
503
+ .doc(" Directory to mount the resource staging server secrets into for the executor" +
504
+ " init-containers. This must be exactly the same as the directory that the submission" +
505
+ " client mounted the secret into because the config map's properties specify the" +
506
+ " secret location as to be the same between the driver init-container and the executor" +
507
+ " init-container. Thus the submission client will always set this and the driver will" +
508
+ " never rely on a constant or convention, in order to protect against cases where the" +
509
+ " submission client has a different version from the driver itself, and hence might" +
510
+ " have different constants loaded in constants.scala." )
511
+ .internal()
512
+ .stringConf
513
+ .createOptional
514
+
458
515
private [spark] def resolveK8sMaster (rawMasterString : String ): String = {
459
516
if (! rawMasterString.startsWith(" k8s://" )) {
460
517
throw new IllegalArgumentException (" Master URL should start with k8s:// in Kubernetes mode." )
0 commit comments