setup_namespace
SparkOnK8SNamespaceSetup
Bases: LoggingMixin
Utility class to set up a namespace for Spark on Kubernetes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
k8s_client_manager |
KubernetesClientManager
|
Kubernetes client manager. Defaults to None. |
None
|
logger_name |
str
|
logger name. Defaults to "SparkOnK8SNamespaceSetup". |
None
|
Source code in spark_on_k8s/utils/setup_namespace.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
setup_namespace(namespace, should_print=False)
Set up a namespace for Spark on Kubernetes.
This method creates a namespace if it doesn't exist, creates a service account for Spark if it doesn't exist, and creates a cluster role binding for the service account and the edit cluster role if it doesn't exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
namespace |
str
|
the namespace to set up |
required |
should_print |
bool
|
whether to print logs instead of logging them. Defaults to False. |
False
|
Source code in spark_on_k8s/utils/setup_namespace.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|