In this step, you will create a namespace for the virtual machine. The "namespace.yaml" file in the "/getstarted/kubevirt/workload" directory of the forked repository contains the declarative specification for the namespace resource.
Open a Terminal (macOS/Linux) or Command Prompt (Windows) and navigate to the folder where you forked the Git repository
Navigate to the folder "/getstarted/kubevirt/workload"
Type the command
rctl create namespace -f namespace.yaml
If you did not encounter any errors, you can optionally verify if everything was created correctly on the controller.
In your project, select Infrastructure -> Namespaces
You should see a namespace called vm
Next, you will publish the namespace to the cluster.
In this step, you will create a workload resource for the virtual machine. The "vm-workload.yaml" file in the "/getstarted/kubevirt/workload" directory of the forked repository contains the declarative specification for the workload.
The following items may need to be updated/customized if you used alternate names.
Note that the workload's name is "vm" and it is of type "k8s YAML". The actual k8s YAML file for the VM is in the payload "vm.yaml" file.
rctl create workload vm-workload.yaml
If there were no errors, you should see a message like below
Workload created successfully
Now, let us publish the newly created VM workload to the cluster. The workload can be deployed to multiple clusters as per the configured "placement policy". In this case, you are deploying to a single cluster with the name "kubevirt-cluster".