https://prefect.io logo
Title
f

Florian Kühnlenz

07/05/2022, 1:05 PM
Is it possible to have a Kubernetes Agent run a Flow in a different namespace? Can this be set via the job template? (In 1.0)
1
r

redsquare

07/05/2022, 1:07 PM
you can pass the namespace into the runner e.g flow_runner=KubernetesFlowRunner( namespace="prefect",
🙌 2
f

Florian Kühnlenz

07/05/2022, 1:12 PM
Is this in Orion? I can't find it in the docs.
r

redsquare

07/05/2022, 1:13 PM
yep orion
i had to dig into the source for the available param
f

Florian Kühnlenz

07/05/2022, 1:16 PM
Okay, we need a solution for 1.0
r

redsquare

07/05/2022, 1:18 PM
aha ok sorry
i have only used 2.0
available in 1
a

Anna Geller

07/05/2022, 1:35 PM
afaik it is not - but you can easily deploy a second agent process in this second namespace:
prefect agent kubernetes start --namespace my-namespace
don't forget that agent is a lightweight process rather than an entire execution layer
I believe the reason for that is more related to Kubernetes permissions rather than Prefect agent limitations - it would be difficult to deploy flow run pods from a process running in one Kubernetes namespace to the other namespace because this process has by default no access to that other Kubernetes namespace
(I'm no Kubernetes admin though - you may ask on Kubernetes discourse to be sure)
f

Florian Kühnlenz

07/05/2022, 1:52 PM
Okay. We thought the overhead of monitoring and deploying a separate agent is still considerably high, hence the question. I‘m also not sure at all about the Kubernetes rights, however would have thought that with the right service account it should be possible.
👍 1