Anna
07/10/2025, 6:23 PMspec:
containers:
- args:
- prefect
- worker
- start
- --type
- kubernetes
- --pool
- kubernetes-pool
- --install-policy
- prompt
command:
- /usr/bin/tini
- -g
- --
- /opt/prefect/entrypoint.sh
Should this create the work pool for me? Or do I still need to do that in the UI/CLI?Marvin
07/10/2025, 6:23 PMMarvin
07/10/2025, 6:23 PMbash
prefect work-pool create kubernetes-pool --type kubernetes
The worker command you're using is trying to connect to a work pool named "kubernetes-pool", but it will fail to start if that pool doesn't exist first. The --install-policy prompt
flag in your command indicates that the worker will prompt for installation of any missing dependencies, but this doesn't extend to creating work pools.
Think of it this way: the work pool is like a job board that needs to exist before workers can look at it for work. The worker is just a process that connects to this pre-existing job board to pick up and execute work.
Once you've created the work pool, your worker should be able to connect to it successfully with the command configuration you've shown.Anna
07/10/2025, 7:12 PMMarvin
07/10/2025, 7:12 PMMarvin
07/10/2025, 7:13 PMprefect worker start
separately. The pod itself is running that command for you!
Let's break down what's happening:
1. You create the work pool in the UI
2. Your Kubernetes pod specification includes the command to start the worker:
yaml
command:
- /usr/bin/tini
- -g
- --
- /opt/prefect/entrypoint.sh
args:
- prefect
- worker
- start
- --type
- kubernetes
- --pool
- kubernetes-pool
3. When the pod starts up, it automatically executes this command, which starts the worker process
This is exactly equivalent to running prefect worker start
manually, but it's running inside your Kubernetes pod instead. Running it manually would only be necessary if you were testing locally or running the worker outside of Kubernetes.
The sequence should be:
1. Create the work pool (UI or CLI)
2. Deploy your Kubernetes pod with the worker configuration
3. The worker will automatically start when the pod starts
If your pod is running but you're not seeing the worker connect to your work pool, you might want to check the pod logs (kubectl logs <pod-name>
) to see if there are any connection or configuration issues.