Skip to content

Kubeflow Roles (aggregated RBAC)

Interactive Diagram

새 탭 ↗
ItemValue
VersionNot versioned separately; based on the community-distribution release-26.03.1 default Kubeflow ClusterRoles
Official docsKubernetes RBAC, ClusterRole aggregation
Upstream sourcecommon/kubeflow-roles/base

Kubeflow creates a Profile namespace per user and grants permissions so that the user can work with resources such as Notebook, Pipeline, and InferenceService inside that namespace. Instead of writing every app permission directly into one giant role, it uses Kubernetes ClusterRole aggregation. kubeflow-admin, kubeflow-edit, and kubeflow-view are empty containers, and the rules of other ClusterRoles with specific labels are merged into them automatically by a Kubernetes controller.

A ClusterRole normally lists its permissions directly in rules, but these anchor roles have empty rules and only a label condition (aggregationRule). The Kubernetes RBAC aggregation controller finds the rules of other ClusterRoles with that label and copies them into the empty role automatically. So a component only needs to add one label line to its own ClusterRole, and its permissions are absorbed without modifying the central role.

# 빈 그릇: 권한을 직접 적지 않고 "이 label 붙은 role 을 합쳐라"만 선언한다
kind: ClusterRole
metadata:
name: kubeflow-admin
aggregationRule:
clusterRoleSelectors:
- matchLabels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true"
rules: [] # controller 가 자동으로 채운다
---
# component 는 이 label 한 줄만 붙이면 권한이 kubeflow-admin 으로 자동 흡수된다
kind: ClusterRole
metadata:
name: kubeflow-kserve-admin
labels:
rbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true"
rules:
- apiGroups: ["serving.kserve.io"]
resources: ["inferenceservices"]
verbs: ["*"]

Once the second role exists, Kubernetes automatically folds its rules into kubeflow-admin. Users do not work directly against the whole cluster; they work inside profile namespaces, so the platform needs a stable RBAC vocabulary for “admin”, “edit”, and “view” within a Kubeflow profile.

  • Three anchor ClusterRoles: kubeflow-admin, kubeflow-edit, kubeflow-view. Each role has only an aggregationRule.
  • Three base Kubernetes permission roles: kubeflow-kubernetes-admin, kubeflow-kubernetes-edit, kubeflow-kubernetes-view. They provide admin/edit/view permissions for ordinary Kubernetes resources such as Pod, Deployment, Service, PVC, Secret, and NetworkPolicy.
  • Inheritance structure: kubeflow-view is merged into kubeflow-edit, and kubeflow-edit is merged into kubeflow-admin. So admin includes the permissions of the edit/view layers.

So an admin automatically includes edit and view behavior, and an editor automatically includes view behavior. This inheritance is implemented by labels on the roles themselves, not by a separate custom mechanism.

When the Profile controller and KFAM connect a user to a Profile namespace, they create RoleBindings based on the Kubeflow roles. Without the ClusterRoles from this stage, later components that extend their permissions by label would have nothing to merge into. In other words, this component first creates the common vocabulary for user namespace RBAC.

  • Multi-tenancy permission baseline: provides the base hierarchy of what a user can view, create, and manage within their own Profile namespace.
  • Extension point for component permissions: Istio, Knative, KServe, Katib, Pipelines, Notebooks, Trainer, and others add permissions to these anchor roles by attaching aggregate-to-kubeflow-* labels to their own ClusterRoles.
  • Basis for Profile owner permissions: when a Profile is reconciled, namespace-scoped RoleBindings are created for the owner and the default ServiceAccounts, and the common ClusterRole system those RoleBindings can reference is prepared at this stage.

If all permissions were maintained in one giant static ClusterRole, every component would have to coordinate direct edits to the same file. Aggregation avoids that coupling, and Kubeflow’s core roles grow automatically as new components are installed. This component does not grant every final permission by itself, but it defines the durable role hierarchy that the rest of the platform plugs into.

overlays/dev/kubeflow/common/roles references common/kubeflow-roles/base as is. There is no separate patch.

overlays/dev/kubeflow/common/roles
-> common/kubeflow-roles/base
-> cluster-roles.yaml

This stage creates no workloads. It only creates cluster-scoped RBAC resources that do not depend on any namespace.

Merge targetSelector labelRepresentative contributors
kubeflow-adminrbac.authorization.kubeflow.org/aggregate-to-kubeflow-admin: "true"kubeflow-kubernetes-admin, kubeflow-istio-admin, per-component admin roles
kubeflow-editrbac.authorization.kubeflow.org/aggregate-to-kubeflow-edit: "true"kubeflow-kubernetes-edit, kubeflow-kserve-edit, per-component edit roles
kubeflow-viewrbac.authorization.kubeflow.org/aggregate-to-kubeflow-view: "true"kubeflow-kubernetes-view, kubeflow-kserve-view, per-component view roles

kubeflow-edit itself carries the aggregate-to-kubeflow-admin: "true" label, and kubeflow-view itself carries the aggregate-to-kubeflow-edit: "true" label. Because of these labels, view permissions are included in edit, and edit permissions in admin, step by step.

NamespaceResourceNamePurpose
(cluster)ClusterRolekubeflow-adminAnchor role that aggregates admin permissions
(cluster)ClusterRolekubeflow-editAnchor role that aggregates edit permissions and is included in admin
(cluster)ClusterRolekubeflow-viewAnchor role that aggregates view permissions and is included in edit
(cluster)ClusterRolekubeflow-kubernetes-adminPermissions to manage Role/RoleBinding and create access reviews
(cluster)ClusterRolekubeflow-kubernetes-editPermissions to create/update/delete namespace resources such as Pod, workload, Service, Secret, PVC
(cluster)ClusterRolekubeflow-kubernetes-viewPermissions to read namespace resources such as Pod, workload, Service, PVC, event, status

PlantUML source:

PlantUML Diagram
  • Upstream: none. It only creates cluster-scoped RBAC, so it can be applied without any namespace or workload.
  • Downstream (extends these roles): per-component user-facing ClusterRoles such as kubeflow-istio-resources, Knative, KServe, Katib, Pipelines, Notebooks, and Trainer.
  • Downstream (binds these roles): Dashboard/Profiles/KFAM and user Profiles. After a Profile is reconciled, users receive permissions in their own namespace through these anchor roles.

This component itself creates no Pods. The Kubernetes RBAC aggregation controller continuously evaluates label selectors and updates the effective rules of kubeflow-admin, kubeflow-edit, and kubeflow-view. When a new component is installed later and adds a ClusterRole with a label such as aggregate-to-kubeflow-view, its permissions are reflected in the existing Kubeflow roles without any manual merge.

That means the RBAC surface of an existing profile can grow as new Kubeflow components are installed, even without rewriting the original core roles.

  • kubeflow-admin / kubeflow-edit / kubeflow-view: anchor ClusterRoles that users reference directly. Their rules are empty and they are built from an aggregationRule.
  • kubeflow-kubernetes-admin: provides the admin layer with permissions to manage Role/RoleBinding within the namespace and to create LocalSubjectAccessReview.
  • kubeflow-kubernetes-edit: provides the edit layer with write permissions for ordinary namespace resources such as Pod exec/portforward, Secret, Service, PVC, Deployment, Job, and NetworkPolicy.
  • kubeflow-kubernetes-view: provides the view layer with read permissions for ordinary namespace resources such as Pod, log, Service, PVC, workload status, and event.