https://prefect.io logo
Title
j

Joshua Weber

04/04/2022, 2:09 PM
Hey again everyone, is anyone implementing prefect while initializing local agents inside kubernetes pods? When our kubernetes pods die off and restart (for whatever reason) the old agents continue to live in a “dead” state in prefect. Eventually the agents accumlate and slow the whole UI down and deteriorate the performance. Anyone else have this problem or know a way to manage the agents in code?
1
k

Kevin Kho

04/04/2022, 2:11 PM
A bit curious why the local agent in the Kubernetes pods? I personally haven’t seen anyone do it but wouldn’t know if there is some here who does
j

Joshua Weber

04/04/2022, 2:13 PM
We initialize them in the start script for the ETL…
prefect agent local start -l ${EDW} -l chizzle -a ${PREFECT_SERVER__APOLLO_URL} --show-flow-logs &
We’re looking for a way to use the prefect agents, but we have to find a way to copy the whole DBT code repo to the agents
We end up with a
local-agent
for each replication instance of the ETL and they eventually die out then accumulate.
k

Kevin Kho

04/04/2022, 2:15 PM
You could clone the dbt repo into the Kubernetes pod through the image entrypoint or through Python code. Have you seen that setup?
🙌 1
j

Joshua Weber

04/04/2022, 2:16 PM
Is there examples or documentation to look at?
k

Kevin Kho

04/04/2022, 2:16 PM
The post above is a link to a blog
j

Joshua Weber

04/04/2022, 2:16 PM
lol you linked to it
Thanks!
I’ll check it out