|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + * contributor license agreements. See the NOTICE file distributed with |
| 4 | + * this work for additional information regarding copyright ownership. |
| 5 | + * The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | + * (the "License"); you may not use this file except in compliance with |
| 7 | + * the License. You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | +package org.apache.spark.deploy.kubernetes |
| 18 | + |
| 19 | +import java.util.concurrent.TimeUnit |
| 20 | + |
| 21 | +import org.apache.spark.{SPARK_VERSION => sparkVersion} |
| 22 | +import org.apache.spark.internal.config.ConfigBuilder |
| 23 | + |
| 24 | +package object config { |
| 25 | + |
| 26 | + private[spark] val KUBERNETES_NAMESPACE = |
| 27 | + ConfigBuilder("spark.kubernetes.namespace") |
| 28 | + .doc(""" |
| 29 | + | The namespace that will be used for running the driver and |
| 30 | + | executor pods. When using spark-submit in cluster mode, |
| 31 | + | this can also be passed to spark-submit via the |
| 32 | + | --kubernetes-namespace command line argument. |
| 33 | + """.stripMargin) |
| 34 | + .stringConf |
| 35 | + .createWithDefault("default") |
| 36 | + |
| 37 | + private[spark] val DRIVER_DOCKER_IMAGE = |
| 38 | + ConfigBuilder("spark.kubernetes.driver.docker.image") |
| 39 | + .doc(""" |
| 40 | + | Docker image to use for the driver. Specify this using the |
| 41 | + | standard Docker tag format. |
| 42 | + """.stripMargin) |
| 43 | + .stringConf |
| 44 | + .createWithDefault(s"spark-driver:$sparkVersion") |
| 45 | + |
| 46 | + private[spark] val EXECUTOR_DOCKER_IMAGE = |
| 47 | + ConfigBuilder("spark.kubernetes.executor.docker.image") |
| 48 | + .doc(""" |
| 49 | + | Docker image to use for the executors. Specify this using |
| 50 | + | the standard Docker tag format. |
| 51 | + """.stripMargin) |
| 52 | + .stringConf |
| 53 | + .createWithDefault(s"spark-executor:$sparkVersion") |
| 54 | + |
| 55 | + private[spark] val KUBERNETES_CA_CERT_FILE = |
| 56 | + ConfigBuilder("spark.kubernetes.submit.caCertFile") |
| 57 | + .doc(""" |
| 58 | + | CA cert file for connecting to Kubernetes over SSL. This |
| 59 | + | file should be located on the submitting machine's disk. |
| 60 | + """.stripMargin) |
| 61 | + .stringConf |
| 62 | + .createOptional |
| 63 | + |
| 64 | + private[spark] val KUBERNETES_CLIENT_KEY_FILE = |
| 65 | + ConfigBuilder("spark.kubernetes.submit.clientKeyFile") |
| 66 | + .doc(""" |
| 67 | + | Client key file for authenticating against the Kubernetes |
| 68 | + | API server. This file should be located on the submitting |
| 69 | + | machine's disk. |
| 70 | + """.stripMargin) |
| 71 | + .stringConf |
| 72 | + .createOptional |
| 73 | + |
| 74 | + private[spark] val KUBERNETES_CLIENT_CERT_FILE = |
| 75 | + ConfigBuilder("spark.kubernetes.submit.clientCertFile") |
| 76 | + .doc(""" |
| 77 | + | Client cert file for authenticating against the |
| 78 | + | Kubernetes API server. This file should be located on |
| 79 | + | the submitting machine's disk. |
| 80 | + """.stripMargin) |
| 81 | + .stringConf |
| 82 | + .createOptional |
| 83 | + |
| 84 | + private[spark] val KUBERNETES_SERVICE_ACCOUNT_NAME = |
| 85 | + ConfigBuilder("spark.kubernetes.submit.serviceAccountName") |
| 86 | + .doc(""" |
| 87 | + | Service account that is used when running the driver pod. |
| 88 | + | The driver pod uses this service account when requesting |
| 89 | + | executor pods from the API server. |
| 90 | + """.stripMargin) |
| 91 | + .stringConf |
| 92 | + .createWithDefault("default") |
| 93 | + |
| 94 | + private[spark] val KUBERNETES_DRIVER_UPLOAD_JARS = |
| 95 | + ConfigBuilder("spark.kubernetes.driver.uploads.jars") |
| 96 | + .doc(""" |
| 97 | + | Comma-separated list of jars to sent to the driver and |
| 98 | + | all executors when submitting the application in cluster |
| 99 | + | mode. |
| 100 | + """.stripMargin) |
| 101 | + .stringConf |
| 102 | + .createOptional |
| 103 | + |
| 104 | + // Note that while we set a default for this when we start up the |
| 105 | + // scheduler, the specific default value is dynamically determined |
| 106 | + // based on the executor memory. |
| 107 | + private[spark] val KUBERNETES_EXECUTOR_MEMORY_OVERHEAD = |
| 108 | + ConfigBuilder("spark.kubernetes.executor.memoryOverhead") |
| 109 | + .doc(""" |
| 110 | + | The amount of off-heap memory (in megabytes) to be |
| 111 | + | allocated per executor. This is memory that accounts for |
| 112 | + | things like VM overheads, interned strings, other native |
| 113 | + | overheads, etc. This tends to grow with the executor size |
| 114 | + | (typically 6-10%). |
| 115 | + """.stripMargin) |
| 116 | + .stringConf |
| 117 | + .createOptional |
| 118 | + |
| 119 | + private[spark] val KUBERNETES_DRIVER_LABELS = |
| 120 | + ConfigBuilder("spark.kubernetes.driver.labels") |
| 121 | + .doc(""" |
| 122 | + | Custom labels that will be added to the driver pod. |
| 123 | + | This should be a comma-separated list of label key-value |
| 124 | + | pairs, where each label is in the format key=value. Note |
| 125 | + | that Spark also adds its own labels to the driver pod |
| 126 | + | for bookkeeping purposes. |
| 127 | + """.stripMargin) |
| 128 | + .stringConf |
| 129 | + .createOptional |
| 130 | + |
| 131 | + private[spark] val KUBERNETES_DRIVER_SUBMIT_TIMEOUT = |
| 132 | + ConfigBuilder("spark.kubernetes.driverSubmitTimeout") |
| 133 | + .doc(""" |
| 134 | + | Time to wait for the driver process to start running |
| 135 | + | before aborting its execution. |
| 136 | + """.stripMargin) |
| 137 | + .timeConf(TimeUnit.SECONDS) |
| 138 | + .createWithDefault(60L) |
| 139 | + |
| 140 | + private[spark] val KUBERNETES_DRIVER_SUBMIT_KEYSTORE = |
| 141 | + ConfigBuilder("spark.ssl.kubernetes.submit.keyStore") |
| 142 | + .doc(""" |
| 143 | + | KeyStore file for the driver submission server listening |
| 144 | + | on SSL. Can be pre-mounted on the driver container |
| 145 | + | or uploaded from the submitting client. |
| 146 | + """.stripMargin) |
| 147 | + .stringConf |
| 148 | + .createOptional |
| 149 | + |
| 150 | + private[spark] val KUBERNETES_DRIVER_SUBMIT_TRUSTSTORE = |
| 151 | + ConfigBuilder("spark.ssl.kubernetes.submit.trustStore") |
| 152 | + .doc(""" |
| 153 | + | TrustStore containing certificates for communicating |
| 154 | + | to the driver submission server over SSL. |
| 155 | + """.stripMargin) |
| 156 | + .stringConf |
| 157 | + .createOptional |
| 158 | + |
| 159 | + private[spark] val KUBERNETES_DRIVER_SERVICE_NAME = |
| 160 | + ConfigBuilder("spark.kubernetes.driver.service.name") |
| 161 | + .doc(""" |
| 162 | + | Kubernetes service that exposes the driver pod |
| 163 | + | for external access. |
| 164 | + """.stripMargin) |
| 165 | + .internal() |
| 166 | + .stringConf |
| 167 | + .createOptional |
| 168 | + |
| 169 | + private[spark] val KUBERNETES_DRIVER_POD_NAME = |
| 170 | + ConfigBuilder("spark.kubernetes.driver.pod.name") |
| 171 | + .doc(""" |
| 172 | + | Name of the driver pod. |
| 173 | + """.stripMargin) |
| 174 | + .internal() |
| 175 | + .stringConf |
| 176 | + .createOptional |
| 177 | +} |
0 commit comments