Hello everyone !
I'm facing and issue with "Kubernets Jobs" block. In my code I have defined the namespace as follow :
k8s_jb = KubernetesJob(
...
namespace="prefect",
)
After saving the block I can see in the UI that the namespace is correctly defined.
But sometimes, when I run a deployment flow, I get these errors:
TTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"jobs.batch is forbidden: User \"system:serviceaccount:prefect:prefect-worker\" cannot create resource \"jobs\" in API group \"batch\" in the namespace \"default\"","reason":"Forbidden","details":{"group":"batch","kind":"jobs"},"code":403}
The error message indicates that I'm in the wrong namespace. If I use the "Retry" button, at some point it will be executed in the "prefect" namespace.
Sometimes I don't get the error, sometimes I have to retry 5 times.
Does anyone have the same problem?