Mike Lev
10/31/2021, 2:02 PMprefect server start
any full examples of such use cases or best practices?
just for additional context running into some issues while working inside of a devcontainer where access to localhost
is klunky
if possible is there a sample flow file that shows how to run and deploy the flow on the server backend?Anna Geller
10/31/2021, 3:13 PMMike Lev
11/07/2021, 6:03 PMprefect_namespace
Anna Geller
11/08/2021, 9:00 AMwe are now having trouble deploying a simple flow from your repowhich flow and repo do you mean? do you mean those examples? When it comes to AWS EKS, afaik there are at least 2 tutorials but those were written some time ago so they might not be entirely up-to-date: this and this. However, the
KubernetesAgent
setup is quite similar for all cloud providers: once you installed prefect, authenticated your terminal and switched the context to your remote cluster (you can check with: kubectl config current-context), you can run:
prefect agent kubernetes install -k API_KEY
This will output a YAML declaration that you can adjust to your needs (e.g. adding label to the agent, adding any env variables you might need) and then apply to your Prefect namespace:
kubectl apply -f yourfile.yaml --namespace prefect_namespace
And once you have your agent running, you need to configure KubernetesRun
run configuration to ensure that your flows will be deployed to exactly this agent’s cluster, here is one example for AWS: https://github.com/anna-geller/packaging-prefect-flows/blob/master/flows/github_kubernetes_run_custom_ecr_image.py
Sending some docs that may be helpful in case you didn’t see those yet:
• https://docs.prefect.io/orchestration/agents/kubernetes.html#running-in-cluster
• https://docs.prefect.io/orchestration/flow_config/run_configs.html#kubernetesrun
• https://docs.prefect.io/api/latest/run_configs.html#kubernetesrunMike Lev
11/08/2021, 12:41 PM