prefect_kubernetes.pods
Module for interacting with Kubernetes pods from Prefect flows.
Functions
create_namespaced_pod
kubernetes_credentials:KubernetesCredentialsblock for creating authenticated Kubernetes API clients.new_pod: A KubernetesV1Podspecification.namespace: The Kubernetes namespace to create this pod in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
- A Kubernetes
V1Podobject.
delete_namespaced_pod
kubernetes_credentials:KubernetesCredentialsblock for creating authenticated Kubernetes API clients.pod_name: The name of the pod to delete.delete_options: A KubernetesV1DeleteOptionsobject.namespace: The Kubernetes namespace to delete this pod from.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
- A Kubernetes
V1Podobject.
list_namespaced_pod
kubernetes_credentials:KubernetesCredentialsblock for creating authenticated Kubernetes API clients.namespace: The Kubernetes namespace to list pods from.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
- A Kubernetes
V1PodListobject.
patch_namespaced_pod
kubernetes_credentials:KubernetesCredentialsblock for creating authenticated Kubernetes API clients.pod_name: The name of the pod to patch.pod_updates: A KubernetesV1Podobject.namespace: The Kubernetes namespace to patch this pod in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
- A Kubernetes
V1Podobject.
read_namespaced_pod
kubernetes_credentials:KubernetesCredentialsblock for creating authenticated Kubernetes API clients.pod_name: The name of the pod to read.namespace: The Kubernetes namespace to read this pod from.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
- A Kubernetes
V1Podobject.
read_namespaced_pod_log
print_func is provided, the logs will be streamed using that function.
If the pod is no longer running, logs generated up to that point will be returned.
Args:
kubernetes_credentials:KubernetesCredentialsblock for creating authenticated Kubernetes API clients.pod_name: The name of the pod to read logs from.container: The name of the container to read logs from.namespace: The Kubernetes namespace to read this pod from.print_func: If provided, it will stream the pod logs by callingprint_funcfor every line and returningNone. If not provided, the current pod logs will be returned immediately.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
- A string containing the logs from the pod’s container.
replace_namespaced_pod
kubernetes_credentials:KubernetesCredentialsblock for creating authenticated Kubernetes API clients.pod_name: The name of the pod to replace.new_pod: A KubernetesV1Podobject.namespace: The Kubernetes namespace to replace this pod in.**kube_kwargs: Optional extra keyword arguments to pass to the Kubernetes API.
- A Kubernetes
V1Podobject.