Hi <@U021J8TU753> I’d like to ask how do I have a...
# prefect-community
e
Hi @Prefect I’d like to ask how do I have agent run on GKE? I think I am about to get it work but keeping getting error 😞 [I have read this guides: HERE_FROM_ANNA -> I can use port-forward and execute
py any_flow.py
successfully and insert data into BQ]
The problem I encounter is that failed to run a flow after the deployment.
Make it easier. I, then, follow the deployment, HERE_FROM_NATE, to create a very simple job. After clicking running a flow for the deployment
foo
, it shows error about connection issue.
Copy code
07:17:34.363 | DEBUG   | prefect.client - Connecting to API at                                                                                                               β”‚
β”‚ <http://127.0.0.1:4200/api/>                                                                                                                                                   β”‚
β”‚ 07:17:35.873 | ERROR   | prefect.engine - Engine execution of flow run                                                                                                       β”‚
β”‚ 'd533fb3e-d96f-4774-ad53-bac47071f3c5' exited with unexpected exception
What I can think about is that the agent runs but it should not be
<http://127.0.0.1:4200/api/>
for the agents to do the connection. But, 1. how could I set this? FQDN? public endpoint? 2. In where? Deployment? Appreciate any help here, thx πŸ™‡πŸ»β€β™‚οΈ
βœ… 1
m
You should indeed set the PREFECT_API_URL environment variable on your agent. If you wish to use prefect cloud, you should also set your api key as documented here. If you are using the open source version, you can expose it e.g. by using fqdn (but there's no prefect-supported way to protect it). Or, if the api is running inside GKE as well, you might use its Kubernetes DNS name (
{api-service-name}.{api-namespace}.svc.cluster.local:{PORT}/api
)
πŸ‘ 1
πŸ™ 2
e
Thank you πŸ™‡πŸ»β€β™‚οΈ I will try it now I think I will probably try Prefect cloud directly πŸ™πŸ» let u know if I make it
πŸ™Œ 1
Thank you @Mathijs Carlu. I just DID it sheepy Successfully send hello-world job work queue, consumed by k8s agent After completed, receive the notification from Slack πŸ™πŸ» I think I will write a 101 for this one after finsihing Anna’s dbt part
πŸ™Œ 3
nailed it reference