pydatatask.pod_manager module#
In order for a KubeTask
or a subclass to connect, authenticate, and manage pods in a kubernetes cluster, it needs
several resource references. the PodManager
simplifies tracking the lifetimes of these resources.
- class pydatatask.pod_manager.PodManager(app: str, namespace: str, config: Callable[[], Configuration] | None = None)[source]#
Bases:
object
A pod manager allows multiple tasks to share a connection to a kubernetes cluster and manage pods on it.
- Parameters:
app – The app name string with which to label all created pods.
namespace – The namespace in which to create and query pods.
config – Optional: A callable returning a kubernetes configuration object. If not provided, will attempt to use the “default” configuration, i.e. what is available after calling
await kubernetes_asyncio.config.load_kube_config()
.
- property api#
The current API client.
- property api_ws: WsApiClient#
The current websocket-aware API client.
- property v1: CoreV1Api#
A CoreV1Api instance associated with the current API client.
- property v1_ws: CoreV1Api#
A CoreV1Api instance associated with the current websocket-aware API client.
- async launch(job, task, manifest)[source]#
Create a pod with the given manifest, named and labeled for this podman’s app and the given job and task.