-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Roll-up of updates to migrate from Kata- to Killer- coda (#35)
* Basic migration from kata to killer coda Signed-off-by: cwilkers <[email protected]> * Updates for Killercoda to 101 scenario - Added structure to sort and title scenarios in KC interface - Updated to remove or change mentions of KataCoda Signed-off-by: cwilkers <[email protected]> * Bumping clusters to two nodes after failing 101 scenario Signed-off-by: cwilkers <[email protected]> * Updating migration scenario to use fore/background scripts Signed-off-by: cwilkers <[email protected]> * Scripts must be in scenario tree Signed-off-by: cwilkers <[email protected]> * Script updates Signed-off-by: cwilkers <[email protected]> * Updates for newer ubuntu and k8s Signed-off-by: cwilkers <[email protected]> * Quieter download for debug and ssh fix Signed-off-by: cwilkers <[email protected]> * Script fine-tuning Signed-off-by: cwilkers <[email protected]> * CDI scenario basic updates to kllr Signed-off-by: cwilkers <[email protected]> * Install HPP from newer operator Signed-off-by: cwilkers <[email protected]> * Visibility updates for 101 scenario Signed-off-by: cwilkers <[email protected]> * Add colorized prompt to other scen Signed-off-by: cwilkers <[email protected]> * Make CDI better Signed-off-by: cwilkers <[email protected]> * Fine tuning CDI environment Signed-off-by: cwilkers <[email protected]> * Changed HPP to script Signed-off-by: cwilkers <[email protected]> * Change Fedora to Cirros Signed-off-by: cwilkers <[email protected]> * Unify scenario descriptions Signed-off-by: cwilkers <[email protected]> * Small cluster performance updates Signed-off-by: cwilkers <[email protected]> * Move node taint to background script so install can make use of both nodes Signed-off-by: cwilkers <[email protected]> * Update front page to include only 101 example Signed-off-by: cwilkers <[email protected]> * amend! Updating migration scenario to use fore/background scripts Updating migration scenario to use fore/background scripts Signed-off-by: cwilkers <[email protected]>
- Loading branch information
Showing
20 changed files
with
286 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
# Interactive Katacoda Scenarios | ||
# Interactive Killercoda Scenarios | ||
|
||
[![](http://shields.katacoda.com/katacoda/kubevirt/count.svg)](https://www.katacoda.com/kubevirt "Get your profile on Katacoda.com") | ||
|
||
Visit https://www.katacoda.com/kubevirt to view the profile and interactive scenarios | ||
Visit https://killercoda.com/kubevirt to view the profile and interactive scenarios | ||
|
||
### Writing Scenarios | ||
Visit https://www.katacoda.com/docs to learn more about creating Katacoda scenarios | ||
Visit https://killercoda.com/creators to learn more about creating Killercoda scenarios | ||
|
||
For examples, visit https://github.com/katacoda/scenario-example | ||
For examples, visit https://github.com/killercoda/scenario-examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
export PS1="\[\e[1;33m\]\h $ \[\e[1;36m\]" | ||
trap 'echo -ne "\e[0m"' DEBUG | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,60 @@ | ||
#### Deploy a VM | ||
# Deploy a Virtual Machine | ||
|
||
The command below applies a YAML definition of a virtual machine into our current Kubernetes environment, defining the VM name, the resources required (disk, CPU, memory), etc. You can take a look at the [vm.yaml](https://kubevirt.io/labs/manifests/vm.yaml) file if you have interest in knowing more about a virtual machine definition: | ||
The command below applies a YAML definition of a virtual machine into the current Kubernetes environment, defining the VM name, the resources required (disk, CPU, memory), etc. You can take a look at the [vm.yaml](https://kubevirt.io/labs/manifests/vm.yaml) file if you have interest in knowing more about a virtual machine definition: | ||
|
||
`kubectl apply -f https://kubevirt.io/labs/manifests/vm.yaml`{{execute}} | ||
|
||
We are creating a Virtual Machine in the same way as we would create any other Kubernetes resource thanks to what KubeVirt has enabled in our environment. Now we have a Virtual Machine as a Kubernetes resource. | ||
We are creating a Virtual Machine in the same way as we would create any other Kubernetes resource thanks to the KubeVirt operator in our environment. Now we have a Virtual Machine as a Kubernetes resource. | ||
|
||
After the vm resource has been created, you can manage the VMs with standard 'kubectl' commands: | ||
|
||
``` | ||
$ kubectl get vms | ||
$ kubectl get vms -o yaml testvm | ||
``` | ||
|
||
Check that the VM is defined (using commands above): | ||
|
||
`kubectl get vms`{{execute}} | ||
|
||
`kubectl get vms -o yaml testvm | grep -E 'running:.*|$'`{{execute}} | ||
|
||
Notice from the output that the VM is not running yet. | ||
|
||
To start a VM, `virtctl` should be used: | ||
To start a VM, use _virtctl_ with the _start_ verb: | ||
|
||
`./virtctl start testvm`{{execute}} | ||
|
||
Now you can check again the VM status: | ||
Again, check the VM status: | ||
|
||
`kubectl get vms`{{execute}} | ||
|
||
A `VirtualMachine` resource contains a VM's definition and status. An [instance](https://kubevirt.io/user-guide/virtual_machines/virtual_machine_instances/) of a running VM has an additional associated resource, a `VirtualMachineInstance`. | ||
A _VirtualMachine_ resource contains a VM's definition and status. An [instance](https://kubevirt.io/user-guide/virtual_machines/virtual_machine_instances/) of a running VM has an additional associated resource, a _VirtualMachineInstance_. | ||
|
||
Once the VM is running you can inspect its status: | ||
|
||
``` | ||
$ kubectl get vmis | ||
$ kubectl get vmis -o yaml testvm | ||
``` | ||
|
||
`kubectl get vmis`{{execute}} | ||
|
||
Once it's ready, the command above will print something like: | ||
Once it is ready, the command above will print something like: | ||
|
||
~~~ | ||
controlplane $ kubectl get vmis | ||
``` | ||
NAME AGE PHASE IP NODENAME | ||
testvm 1m Running 10.32.0.11 controlplane | ||
~~~ | ||
``` | ||
|
||
#### Accessing VMs (serial console & vnc) | ||
# Access a VM (serial console & vnc) | ||
|
||
Now that a VM is running you can access its serial console: | ||
Now that the VM is running you can access its serial console: | ||
|
||
**WARNING:** in some browser environments you will not be able to escape the serial console on Katacoda. | ||
**WARNING:** in some OS and browser environments you may not be able to escape the serial console in this course. | ||
|
||
**NOTE:** `^]` means: press the "CTRL" and "]" keys to escape the console. | ||
**NOTE:** _^]_ means: press the "CTRL" and "]" keys to escape the console. | ||
|
||
~~~sh | ||
# Connect to the serial console | ||
$ ./virtctl console testvm | ||
~~~ | ||
`./virtctl console testvm`{{execute}} | ||
|
||
If you opened the serial console within Katacoda and you can't escape from it by pressing `^]`, you can click on the `+` close to 'Terminal' to start a new shell there and be able to continue with the following steps in the shutdown and cleanup section. | ||
If you opened the serial console within the Killercoda course environment and you can't escape from it by pressing _^]_, you can click on the _+_ at the top of the terminal window to start a new shell. You should be able to continue with the following steps in the shutdown and cleanup section. | ||
|
||
In environments where VNC client access is available, the graphical console of a VM can be accessed with the [virtctl vnc](https://kubevirt.io/user-guide/virtual_machines/graphical_and_console_access/#accessing-the-graphical-console-vnc) command. | ||
|
||
#### Shutdown and cleanup | ||
# Shutdown and cleanup | ||
|
||
Shutting down a VM also employs the `virtctl` command: | ||
As with starting, stopping a VM also may be accomplished with the _virtctl_ command: | ||
|
||
`./virtctl stop testvm`{{execute}} | ||
|
||
Finally, the VM can be deleted using: | ||
Finally, the VM can be deleted as any other Kubernetes resource using _kubectl_: | ||
|
||
`kubectl delete vms testvm`{{execute}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
until kubectl -n kubevirt wait --for=jsonpath='{.status.phase}'=Deployed kubevirt/kubevirt --timeout 9m | ||
do | ||
sleep 30 | ||
done | ||
|
||
export PS1="\[\e[1;33m\]\h $ \[\e[1;36m\]" | ||
trap 'echo -ne "\e[0m"' DEBUG | ||
|
||
echo "KubeVirt is deployed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
kubectl taint node controlplane node-role.kubernetes.io/control-plane:NoSchedule- | ||
kubectl taint node controlplane node-role.kubernetes.io/master:NoSchedule- | ||
|
||
export KUBEVIRT_VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases/latest | jq -r .tag_name) | ||
echo Installing Kubevirt $KUBEVIRT_VERSION | ||
|
||
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml | ||
kubectl -n kubevirt scale deployment/kubevirt-operator --replicas=1 | ||
|
||
kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml | ||
|
||
kubectl -n kubevirt patch kubevirt kubevirt --type=merge --patch '{"spec":{"configuration":{"developerConfiguration":{"useEmulation":true,"featureGates":["LiveMigration"]}}}}' | ||
kubectl -n kubevirt patch kubevirt/kubevirt --type=merge --patch='{"spec": {"infra": {"replicas": 1}}}' | ||
|
||
curl -sL https://raw.githubusercontent.com/kubevirt/hostpath-provisioner/main/deploy/kubevirt-hostpath-provisioner.yaml \ | ||
| sed 's/v1beta1/v1/' | kubectl create -f - | ||
|
||
kubectl annotate storageclass kubevirt-hostpath-provisioner storageclass.kubernetes.io/is-default-class=true | ||
|
||
curl -sLo virtctl https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/virtctl-${KUBEVIRT_VERSION}-linux-amd64 | ||
|
||
sudo install -m 0755 virtctl /usr/local/bin/virtctl | ||
rm -f virtctl | ||
|
||
echo "StrictHostKeyChecking=no" > ${HOME}/.ssh/config |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.