- Create Kubernetes secret with base64 encoded ssh pub key
ls ~/.ssh/id_rsa.pub >/dev/null || ssh-keygen
kubectl create secret generic kargo-sshpubkey-kc2user \
--from-file=key1=$HOME/.ssh/id_rsa.pub \
--dry-run=client -oyaml \
| kubectl apply -f -
- Verify secret contents
kubectl get secret -oyaml kargo-sshpubkey-kc2user | awk '/key1:/{print $2}' | base64 -d
- Deploy Ephemeral NAT'd Ubuntu VM
kubectl apply -f https://raw.githubusercontent.com/ContainerCraft/Kargo/master/test/ubuntu-nat.yaml
- Deploy Ephemeral Bridged Ubuntu VM
kubectl apply -f https://raw.githubusercontent.com/ContainerCraft/Kargo/master/test/ubuntu-br0.yaml
- Deploy Persistent Bridged Ubuntu VM
kubectl apply -f https://raw.githubusercontent.com/ContainerCraft/Kargo/master/test/ubuntu-br0-persistent.yaml
Note: the following virtual machines require the
ceph-filesystem-*
storage classes
- Deploy Persistent Live Migration Enabled Bridged Ubuntu VM
kubectl apply -f https://raw.githubusercontent.com/ContainerCraft/Kargo/master/test/ubuntu-br0-persistent-livemigrate.yaml
- Deploy Persistent Live Migration Enabled Bridged Ubuntu & Fedora VMs with RDP enabled
kubectl apply -f https://raw.githubusercontent.com/ContainerCraft/Kargo/master/test/ubuntu-br0-persistent-livemigrate-rdp.yaml
kubectl apply -f https://raw.githubusercontent.com/ContainerCraft/Kargo/master/test/fedora-br0-persistent-livemigrate-rdp.yaml
- Watch vm creation events
kubectl get events -Aw
- List all Virtual Machines
kubectl get vm -A
- List all Virtual Machine Instances (VMI) (Running VMs)
kubectl get vmi -A
- Connect to different VMI Serial Console
FYI: Exit serial console with key combination
ctrl + shift + ]
virtctl console ubuntu
virtctl console ubuntu-br0
virtctl console ubuntu-br0-persistent
virtctl console ubuntu-br0-persistent-livemigrate
virtctl console ubuntu-br0-persistent-livemigrate-rdp
virtctl console fedora-br0-persistent-livemigrate-rdp
- Example ssh to bridge VMI with default user
FYI: get ip address from get vmi command
-
Q.1: Where do the vm images come from?
-
A.1: All images are built directly from upstream sources via public opensource pipelines
-
Q.2: Can I change my ssh key after deploying virtual machines?
-
A.2: Yes, the qemu-guest-agent will update ssh keys on the fly, re-apply your ssh public key secret and it will rotate keys automatically