prefect-kubernetes
prefect-kubernetes
contains Prefect tasks, flows, and blocks enabling orchestration, observation and management of Kubernetes resources.
This library is most commonly used for installation with a Kubernetes worker. See the Prefect docs on deploying with Kubernetes to learn how to create and run deployments in Kubernetes.
Prefect provides a Helm chart for deploying a worker, a self-hosted Prefect server instance, and other resources to a Kubernetes cluster. See the Prefect Helm chart for more information.
Getting started
Prerequisites
Install prefect-kubernetes
The following command will install a version of prefect-kubernetes
compatible with your installed version of prefect
.
If you don’t already have prefect
installed, it will install the newest version of prefect
as well.
Upgrade to the latest versions of prefect
and prefect-kubernetes
:
Register newly installed block types
Register the block types in the prefect-kubernetes
module to make them available for use.
Examples
Use with_options
to customize options on an existing task or flow
Specify and run a Kubernetes Job from a YAML file
As with all Prefect flows and tasks, you can call the underlying function directly if you don’t need Prefect features:
Generate a resource-specific client from KubernetesClusterConfig
List jobs in a namespace
For assistance using Kubernetes, consult the Kubernetes documentation.
Refer to the prefect-kubernetes
SDK documentation linked in the sidebar to explore all the capabilities of the prefect-kubernetes
library.