I have a question regarding version one of the pre...
# prefect-community
a
I have a question regarding version one of the prefect agent in kubernetes. I am experiencing a similar issue to that of this question before. My error is
Copy code
User \"system:serviceaccount:prefect:prefect-agent\" cannot create resource \"jobs\" in API group \"batch\" in the namespace \"prefect\"
I as you might be able to tell, I have the prefect agent running in the prefect namespace. I have a service account for it called prefect agent. I have used the role and rolebinding from the prefect documentation, but updated the namespace on both and the service account name from default to prefect -agent.
โœ… 1
k
@Christopher Boyd Have you seen this error before?
c
If you look at your manifest for that deployment, what does it have for the role?
The namespaces look fine, but the service account might be still using the default instead of the revised service account prefect-agent
it would be in this part:
Copy code
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: RoleBinding
metadata:
  name: flow-runner-role-binding
  namespace: default
subjects:
- kind: ServiceAccount
  name: default
  namespace: default
roleRef:
  kind: Role
  name: flow-runner
  apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
If you arenโ€™t using the default service account, you can update the service account for the deployment to the one you are using
a
there we go. I left out the namespace in the subject i bet
c
If you still get the issue after, and can share your manifest, I can look it over
a
My error is coming from the custom service account. I am going to update the subject in my rolebinding
๐Ÿ‘ 1
It worked to add the namespace in the subject as I had forgotten. The rolebinding was trying to bind to a service account in the default namespace
๐Ÿ™Œ 1
Thanks for your help @Christopher Boyd in catching my syntax mistake
๐Ÿ™Œ 1
c
My pleasure!