Thread
#prefect-community
    f

    Florian Kühnlenz

    2 months ago
    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)
    redsquare

    redsquare

    2 months ago
    you can pass the namespace into the runner e.g flow_runner=KubernetesFlowRunner( namespace="prefect",
    f

    Florian Kühnlenz

    2 months ago
    Is this in Orion? I can't find it in the docs.
    redsquare

    redsquare

    2 months ago
    yep orion
    i had to dig into the source for the available param
    f

    Florian Kühnlenz

    2 months ago
    Okay, we need a solution for 1.0
    redsquare

    redsquare

    2 months ago
    aha ok sorry
    i have only used 2.0
    available in 1
    Anna Geller

    Anna Geller

    2 months ago
    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

    2 months ago
    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.