Using the KubernetesJob from prefect.infrastructur...
# ask-community
n
Using the KubernetesJob from prefect.infrastructure provides the following warning:
Copy code
PrefectDeprecationWarning: prefect.infrastructure.kubernetes.KubernetesJob has been deprecated. It will not be available after Sep 2024. Use the Kubernetes worker from prefect-kubernetes instead. Refer to the upgrade guide for more information: <https://docs.prefect.io/latest/guides/upgrade-guide-agents-to-workers/>.
However, the listed upgrade docs still reference the same KubernetesJob: > from prefect.infrastructure import KubernetesJob > > KubernetesJob.load("my-k8s-job").publish_as_work_pool() Is the warning message still correct and this is being deprecated?
n
hi @Niall O'Riordan - publish_as_work_pool is just a method that youd run as “the final act” of your KubernetesJob infra block, which creates the Kubernetes work pool that you’d use instead going forward ie infra blocks like KubernetesJob are being replaced by work pools, publish_as_work_pool is just a method to translate the latter into the former automatically so you don’t have to copy the info over
n
Thanks for clarifying Nate!
I posted a separate question about managing work pools after they are created or creating new work pools via CI/CD https://prefect-community.slack.com/archives/CL09KU1K7/p1723651421358439