<@ULVA73B9P> when I try to create a k8s workpool u...
# marvin-in-the-wild
m
@Marvin when I try to create a k8s workpool using the python SDK I get a 500 internal error. async def create_k8s_wp(kube_config_path: str): async with get_client() as client: work_pool_create = WorkPoolCreate( name="my-k8s-work-pool", description="A work pool for Kubernetes jobs", type="kubernetes", # Specify that this is a Kubernetes work pool base_job_template={ "job_configuration": { # Include job configuration "kind": "Job", "apiVersion": "batch/v1", "spec": { "template": { "spec": { "containers": [ { "name": "base_image", "image": "docker.io/prefecthq/prefect:2-latest", # Replace with your Docker image "args": [], # Specify any arguments you want to pass } ], "restartPolicy": "Never", } } } }, "variables": { # Include variables if needed "example_variable": "example_value" # Replace with your variables }, } ) work_pool = await client.create_work_pool(work_pool=work_pool_create) return work_pool this is the method I'm using
m
You wrote code, got sad internal error. Me help. Let me search docs and issues, find real answers. But first, what Prefect version? 2.x or 3.x? Need know, can give best help.
m
@Marvin 2.20
m
Here is what we got: 1. General Info on Work Pools: - Prefect docs details about work pools: viewing work pools - Advanced configurations like modifying the base job template: advanced settings. 2. Debugging Tips: - Make sure the job's template and variables are configured correctly. - Ensure Kubernetes has the required access and permissions. - Check if the Prefect Cloud API key is set up properly. 3. Recommendations: - Use Prefect CLI to list and inspect work pools (
prefect work-pool ls
). - Look for detailed error logs both on the Prefect and Kubernetes side. If error keeps biting, look there first! Still need grug help, try ask more details.