apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kubeflow-training-admin
  labels:
    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true"
aggregationRule:
  clusterRoleSelectors:
    - matchLabels:
        rbac.authorization.kubeflow.org/aggregate-to-kubeflow-training-admin: "true"
rules: []

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kubeflow-training-edit
  labels:
    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true"
    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-training-admin: "true"
rules:
  - apiGroups:
      - kubeflow.org
    resources:
      - mpijobs
      - tfjobs
      - pytorchjobs
      - xgboostjobs
      - paddlejobs
      - jaxjobs
    verbs:
      - create
      - delete
      - get
      - list
      - patch
      - update
      - watch
  - apiGroups:
      - kubeflow.org
    resources:
      - mpijobs/status
      - tfjobs/status
      - pytorchjobs/status
      - xgboostjobs/status
      - paddlejobs/status
      - jaxjobs/status
    verbs:
      - get
  - apiGroups:
      - ""
    resources:
      - persistentvolumeclaims
    verbs:
      - create
      - delete
      - get
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - get
      - list
      - watch

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kubeflow-training-view
  labels:
    rbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true"
rules:
  - apiGroups:
      - kubeflow.org
    resources:
      - mpijobs
      - tfjobs
      - pytorchjobs
      - xgboostjobs
      - paddlejobs
      - jaxjobs
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - kubeflow.org
    resources:
      - mpijobs/status
      - tfjobs/status
      - pytorchjobs/status
      - xgboostjobs/status
      - paddlejobs/status
      - jaxjobs/status
    verbs:
      - get
