Skip to main content

Set up managed SSH for persistent VMs

As a platform operator, you can offer prepared Linux root disks and individual SSH accounts to selected Organizations. The installation builds and imports the disks. You choose which Organizations participate, and the manager builds each eligible Project's image catalog from the selected release. In the VM wizard, a supported operating system with an active managed image has Enable managed SSH selected by default. The user can clear the selection. When managed SSH is unavailable, the wizard can offer a qualified generic Block root or a direct catalog image. This choice happens before submission. Tenant guide to managed SSH

Set up an installation in this order: check the prerequisites, build the guest images, configure identity, then enable managed SSH for your pilot Organizations.

Check the prerequisites​

RequirementHow to check
A platform release that includes managed SSH and the Project image catalogThe release notes of your Kube-DC version. Pin the chart, CRD artifact, manager, backend and consoles of that release together.
Envoy Gateway v1.9.3 or later (v1.10.0 is the qualified version) with the Gateway API v1.6.1 CRDs, owned by your Fleetkubectl -n envoy-gateway-system get deploy envoy-gateway -o jsonpath='{..image}' and the bundle-version annotation of the listenersets.gateway.networking.k8s.io CRD. Upgrade Envoy Gateway as its own change first.
HTTPS hostnames recorded as hostname claimsOn an installation where nothing is exposed over HTTPS yet, the manager adopts claims by itself. Set EXPOSURE_MIN_MANAGER=v0.9.26 in the cluster's Fleet configuration so the Fleet checks accept the manager version. An installation whose earlier manager already exposed HTTPS services completes the hostname claims migration of its release before it takes a managed SSH manager.
OpenBao and the Console API enabled, with one backend API replica and autoscaling disabledThe chart refuses backend.vmSSH.enabled without them.
Block and ReadWriteMany VM storage with a retained snapshot classThe built-in Ceph profile uses rbd-vm and rbd-vm-golden. For an external CSI backend, see step 2 of the next section.
KubeVirt KVM nodes and the OS image mirror (cdi-os-mirror, from image acceleration with object storage)kubectl get nodes -o custom-columns=N:.metadata.name,KVM:.status.allocatable.devices\.kubevirt\.io/kvm shows KVM capacity, and the cdi-os-images bucket exists in kube-dc. The image build stores its disks in that bucket, about 3.5 GiB for each build of the six families, within SYSTEM_QUOTA_CDI_OS_IMAGES.
HTTPS access from the CDI importer to the disk URLsThe build serves its disks at https://<S3_HOSTNAME>/cdi-os-images/...; for a Fleet-selected release, the release's host. The first build or import confirms it.
x86-64-v3 CPUs on every KVM node, for AlmaLinux 10The node labels cpu-feature.node.kubevirt.io/avx2, bmi2, fma and movbe are true. Without them, leave AlmaLinux 10 out of the release you select.
A verified HTTPS path from guests to the backend originThe guest enrolls through ephemeralCreateOrigin. For a private endpoint, put the issuing CA (PEM) in backend.vmSSH.ephemeralCreateCABundle.

Prepare the guest images​

Each installation builds its own managed SSH images. The default way is a daily job on the installation. It downloads pinned vendor images of Debian 12, Debian 13, Ubuntu 24.04, Ubuntu 26.04, AlmaLinux 10 and Fedora 45, installs the managed SSH agent of your Kube-DC release, and seals the disks. Each disk must boot two clones under KVM and pass enrollment and logins before the job publishes it. Fedora and AlmaLinux guests run the agent with SELinux enforcing. The job then imports each disk as a Block/ReadWriteMany golden image with a retained snapshot and selects the set for the Project image catalog. New VMs start from copy-on-write clones of those snapshots. A generic catalog image or a successful OS boot alone does not establish support.

  1. Choose the storage profile. The built-in Ceph profile uses rbd-vm and the rbd-vm-golden snapshot class. For an external CSI backend, configure all four VM_PREPARED_* settings, including the Flux Kustomization that supplies the classes. Verify Block/ReadWriteMany restore, Immediate binding, Delete volume reclaim, and Retain snapshot deletion on that driver. Qualify live migration separately if you intend to offer it. External CSI profile and qualification

  2. On a fresh install, run your normal kube-dc bootstrap init with --dry-run. With the default --managed-ssh-images=auto, the plan adds vm-ssh-site-images.yaml and vm-ssh-managed-goldens when the installation has KubeVirt, the storage profile and image acceleration with object storage. --managed-ssh-images=on fails instead of skipping them, and --managed-ssh-images=off leaves them out. When the registry depot is installed, the job also pushes each image there as a ContainerDisk. Installation guide

  3. On an existing installation, add the platform/vm-ssh-site-images component to the cluster's Fleet configuration. Its README lists the variables: the registry depot, an internal vendor mirror for air-gapped sites, and a private CA. If the installation already selects a release through kube-dc bootstrap managed-ssh-images, follow the switch in that README. It takes two Fleet commits, so that Flux does not delete the selection.

  4. Start the first build instead of waiting for the daily run, and follow it. A build of all six families takes about 40 minutes.

    kubectl -n kube-dc create job --from=cronjob/vm-ssh-site-images vm-ssh-site-images-first
    kubectl -n kube-dc logs -f job/vm-ssh-site-images-first

    A family that fails keeps its previous image, and the job never selects a set that drops a family the current selection offers. A later run rebuilds a family only when its inputs change, such as after a Kube-DC upgrade.

  5. Check the candidates and the selection. Each DataVolume has succeeded, each claim uses the intended class and access mode, and each snapshot reports readyToUse: true. The ConfigMap's security.kube-dc.com/vm-ssh-release annotation names the selected build.

    kubectl -n vm-ssh-image-candidates get datavolumes,pvc,volumesnapshots
    kubectl -n vm-ssh-image-candidates get configmap vm-ssh-managed-images -o jsonpath='{.metadata.annotations}'

Changing the cdi-os-images ObjectBucketClaim, for example its size limit, makes Rook drop the bucket's public read policy. Until the hourly cdi-os-mirror-bucket-policy job runs, imports fail. Run it immediately with kubectl -n kube-dc create job --from=cronjob/cdi-os-mirror-bucket-policy <name>.

Instead of building images, an installation can select a reviewed managed-ssh-images.json release in Fleet. Use kube-dc bootstrap init --managed-ssh-images-release RELEASE_JSON on a fresh install, or kube-dc bootstrap --repo FLEET_DIRECTORY managed-ssh-images TARGET --release RELEASE_JSON on an existing one. That command refuses a cluster that builds its own images. For a site-specific HTTP source, provision the referenced CA ConfigMap or authentication Secret in vm-ssh-image-candidates before reconciling.

Configure identity​

Do these steps before you enable managed SSH. They need administrator access to Keycloak and OpenBao, and two new Secrets. Never reuse another installation's tokens, epoch, client or launcher audience.

  1. Membership journal. Run Keycloak with the Kube-DC VM SSH journal provider, on every replica that accepts writes for a pilot realm. For Keycloak 26.8.0, use the published image docker.io/shalb/keycloak:26.8.0-vmssh-journal.1@sha256:792353e5e0ac4445e666675f634f28b9f152ba2f947996cc767ec6a3c2d86337 (amd64): the Kube-DC Keycloak 26.8.0 image with the provider at /opt/keycloak/providers/kubedc-vmssh-journal.jar (SHA-256 a1122f0e5784c2f46b392e0340a2d052865b1a373847c03a0d251719f09fa98c). Set it as the Keycloak image only on an installation that enables managed SSH: it refuses to start without the journal settings below. For another Keycloak version, the provider must be built and qualified for that exact image. The journal also needs Keycloak server workflows disabled (KC_FEATURES_DISABLED=workflows); check that no realm uses them. Set VMSSH_JOURNAL_REALMS to the pilot Organization realms, VMSSH_JOURNAL_EPOCH to a new random value of 32 lowercase hexadecimal digits that you never change afterwards, and VMSSH_JOURNAL_TOKEN from a Secret. When the realms sign in through the platform SSO broker, also set VMSSH_JOURNAL_BROKER_REALMS and VMSSH_JOURNAL_BROKER_ISSUER (the HTTPS issuer ending in /realms/sso). Run a single writer during the change (deployment strategy Recreate), and expect sign-ins to pause while Keycloak restarts. Verify that GET /realms/REALM/kube-dc-vm-ssh-journal/head returns 200 with the token and 403 without it.

  2. Directory reader. Create a service-account client in the master realm with read access to the users, groups and clients of the pilot realms. Create a Secret in the kube-dc namespace with four keys: realm (master, the realm that holds the client), client-id, client-secret, and journal-token (the same token as the journal). Its name is backend.vmSSH.directorySecretName. The backend does not start while a key is missing.

  3. OpenBao. Refresh the controller policy with the CLI that matches your release. It adds the VM SSH engine grants, including the SSH certificate signer that certificateSigner uses.

    kube-dc bootstrap openbao setup-controller-auth TARGET --repo FLEET_DIRECTORY --refresh-policy

Enable managed SSH​

  1. Set these values under backend.vmSSH in the platform release, and keep the rest at their defaults.

    backend:
    vmSSH:
    enabled: true
    certificateSigner: true
    pilotOrganizations:
    - ORGANIZATION
    directorySecretName: DIRECTORY_SECRET
    launcherAudience: urn:kube-dc:vm-ssh-INSTALLATION
    ephemeralCreateOrigin: https://BACKEND_HOSTNAME
    persistentSnapshotControllerUsername: SNAPSHOT_CONTROLLER_USER
    projectCatalog:
    mode: "shadow"

    launcherAudience must be unique to this installation. ephemeralCreateOrigin also serves persistent guest enrollment. Set persistentSnapshotControllerUsername to the service account of your CSI snapshot controller when it differs from the chart default. certificateSigner needs the OpenBao policy refresh of the previous section; leave it false to offer public keys and browser sessions only. On an external CSI profile, also set projectCatalog.storageClass and projectCatalog.snapshotClass to your prepared classes; otherwise the catalogs stay Preparing.

  2. Reconcile and wait until the Project image catalogs list the images. In shadow mode the manager builds a catalog and protected mirrors for each eligible Project, and nothing offers them yet. A Project is eligible when its Organization is in pilotOrganizations and its namespace was created for the Project. The manager attests older Project namespaces of a pilot Organization itself.

    kubectl get vmsshprojectimagecatalogs -A
    kubectl -n PROJECT_NAMESPACE get vmsshprojectimagecatalog vm-ssh-images -o yaml
  3. Set projectCatalog.mode: "dynamic". New persistent VMs in eligible Projects then resolve from their catalog, and a newly selected release reaches them without further changes.

  4. Optional: to let tenants choose a VM's address in the Project VPC, in the console and in managed SSH creation, set ovnSteeringGuard.projectVMStaticIPv4: true. The manager's admission webhook then checks each requested address against the Project subnet, its gateway, excluded and allocated addresses.

  5. Test as an ordinary member of a pilot Organization, not as a platform administrator. Create a VM on each OS family from the wizard or the hosted MCP tool, and check that it reaches managed within a few minutes. Sign in with a named key and verify the host fingerprint. On Fedora and AlmaLinux, also check that getenforce reports Enforcing and that sudo ausearch --input-logs -m AVC,USER_AVC -ts boot finds no denial. Test a Project of another Organization to verify the scope.

Approve a root by hand​

With projectCatalog.mode: "off", only the roots you list in backend.vmSSH.persistentCreateRoots are offered. Use this for a single qualified Project or an installation that cannot run the catalog.

  1. Prepare a retained snapshot mirror in the target Project. Qualify the exact Organization, Project and namespace UIDs, StorageClass UID, source and mirror snapshot/content UIDs, CSI driver and snapshot handle hash against the sealed release. Restore a disposable VM from that mirror and prove a named login, a persistent file and the same host fingerprint after restart.
  2. Add the qualified Project record to backend.vmSSH.persistentCreateRoots through Fleet. The record identifies the catalog OS, immutable image and minimum disk size. Test the wizard as an ordinary Project member and check Access after enrollment. Test a second Project to verify the scope.

Pause or roll back​

  1. To stop new managed VMs without cutting off existing ones, set projectCatalog.mode: "paused". Every image is withdrawn and accepted creations finish. Keep the launcher audience, origin, directory Secret and journal: a managed VM may have no other way in, and enrolling VMs need them.
  2. List pending creations and managed VMs, and agree a recovery path for each before you remove anything.
  3. To leave dynamic mode for off, set shadow first. The manager then removes the security.kube-dc.com/vm-ssh-root-catalog label from each Project namespace. Set off only when no namespace carries the label and no creation from the catalog is still in progress. paused keeps the label, so do not go from paused straight to off. Do not remove the backend.vmSSH values in one step.
  4. To return to the images selected before the last build, run kubectl -n kube-dc create job --from=cronjob/vm-ssh-site-images-rollback <name>. The daily build then stays on hold until the next Kube-DC image arrives, or until you remove the security.kube-dc.com/vm-ssh-site-hold annotation from the ConfigMap. With a Fleet-selected release, run kube-dc bootstrap managed-ssh-images with the earlier release instead. The catalogs retain the newer entries that accepted creations still use.

Authorize and verify a connection​

A tenant needs current Organization and Project membership, permission for the requested VM operation, and an effective VM grant for the chosen SSH method. Registering a public key makes it available to the Organization. Attaching it to the VM authorizes its use under the grant. The guest uses its instance-bound enrollment and checks the offered credential through the managed service. Verify the enrolled host fingerprint on a direct connection.

A browser connection uses a short-lived ticket. An enabled CLI signer can issue a short-lived certificate for a direct or relayed connection. Check the actual Linux username with id -un. A block, key retirement, membership removal, and session termination have different scopes. Verify a new sign-in after a policy change and check existing session closure separately. Connection and revocation procedures

Create and connect through hosted MCP​

Use the vm_ssh tool in a full, authenticated MCP session. Each call acts as the signed-in person. For a VM action, set project at the top level or use the Project URL's default. The Organization-wide key registration and listing actions also work without a Project. Put the action and its arguments inside request. The structured result has an action and a data object. Hosted MCP endpoint

For example, these vm_ssh arguments discover the approved roots in the dev Project.

{"project": "dev", "request": {"action": "list-images"}}
  1. Run list-images and choose an entry from data.items. Copy its image alias and check its catalogOS, storageClass, and minimumGiB. If the OS has no approved entry, ask the operator to qualify it.
  2. Generate a UUID v4 for the operation. Send the create action with name, image, cpu, memoryGi, diskGi, and operationId inside request. Set diskGi to at least the returned minimum.
  3. Repeat the identical call, including the UUID, to check data.phase. Follow a pending or enrolling receipt to completion. For blocked, inspect the VM and disk inventory with the operator. At managed, record data.vmUID. Switching to create_vm would submit a separate Project-key VM request. Use that compatibility flow only when the user expressly chooses it.
  4. Send get-access with name and the returned vmUID to pin the VM identity. Check data.namedTransportReady, your named username, allowed methods, enrolled host fingerprint, endpoints, and your attachments.
  5. For personal-key access, send list-keys to find your Organization registration. To register a local OpenSSH key, send register-key with label and the .pub file contents as publicKey. Send attach-key with name, vmUID, and the registration's id as keyId. Keep the private key on your workstation.
  6. For direct SSH, choose a reachable endpoint from get-access, verify the presented host fingerprint, and use the named account and matching private key. When the CLI certificate method is available, run kube-dc ssh vm PROJECT_NAME/VM_NAME --relay from your authenticated CLI for a private guest. Session credentials and browser tickets stay in their respective connection flows.
  7. To withdraw the key from this VM, send detach-key with the same name, vmUID, and keyId. Verify that a fresh login with that key is refused. Use the console's End sessions action when an existing connection also needs to close.

Troubleshoot a missing root or failed login​

SymptomWhat to check
No managed option for the chosen OSVerify the exact OS name, Organization allowlist, Project and namespace UIDs, and an active qualified root for that Project. An imported candidate alone does not appear in the wizard.
Import or snapshot stays pendingInspect the Flux Kustomization conditions, CDI import events, HTTP checksum, driver, StorageProfile, and retained snapshot class. Verify that the candidate namespace can reach and authenticate to the image source.
A persistent creation receipt stays pendingInspect its stage, the reserved destination PVC, and the snapshot and content bindings. Keep the receipt and its source available while investigating.
The VM boots but enrollment stays pendingCheck the guest's configuration and bootstrap volume mounts, backend TLS trust, launcher audience, guest service state, and a generated host public key. Without a login to the guest, read the launcher Pod's guest-console-log container: a missing "Started kube-dc-vm-ssh.service" line means the agent never started. On the guest, use systemctl status kube-dc-vm-ssh.service, and on Fedora or AlmaLinux also sudo ausearch --input-logs -m AVC -ts boot.
No managed image appears in a ProjectCheck the Project's vmsshprojectimagecatalog: its conditions name the reason, such as NotEligible for a Project outside the pilot Organizations or with an unattested namespace, or Preparing while the mirrors are created.
AlmaLinux 10 does not bootThe x86_64 AlmaLinux 10 build needs x86-64-v3 CPUs. Check the node CPU labels.
Enrollment succeeded but a login is deniedCheck the person's current membership, SSH method, key attachment or certificate validity, block state, directory continuity, and guest policy acknowledgement. Stop and investigate any host fingerprint mismatch.
A replacement image fails verificationRetire the candidate from new creation and restore the previous approved Project root. Retain source snapshots and catalog entries needed by accepted requests. Existing VM root disks have their own lifecycle.