Skip to content

Latest commit

 

History

History
77 lines (70 loc) · 2.68 KB

test.md

File metadata and controls

77 lines (70 loc) · 2.68 KB

Create ssh key file

  • 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

Create your first Virtual Machine(s)

  • 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

Create Live Migration enabled VMs

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

Tips:

  • 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

FAQ:

  • 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