Config

Certain configuration settings can be set globally for Kubetorch, such as a unique username, default namespace, or installation url to use. More options to be added soon.

Config Class

class kubetorch.config.KubetorchConfig
property username

Username to use for Kubetorch deployments.

Used for authentication and resource naming. Will be validated to ensure Kubernetes compatibility.

property license_key

License key for authentication and billing.

Required for usage reporting and cluster authentication. Can be found in the basic install guide.

property queue

Default queue name for scheduling services.

Controls how cluster resources are allocated and prioritized for services. See scheduling and queues for more info.

property namespace

Default Kubernetes namespace for Kubetorch deployments.

All services will be deployed to this namespace unless overridden in the Compute resource constructor. If install_namespace is set, it will override this namespace.

Priority:
  1. Explicit override

  2. Environment variable

  3. File cache

  4. In-cluster namespace or kubeconfig current context

property install_namespace

Namespace for Kubetorch installation. Used for Kubetorch Cloud clients.

Priority:
  1. Explicit override

  2. Environment variable

  3. File cache

  4. Default install namespace

property install_url

URL of the Kubetorch version to install.

Used when installing Kubetorch in a Docker image or remote environment. Can be found in the basic install guide.

property stream_logs

Whether to stream logs for Kubetorch services.

When enabled, logs from remote services are streamed back to your local environment in real-time. Log level filtering can be controlled via LoggingConfig.level on the Compute. Default is True

When disabled, logs remain accessible in-cluster but are not streamed to the client.

Note

Requires logging to be configured in the cluster (logStreaming.enabled: true` in the Helm chart)

property stream_metrics

Whether to stream metrics during execution of Kubetorch services.

When enabled, real-time CPU, memory, and GPU utilization metrics from remote Kubetorch services are streamed back to the local environment for live monitoring. Default is True.

When disabled, metrics are not collected.

Note

Requires monitoring to be configured in the cluster (metrics.enabled: true` in the Helm chart)

property cluster_config

Cluster Config. Default is {}.

write(values: dict | None = None)

Write out config to local ~/.kt/config.yaml, to be used globally.

Parameters:

values (optional) – Dict of key-value pairs to write/update in the filesystem. If provided, only these keys will be updated. None values will remove the key from the file.