---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: katib-controller
rules:
  - apiGroups:
      - ""
    resources:
      - services
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "delete"
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - "create"
      - "patch"
      - "update"
  - apiGroups:
      - ""
    resources:
      - serviceaccounts
      - persistentvolumes
      - persistentvolumeclaims
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
  - apiGroups:
      - ""
    resources:
      - namespaces
      - configmaps
    verbs:
      - "get"
      - "list"
      - "watch"
  - apiGroups:
      - ""
    resources:
      - pods
      - pods/status
    verbs:
      - "get"
  - apiGroups:
      - apps
    resources:
      - deployments
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "delete"
  - apiGroups:
      - rbac.authorization.k8s.io
    resources:
      - roles
      - rolebindings
    verbs:
      - "get"
      - "create"
      - "list"
      - "watch"
  - apiGroups:
      - batch
    resources:
      - jobs
      - cronjobs
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "delete"
  - apiGroups:
      - kubeflow.org
    resources:
      - tfjobs
      - pytorchjobs
      - mpijobs
      - xgboostjobs
      - mxjobs
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "delete"
  - apiGroups:
      - kubeflow.org
    resources:
      - experiments
      - experiments/status
      - experiments/finalizers
      - trials
      - trials/status
      - trials/finalizers
      - suggestions
      - suggestions/status
      - suggestions/finalizers
    verbs:
      - "*"
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: katib-controller
  namespace: kubeflow
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: katib-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: katib-controller
subjects:
  - kind: ServiceAccount
    name: katib-controller
    namespace: kubeflow
