Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

deploy

Deploy a workload to a namespace on an OpenShift or Kubernetes cluster — either a KubeVirt VirtualMachine or a Deployment + Service. Give it the info; it renders an auditable manifest, then applies it with oc (or kubectl).

# A VM from a containerDisk image
vrtmv deploy --kind vm -n prod --name web01 \
  --image quay.io/example/rhel9-container-disk:latest --cpu 2 --memory 4Gi

# A VM booting from the migrated disk (imported via CDI)
vrtmv deploy --kind vm -n prod --name web01 \
  --disk-url https://mirror.internal/disks/web01.qcow2 --disk-size 40Gi

# A container, exposed with a Service + Route
vrtmv deploy --kind container -n staging --name api \
  --image registry.example.com/api:1.4 --replicas 3 --port 8080 --route
FlagPurpose
--kind <vm|container>What to deploy.
-n, --namespace <ns>Target namespace.
--name <name>Workload name (DNS-1123).
--image <ref>OCI image (container) or containerDisk image (vm).
--disk-url <url> + --disk-size <q>VM only: import the migrated disk (CDI DataVolume) instead of a containerDisk.
--storage-class <name>VM only: StorageClass for the imported disk.
--cpu <n>, --memory <q>vCPU cores and memory (default 1 / 2Gi).
--replicas <n>Container only (default 1).
--port <n>, --route [--host <fqdn>]Container only: expose via a Service, and optionally an OpenShift Route.
--server <url>, --token <t>Cluster API + bearer token. Omit to use your current oc login.
--insecure-skip-tls-verifySkip API-server TLS check (labs only).
-o, --out <path>Where to write the manifest (default vrtmv-deploy.yaml).
--dry-runRender the manifest but don’t apply it.
--kubectlApply with kubectl instead of oc.

How it works

deploy renders the manifest, keeps it as an auditable artifact (vrtmv-deploy.yaml, on brand with vrtmv’s other outputs), then applies it. Cluster access is your current oc login (recommended) or explicit --server/--token. When you pass --token, vrtmv hands it to oc through a private temporary kubeconfig rather than the command line, so the credential never appears in the process list. --dry-run renders without a cluster.

Inputs are validated before the cluster is touched — names as DNS-1123 labels, memory/disk as Kubernetes quantities, the image as a reference, and --disk-url/--host as quote-free values — so a mistake errors with guidance instead of producing a bad object.

From a migration

vrtmv migrate can emit the deploy manifest alongside the role and attestation when you give it a disk source:

vrtmv migrate --root /mnt --target rocky9 -o out \
  --deploy-image quay.io/you/rocky9:latest --deploy-namespace prod --deploy-name web01
# → out/deploy/vrtmv-deploy.yaml   (review, then: oc apply -f)

Prerequisites

  • The OpenShift CLI oc (or kubectl with --kubectl) on your PATH.
  • For --kind vm: OpenShift Virtualization / KubeVirt on the cluster; for --disk-url, the CDI (Containerized Data Importer) operator.
  • For --route: an OpenShift cluster (Routes are OpenShift-specific).