<@ULVA73B9P> In prefect 2.20 what is the best way ...
# ask-marvin
m
@Marvin In prefect 2.20 what is the best way to deploy 2 k8s workers, one that have access to the cluster GPUs and another that do not have access to this? I have to modify the template for generated pods?ù
m
To deploy Kubernetes workers in Prefect 2.20, specifically one with access to GPUs and another without, you need to configure each worker's deployment separately using Helm charts and customize their resource requests accordingly. Here's a step-by-step approach based on the documentation: 1. Set up the Prefect Helm Chart: - Add the Prefect Helm repository to your Helm client:
Copy code
shell
     helm repo add prefect <https://prefecthq.github.io/prefect-helm>
     helm repo update
2. Create Namespaces: - Create a new namespace in your Kubernetes cluster for the Prefect worker if you haven't already:
Copy code
shell
     kubectl create namespace prefect
3. Configure GPU Worker: - Define a
values.yaml
file for the worker that requires GPU access. In this file, specify the necessary GPU resource requests:
Copy code
yaml
     worker:
       resources:
         requests:
           <http://nvidia.com/gpu|nvidia.com/gpu>: 1
- Deploy with Helm using this configuration:
Copy code
shell
     helm install gpu-worker prefect/prefect-helm -n prefect -f gpu-values.yaml
4. Configure Non-GPU Worker: - For the worker that does not require GPU access, create a separate
values.yaml
without specifying GPU resources:
Copy code
yaml
     worker:
       # No GPU request
- Deploy with Helm:
Copy code
shell
     helm install non-gpu-worker prefect/prefect-helm -n prefect -f non-gpu-values.yaml
By using different
values.yaml
files, you can set up your Kubernetes workers with distinct resource profiles, controlling their access to GPUs. For additional details, check the Prefect Kubernetes guide here: Prefect Kubernetes Deployment Guide. If you encounter issues, don't hesitate to consult the Helm documentation or Prefect support forums. Good luck, and may your workflows flow smoothly like a fine cup of tea on a brisk morning!