Thomas Nyegaard-Signori
06/10/2021, 11:05 AMprefect agent kubernetes install -rbac ...
command, so the RBAC is functioning on the agent. When starting a very simple flow that consists of a single RunNamespacedJob
task running the custom Docker image the job pod starting the flow runs into RBAC issues, but the RunNamespacedJob
task pod runs fine. My question is, how to handle job pods that are going to spawn several jobs on Kubernetes and the issues that arise with the RBAC on these pods. Am I thinking about this incorrectly? The error, for reference:
HTTP response headers: HTTPHeaderDict({'Audit-Id': '67b79e3e-ab13-45ee-8ad5-2ae1769c6a7f', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'X-Content-Type-Options': 'nosniff', 'Date': 'Thu, 10 Jun 2021 09:21:02 GMT', 'Content-Length': '372'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"jobs.batch \"cmems-historical\" is forbidden: User \"system:serviceaccount:prefect-zone:default\" cannot get resource \"jobs/status\" in API group \"batch\" in the namespace \"prefect-zone\"","reason":"Forbidden","details":{"name":"cmems-historical","group":"batch","kind":"jobs"},"code":403}
ciaran
06/10/2021, 11:44 AMprefect_agent_conf.yaml
, I think the prefect command actually misses some parts when it generates the conf.
https://github.com/pangeo-forge/pangeo-forge-azure-bakery/blob/main/prefect_agent_conf.yamlThomas Nyegaard-Signori
06/10/2021, 11:55 AMpods/log
and services
resources but the job pods still seem to error out with RBAC issues while RunNamespacedJob
pod starts up and runs, no problem.ciaran
06/10/2021, 12:01 PMnamespace
entry in your configurations? And the values are the same?Thomas Nyegaard-Signori
06/10/2021, 12:24 PMnamespace
, yeah. For now, I have fixed it by binding the role created for the agent
to the default
service account for the namespace, which all pods spawned by the agent seem to be using. Whether this is a big no-no in kubernetes, I dont know, im still trying to learn this weird and wonderful kubernetes stuff 🤖 Thanks @ciaran 🙏ciaran
06/10/2021, 12:26 PMTyler Wanner
06/10/2021, 2:43 PMthe RunNamespacedJob task pod runs fine.
Tyler Wanner
06/10/2021, 7:45 PMThomas Nyegaard-Signori
06/11/2021, 6:45 AMprefect-job...
pod is what I referred to as the job pod which was the one that was failing with the RBAC and the cmems-historical...
is the pod started by the RunNamespacedJob
task in the flow. The task pod starting running just fine but the RBAC issues came up when the job pod was checking logs/status (?) of the task pod, failing the flow but the task pod still chugging along nicely.Thomas Nyegaard-Signori
06/11/2021, 6:46 AMTyler Wanner
06/11/2021, 2:23 PMThomas Nyegaard-Signori
06/14/2021, 6:16 AM