Hello, I am using KubernetesRun for the flow run c...
# ask-community
m
Hello, I am using KubernetesRun for the flow run configs.. I am trying to specify a
service_account_name
, but it seems the pods are still using the default service account to the namespace.. my agent is also deployed with an undefined
service_account_name
.. any thoughts?
Copy code
flow.run_configs = KubernetesRun(
    image_pull_secrets=["xxx"],
    job_template=config.KUBE_JOB_TEMPLATE,
    cpu_limit=config.KUBE_CPU_LIMIT,
    cpu_request=config.KUBE_CPU_REQUEST,
    memory_limit=config.KUBE_MEMORY_LIMIT,
    memory_request=config.KUBE_MEMORY_REQUEST,
    service_account_name="my-service-account",
)
k
Hi @Mitchell Bregman, can you create pods with other service account names if you use k8s directly instead of via prefect?
m
@Kevin Kho yes, I did that to test the service account when I first created it
k
What is your agent Prefect version?
t
Hi Mitchell, is the service account name set in the config.KUBE_JOB_TEMPLATE?
sorry, your service_account_name actually should take precedence over that job template anyways. Try
flow.run_config
instead of
flow.run_configs
@Mitchell Bregman -- all these configs will be useless if you have that s on the end there
m
@Tyler Wanner - that solved it
marvin 1
stupid mistake, thanks a ton for pointing it out
t
lol if this kind of typo are stupid mistakes, no programmer belongs in MENSA 🤪
😂 1