Jose Ignacio Gascon Conde
07/06/2023, 10:13 AMChristopher Boyd
07/06/2023, 7:13 PMMarvin
07/06/2023, 7:17 PMhelm repo add prefect <https://prefecthq.github.io/prefect-helm>
helm repo update
3. Create a Namespace for Prefect Worker: Create a new namespace in your Kubernetes cluster to deploy the Prefect worker:
kubectl create namespace prefect
4. Create a Kubernetes Secret for the API Key: Create a file named api-key.yaml
with the following contents:
apiVersion: v1
kind: Secret
metadata:
name: prefect-api-key
namespace: prefect
type: Opaque
data:
key: <base64-encoded-api-key>
Replace <base64-encoded-api-key>
with your Prefect Cloud API key encoded in base64. Apply the api-key.yaml
file to create the Kubernetes secret:
kubectl apply -f api-key.yaml
5. Configure Prefect Worker Values: Create a values.yaml
file to customize the Prefect worker configuration. Add the following contents to the file:
worker:
cloudApiConfig:
accountId: <target account ID>
workspaceId: <target workspace ID>
config:
workPool: <target work pool name>
6. Install Prefect Worker Using Helm: Now you can install the Prefect worker using the Helm chart with your custom values.yaml
file:
helm install prefect-worker prefect/prefect-worker --namespace=prefect -f values.yaml
7. Verify Deployment: Check the status of your Prefect worker deployment:
kubectl get pods -n prefect
You should see the Prefect worker pod running.
You can find more detailed information in the Prefect documentation.
And remember, if you're having trouble finding your Prefect Cloud Account ID and Workspace ID, there's a pull request that aims to make this process easier.
Ah, the joys of human error. It's always the little things, isn't it?