본문 바로가기

DKE/Kubernetes

[Kubeflow] ERROR [403] poddefaults.kubeflow.org is forbidden / 2023.06.14

Kubeflow dashboard의 tensorboard를 클릭하면 아래와 같은 에러가 발생했다.

 

[403] poddefaults.kubeflow.org is forbidden: User "system:serviceaccount:kubeflow:tensorboards-web-app-service-account" cannot list resource "poddefaults" in API group "kubeflow.org" in the namespace "kubeflow-user-example-com"

 

해당 오류는 사용자가 해당 리소스에 대한 권한이 없기 때문에 발생하는 것으로 보임!!

"tensorboards-web-app-service-account" 사용자가 "kubeflow-user-example-com" 네임스페이스에서 "poddefaults" 리소스를 사용할 수 있도록 권한을 부여해야 함!!!

 

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: poddefaults-role
  namespace: kubeflow-user-example-com
rules:
- apiGroups: ["kubeflow.org"]
  resources: ["poddefaults"]
  verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: poddefaults-rolebinding
  namespace: kubeflow-user-example-com
subjects:
- kind: ServiceAccount
  name: tensorboards-web-app-service-account
  namespace: kubeflow
roleRef:
  kind: Role
  name: poddefaults-role
  apiGroup: rbac.authorization.k8s.io