Created
October 24, 2019 14:48
-
-
Save rafaelfelix/b87ef7b625d0632cdcb8b2405d297fb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # set spark.master to k8s api host:port | |
| sed -i "s/#spark.master.*/spark.master\ k8s\:\/\/https\:\/\/$KUBERNETES_SERVICE_HOST\:$KUBERNETES_PORT_443_TCP_PORT/g" $SPARK_HOME/conf/spark-defaults.conf | |
| # set spark.kubernetes.driver.pod.name to $HOSTNAME (https://spark.apache.org/docs/latest/running-on-kubernetes.html#client-mode-executor-pod-garbage-collection) | |
| sed -i "s/#spark.kubernetes.driver.pod.name.*/spark.kubernetes.driver.pod.name\ $HOSTNAME/g" $SPARK_HOME/conf/spark-defaults.conf | |
| # set spark.driver.host to own pod name | |
| THIS_POD_FQDN=$HOSTNAME.servicename.{{ .Release.Namespace }}.svc.cluster.local | |
| sed -i "s/#spark.driver.host.*/spark.driver.host\ $THIS_POD_FQDN/g" $SPARK_HOME/conf/spark-defaults.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment