~Hi everyone, has anyone seen this error when tryi...
# prefect-community
l
Hi everyone, has anyone seen this error when trying to run a kubernetes agent using rbac?
agent | Service token file does not exists. Using out of cluster configuration option.
I’ve confirmed that the service account, role, and. rolebinding all exist on the server. Here’s a screenshot of the pod settings, attaching the rest in a thread
Issue was that the deployment did not automount the service user credential. The deployment was created through terraform, which defaulted it to false
role:
Copy code
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: Role
metadata:
  creationTimestamp: "2021-01-14T16:42:33Z"
  name: prefect-agent-rbac
  namespace: default
  resourceVersion: "4834932"
  selfLink: /apis/rbac.authorization.k8s.io/v1/namespaces/default/roles/prefect-agent-rbac
  uid: 800d1a39-70ef-48aa-882b-db85d0737558
rules:
- apiGroups:
  - extensions
  - batch
  resources:
  - jobs
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - events
  - pods
  verbs:
  - '*'
rolebinding:
Copy code
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: RoleBinding
metadata:
  creationTimestamp: "2021-01-15T07:38:15Z"
  name: prefect-agent-rbac
  namespace: default
  resourceVersion: "5072201"
  selfLink: /apis/rbac.authorization.k8s.io/v1/namespaces/default/rolebindings/prefect-agent-rbac
  uid: 9ba7a593-2ff6-4cbf-b173-9855cef43650
roleRef:
  apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
  kind: Role
  name: prefect-agent-rbac
subjects:
- kind: ServiceAccount
  name: prefect-agent
  namespace: default
service account:
Copy code
apiVersion: v1
kind: ServiceAccount
metadata:
  creationTimestamp: "2021-01-15T20:17:25Z"
  name: prefect-agent
  namespace: default
  resourceVersion: "5072067"
  selfLink: /api/v1/namespaces/default/serviceaccounts/prefect-agent
  uid: cf2fc80e-dafe-40da-9c84-16c4272587ad
secrets:
- name: removed
n
Hi @Lucas Kjaero-Zhang - I think you've resolved this but just want to check to be sure!
l
I have. Thank you for following up!