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
| Requirement | How to check |
|---|---|
| A platform release that includes managed SSH and the Project image catalog | The 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 Fleet | kubectl -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 claims | On 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 disabled | The chart refuses backend.vmSSH.enabled without them. |
| Block and ReadWriteMany VM storage with a retained snapshot class | The 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 URLs | The 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 10 | The 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 origin | The 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.
-
Choose the storage profile. The built-in Ceph profile uses
rbd-vmand therbd-vm-goldensnapshot class. For an external CSI backend, configure all fourVM_PREPARED_*settings, including the Flux Kustomization that supplies the classes. Verify Block/ReadWriteMany restore,Immediatebinding,Deletevolume reclaim, andRetainsnapshot deletion on that driver. Qualify live migration separately if you intend to offer it. External CSI profile and qualification -
On a fresh install, run your normal
kube-dc bootstrap initwith--dry-run. With the default--managed-ssh-images=auto, the plan addsvm-ssh-site-images.yamlandvm-ssh-managed-goldenswhen the installation has KubeVirt, the storage profile and image acceleration with object storage.--managed-ssh-images=onfails instead of skipping them, and--managed-ssh-images=offleaves them out. When the registry depot is installed, the job also pushes each image there as a ContainerDisk. Installation guide -
On an existing installation, add the
platform/vm-ssh-site-imagescomponent 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 throughkube-dc bootstrap managed-ssh-images, follow the switch in that README. It takes two Fleet commits, so that Flux does not delete the selection. -
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-firstkubectl -n kube-dc logs -f job/vm-ssh-site-images-firstA 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.
-
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'ssecurity.kube-dc.com/vm-ssh-releaseannotation names the selected build.kubectl -n vm-ssh-image-candidates get datavolumes,pvc,volumesnapshotskubectl -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.
-
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-256a1122f0e5784c2f46b392e0340a2d052865b1a373847c03a0d251719f09fa98c). 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. SetVMSSH_JOURNAL_REALMSto the pilot Organization realms,VMSSH_JOURNAL_EPOCHto a new random value of 32 lowercase hexadecimal digits that you never change afterwards, andVMSSH_JOURNAL_TOKENfrom a Secret. When the realms sign in through the platform SSO broker, also setVMSSH_JOURNAL_BROKER_REALMSandVMSSH_JOURNAL_BROKER_ISSUER(the HTTPS issuer ending in/realms/sso). Run a single writer during the change (deployment strategyRecreate), and expect sign-ins to pause while Keycloak restarts. Verify thatGET /realms/REALM/kube-dc-vm-ssh-journal/headreturns 200 with the token and 403 without it. -
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-dcnamespace with four keys:realm(master, the realm that holds the client),client-id,client-secret, andjournal-token(the same token as the journal). Its name isbackend.vmSSH.directorySecretName. The backend does not start while a key is missing. -
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
certificateSigneruses.kube-dc bootstrap openbao setup-controller-auth TARGET --repo FLEET_DIRECTORY --refresh-policy
Enable managed SSH
-
Set these values under
backend.vmSSHin the platform release, and keep the rest at their defaults.backend:vmSSH:enabled: truecertificateSigner: truepilotOrganizations:- ORGANIZATIONdirectorySecretName: DIRECTORY_SECRETlauncherAudience: urn:kube-dc:vm-ssh-INSTALLATIONephemeralCreateOrigin: https://BACKEND_HOSTNAMEpersistentSnapshotControllerUsername: SNAPSHOT_CONTROLLER_USERprojectCatalog:mode: "shadow"launcherAudiencemust be unique to this installation.ephemeralCreateOriginalso serves persistent guest enrollment. SetpersistentSnapshotControllerUsernameto the service account of your CSI snapshot controller when it differs from the chart default.certificateSignerneeds the OpenBao policy refresh of the previous section; leave itfalseto offer public keys and browser sessions only. On an external CSI profile, also setprojectCatalog.storageClassandprojectCatalog.snapshotClassto your prepared classes; otherwise the catalogs stayPreparing. -
Reconcile and wait until the Project image catalogs list the images. In
shadowmode 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 inpilotOrganizationsand its namespace was created for the Project. The manager attests older Project namespaces of a pilot Organization itself.kubectl get vmsshprojectimagecatalogs -Akubectl -n PROJECT_NAMESPACE get vmsshprojectimagecatalog vm-ssh-images -o yaml -
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. -
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. -
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
getenforcereportsEnforcingand thatsudo ausearch --input-logs -m AVC,USER_AVC -ts bootfinds 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.
- 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.
- Add the qualified Project record to
backend.vmSSH.persistentCreateRootsthrough 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
- 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. - List pending creations and managed VMs, and agree a recovery path for each before you remove anything.
- To leave
dynamicmode foroff, setshadowfirst. The manager then removes thesecurity.kube-dc.com/vm-ssh-root-cataloglabel from each Project namespace. Setoffonly when no namespace carries the label and no creation from the catalog is still in progress.pausedkeeps the label, so do not go frompausedstraight tooff. Do not remove thebackend.vmSSHvalues in one step. - 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 thesecurity.kube-dc.com/vm-ssh-site-holdannotation from the ConfigMap. With a Fleet-selected release, runkube-dc bootstrap managed-ssh-imageswith 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"}}
- Run
list-imagesand choose an entry fromdata.items. Copy itsimagealias and check itscatalogOS,storageClass, andminimumGiB. If the OS has no approved entry, ask the operator to qualify it. - Generate a UUID v4 for the operation. Send the
createaction withname,image,cpu,memoryGi,diskGi, andoperationIdinsiderequest. SetdiskGito at least the returned minimum. - Repeat the identical call, including the UUID, to check
data.phase. Follow apendingorenrollingreceipt to completion. Forblocked, inspect the VM and disk inventory with the operator. Atmanaged, recorddata.vmUID. Switching tocreate_vmwould submit a separate Project-key VM request. Use that compatibility flow only when the user expressly chooses it. - Send
get-accesswithnameand the returnedvmUIDto pin the VM identity. Checkdata.namedTransportReady, your named username, allowed methods, enrolled host fingerprint, endpoints, and your attachments. - For personal-key access, send
list-keysto find your Organization registration. To register a local OpenSSH key, sendregister-keywithlabeland the.pubfile contents aspublicKey. Sendattach-keywithname,vmUID, and the registration'sidaskeyId. Keep the private key on your workstation. - 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, runkube-dc ssh vm PROJECT_NAME/VM_NAME --relayfrom your authenticated CLI for a private guest. Session credentials and browser tickets stay in their respective connection flows. - To withdraw the key from this VM, send
detach-keywith the samename,vmUID, andkeyId. 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
| Symptom | What to check |
|---|---|
| No managed option for the chosen OS | Verify 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 pending | Inspect 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 pending | Inspect 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 pending | Check 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 Project | Check 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 boot | The x86_64 AlmaLinux 10 build needs x86-64-v3 CPUs. Check the node CPU labels. |
| Enrollment succeeded but a login is denied | Check 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 verification | Retire 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. |