-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Roll-up of updates to migrate from Kata- to Killer- coda #35
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d3ac080
Basic migration from kata to killer coda
cwilkers 9d6e2e8
Updates for Killercoda to 101 scenario
cwilkers ef0b2bc
Bumping clusters to two nodes after failing 101 scenario
cwilkers f6b45b3
Updating migration scenario to use fore/background scripts
cwilkers 4cd7e5f
Scripts must be in scenario tree
cwilkers 5fe9095
Script updates
cwilkers e32039c
Updates for newer ubuntu and k8s
cwilkers e8d3250
Quieter download for debug and ssh fix
cwilkers c41b1aa
Script fine-tuning
cwilkers cf8c345
CDI scenario basic updates to kllr
cwilkers 9a0d62c
Install HPP from newer operator
cwilkers b8ce27f
Visibility updates for 101 scenario
cwilkers 9ba2bd7
Add colorized prompt to other scen
cwilkers 6489585
Make CDI better
cwilkers 105256f
Fine tuning CDI environment
cwilkers 215aa23
Changed HPP to script
cwilkers 26b1d29
Change Fedora to Cirros
cwilkers 86de645
Unify scenario descriptions
cwilkers 72cf585
Small cluster performance updates
cwilkers 288ef14
Move node taint to background script so install can make use of both …
cwilkers cd6f9c9
Update front page to include only 101 example
cwilkers 372aa0d
amend! Updating migration scenario to use fore/background scripts
cwilkers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are the {{execute}} tags I keep seeing. They render on output. Its not just this file I see them on. |
||
|
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot triple ticks somewhere. this does not render correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it also causes the remaining page to not render correctly