This version is under construction, please use an official release version

Access Control

With KDP, access to KubeV is managed entirely in KDP. KubeV has no users, roles or role bindings of its own, and in KDP mode its dashboard has no Users, Roles or Role Bindings pages: a link to one says Managed in KDP. This page explains who can do what, and which KDP roles to give your users.

How a request is authorized

The KubeV API server holds no credentials for KDP. It sends each request to kcp with the signed-in user’s own token, so kcp checks every request against the user’s roles in the project. Where KubeV has to act on its own cluster, for example to open a VM console, it asks kcp first, as the user.

kcp applies a role change in KDP at once. Three things follow it with a delay:

  • an open VM console closes within five minutes of the user losing access;
  • the shared objects in What every project member can see follow within a minute;
  • the KubeV dashboard shows new or removed actions after the user reloads the page.

Platform administrators

In same-layer mode, the platform administrators are the users named in the installer configuration: the kdp.admin user, or the members of the kdp.adminGroup OIDC group. When both are set, only the group counts. Platform administrators can:

  • create organizations and projects in KDP, and list and delete every organization;
  • manage the provider workspace, root:kubev by default, which holds the KubeV service.

Being a platform administrator doesn’t make you a member of the organizations other people created. An organization’s owner adds you there like any other user.

The tasks that affect the whole platform, such as edge routers, quotas and network policies, are done with kubectl on the KubeV cluster. See Operating the Platform.

With your own KDP, the KubeV service is managed by the administrators of the provider workspace: whoever ran kdp connect first, and anyone granted cluster-admin there. If you set kdp.admin or kdp.adminGroup, kdp connect grants them the same rights as above.

Who sees KubeV in KDP

KDP lists a service in its catalog, and shows its Open KubeV Virtualization button, to users who may bind the service’s API, and in projects where the service is already enabled. KubeV lets every signed-in user bind its API: the installer sets this up, or kdp connect with your own KDP. So every user sees KubeV.

Seeing KubeV in the catalog doesn’t let a user do anything in a project. Inside a project, the user’s roles there decide everything.

Roles in a project

Members and their roles are managed on the project’s Members page in KDP. Give users a role in each project they work in.

When KubeV is enabled in a project, KDP adds a Developer and a Viewer role for the KubeV service, such as virtualization.k8c.io Developer, and includes them in its own Developer and Member roles. These are the roles that matter for KubeV:

KDP roleWhat it allows in KubeV
OwnerEverything in the project: all KubeV resources and every project page of the KubeV dashboard, plus the project’s members and services.
DeveloperCreate, change and delete KubeV resources: virtual machines and pools, disks and images, VPCs, subnets, underlay subnets, security groups, NAT gateways and elastic IPs, SSH keys, backups, restores and migration objects. Start, stop and restart VMs, and open their consoles. Manage the project’s namespaces.
Access ManagerWhat Developer allows, plus managing the project’s members and their roles.
MemberView KubeV resources. Members can’t open VM consoles.
Service ManagerEnable and disable services in the project, KubeV included. It gives no access to KubeV’s own resources, but it can read every Secret in the project, including the credentials of backup targets and migration providers.

Disabling KubeV in a project deletes its resources. When a service is disabled, kcp deletes every object of that service in the project, and KubeV then removes them from its cluster: VMs, their disks and networks included. Only disable KubeV in a project that should lose them.

What Developer and Member don’t cover

KDP’s Developer and Member roles cover the resources KubeV adds to the project. Some KubeV pages also use standard Kubernetes resources in the project, which those roles don’t include:

Kubernetes resourceUsed by
SecretsAdding a backup target (its credentials), adding a migration source provider (its vCenter login).
EventsThe Events page, and the events shown on each object.
PodsThe serial log on a VM’s Monitoring tab.
ServicesLoad Balancers.
NetworkPoliciesFirewalls.
HorizontalPodAutoscalersAuto Scaling.
PersistentVolumeClaimsThe volumes behind disks, including the disks of migrated VMs.

Give users who need these pages the Owner role, or create a role that adds them. KDP offers any ClusterRole labelled for its dashboard on the Members page; see RBAC in the KDP documentation. For example, created in the project with kubectl by one of its owners:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kubev-workloads
  labels:
    rbac.kdp.k8c.io/display: "true"
  annotations:
    rbac.kdp.k8c.io/display-name: "KubeV Workloads"
    rbac.kdp.k8c.io/description: "Secrets, events, pods, volumes, load balancers, firewalls and autoscalers used by KubeV"
rules:
  - apiGroups: [""]
    resources: ["secrets", "services", "persistentvolumeclaims"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: [""]
    resources: ["events", "pods", "pods/log"]
    verbs: ["get", "list"]
  - apiGroups: ["networking.k8s.io"]
    resources: ["networkpolicies"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: ["autoscaling"]
    resources: ["horizontalpodautoscalers"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]

Assign it together with Developer, which gives access to the project itself. To include it in Developer for everyone instead, add the label rbac.kdp.k8c.io/aggregate-to-developer: "true". The role applies only in the project where it is created: repeat it in each project that needs it.

Reading Secrets means reading credentials. In a KDP project, the vCenter login of a migration provider and the credentials of a backup target are Secrets in the project. Anyone who may read Secrets in that namespace can read them, Service Managers included. Grant Secret access with that in mind.

What every project member can see

The KubeV dashboard’s forms need a few objects that the whole platform shares, so any role in a project, Member included, lets a user read them:

  • nodes, with their names, labels, addresses, capacity and conditions;
  • storage classes, priority classes and CDI storage profiles;
  • cluster instance types and preferences;
  • the custom resource definitions and the KubeVirt configuration.

They are read-only. Platform administrators can read them too.

Signing in

Users sign in to KubeV through the same OIDC provider as KDP. Every click on Open KubeV Virtualization in KDP signs KubeV in again, as the user who clicked: a KubeV session left over from another account never carries over. Whether that asks for anything depends on how the user logs in to Dex:

LoginEach click from KDP
Google, GitHub or another identity provider behind DexA redirect, without a prompt: that provider still has the KDP sign-in.
Dex’s own password logins: email (local) and LDAPThe password, again: Dex keeps no session for them.

If Dex offers more than one login method, users also pick theirs on Dex’s page, unless KDP’s link names the one they used in KDP:

  • Same layer: list Dex’s login methods, its connector IDs, in dashboard.auth.oidc.connectors. The installer then has KDP put the user’s login method in the link.
  • Your own KDP: see Skip Dex’s chooser.

Set connectors only when the issuer is a Dex: other providers, such as Keycloak, Okta and Entra ID, refuse the scope this needs. Dex also asks users to approve KubeV on each sign-in, unless Dex’s oauth2.skipApprovalScreen is set: the installer sets it on the Dex it deploys, and you set it on a Dex you run yourself.

When the signed-in account can’t open the project, KubeV says which account it checked, and offers to sign in with a different one.

The button’s link carries no credential. Without completing the sign-in, a user gets nothing from KubeV.