Skip to content

spark_on_k8s.api.configuration

Implementation reference. These symbols describe how the project works; their presence here does not make them supported application imports. Use the documented entry points and support policy.

APIConfiguration

API configuration.

Source code in spark_on_k8s/api/configuration.py
 8
 9
10
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
class APIConfiguration:
    """API configuration."""

    # API configuration
    # Empty: the API's own namespace; "*": every namespace; otherwise comma-separated names.
    SPARK_ON_K8S_API_NAMESPACES = getenv("SPARK_ON_K8S_API_NAMESPACES", "")
    # Empty: the first namespace in scope, or the current namespace when every namespace is.
    SPARK_ON_K8S_API_DEFAULT_NAMESPACE = getenv("SPARK_ON_K8S_API_DEFAULT_NAMESPACE", "")
    SPARK_ON_K8S_API_HOST = getenv("SPARK_ON_K8S_API_HOST", "127.0.0.1")
    SPARK_ON_K8S_API_PORT = env_int("SPARK_ON_K8S_API_PORT", 8000)
    SPARK_ON_K8S_API_WORKERS = env_int("SPARK_ON_K8S_API_WORKERS", 4)
    SPARK_ON_K8S_API_LOG_LEVEL = getenv("SPARK_ON_K8S_API_LOG_LEVEL", "info")
    SPARK_ON_K8S_API_LIMIT_CONCURRENCY = env_int("SPARK_ON_K8S_API_LIMIT_CONCURRENCY", 1000)
    # Public path prefix, such as /platform/spark, that a gateway removes before forwarding.
    SPARK_ON_K8S_API_ROOT_PATH = getenv("SPARK_ON_K8S_API_ROOT_PATH", "")
    SPARK_ON_K8S_API_SPARK_HISTORY_HOST = getenv("SPARK_ON_K8S_API_SPARK_HISTORY_HOST", None)
    SPARK_ON_K8S_API_WEBSERVER_APPS_KILL_BUTTON = (
        getenv("SPARK_ON_K8S_API_WEBSERVER_APPS_KILL_BUTTON", "true").lower() == "true"
    )
    SPARK_ON_K8S_API_WEBSERVER_APPS_DELETE_BUTTON = (
        getenv("SPARK_ON_K8S_API_WEBSERVER_APPS_DELETE_BUTTON", "true").lower() == "true"
    )
    SPARK_ON_K8S_API_WEBSERVER_APPS_REFRESH_INTERVAL = env_int(
        "SPARK_ON_K8S_API_WEBSERVER_APPS_REFRESH_INTERVAL", 10
    )

    # Exact public http(s) origins; empty means the direct request origin only.
    SPARK_ON_K8S_API_WEBSOCKET_ALLOWED_ORIGINS = getenv("SPARK_ON_K8S_API_WEBSOCKET_ALLOWED_ORIGINS", "")