Hi! How do i set a default `kubernetes_service_acc...
# ask-the-community
r
Hi! How do i set a default
kubernetes_service_account
for a specific launch plan (the value you can see in the picture)? i tried to do like this:
Copy code
LaunchPlan.get_or_create(
    name="my_lp",
    workflow=my_wf,
    auth_role=AuthRole(
        assumable_iam_role=None,
        kubernetes_service_account="my-flyte-service-account"
    ),
)
But when i am clicking "Launch Workflow", select the Launch Plan in the drop down, click "Advanced options" the values are empty (see picture). I also tried to do like this:
Copy code
LaunchPlan.get_or_create(
    name="my_lp",
    workflow=my_wf,
    security_context=security.SecurityContext(
        run_as=security.Identity(
            iam_role="default",
            k8s_service_account="my-flyte-service-account",
        ),
    ),
)
But this didn't work either. Anyone know how to do this?
s
Have you tried launching a task/workflow? Do you not see a K8s service account populated on the execution page?
r
actually it was setting it as you say - but the UI was confusing in this case. But getting some other issues right now - will update here what i needed to do
so if anyone else face this issue in the future, this is how to do it:
Copy code
LaunchPlan.get_or_create(
    name="my_lp",
    workflow=my_wf,
    security_context=security.SecurityContext(
        run_as=security.Identity(
            iam_role=None,
            k8s_service_account="my-flyte-service-account",
        ),
    ),
)
When clicking "Launch Workflow" you will not see this in the UI - only when you press "Launch" you will see it set the given service account.
Thanks @Samhita Alla for your answer
s
No problem. We’ll need to pre-populate the field on launch form. cc: @Jason Porter
155 Views