Based on the information available in Prefect documentation, here are a few insights:
1.
Worker Spawning Behavior: Workers are lightweight polling services that retrieve scheduled runs from a work pool and execute them
Work Pools. They do not generally spawn additional workers by themselves.
2.
Kubernetes Deployment: When deploying a worker using Kubernetes, there's usually a single instance involved unless you have scaled your deployments explicitly or have configured your deployment to automatically scale based on certain conditions
Kubernetes Guide.
Considering you are seeing multiple offline workers in Prefect Cloud, here are potential reasons:
-
Multiple Deployments: If the deployment was repeated, intentionally or otherwise, it could have created multiple worker instances.
-
Scaling and Replica Settings: If your deployment or helm chart includes replica sets or horizontal pod scaling, it might have scaled the number of workers based on those settings.
-
Stale Workers: When workers are shut down or disconnected, they may still show up as offline in Prefect Cloud for a time. There may be stale entries that haven't been cleaned up.
No process would spawn new workers by default without some trigger or configuration that requests additional instances. To further troubleshoot this issue, you might want to review your Kubernetes cluster's deployment configuration and check for any autoscaling policies, or potentially stale resources that need to be cleaned up.
Additionally, I didn't find specific troubleshooting steps for your issue in the available documentation. However, I recommend checking the deployment configurations and logs in your Kubernetes environment to understand the cause of these additional workers appearing in Prefect Cloud.