diff --git a/README.md b/README.md index a272fec..e7fe702 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ List of helper scripts and tools | [ssh-jumphosts-template.sh](helper/ssh-jumphosts-template.sh) | Template to create a jumphost script with predefined enviroments. | | [Infrastructure benchmarking](helper/benchmarking) | Documentation on how to benchmark various infrastrucutre elements used for hosting a kubernetes cluster. | | [KKP Project Viewer Service Account](helper/kkp-projectviewer.service-account.rbac.yaml) | Adding a service account with view-only rights to your KKP Master Cluster | +| [KubeVirt Debug VM (Ubuntu)](helper/kubevirt/kubevirt.debug.vm.yaml) | KubeVirt Ubuntu VM with SSH add cloud-init to test or debug kubevirt environments | ## Knowledge Base diff --git a/helper/kubevirt/kubevirt.debug.vm.yaml b/helper/kubevirt/kubevirt.debug.vm.yaml new file mode 100644 index 0000000..cf5c446 --- /dev/null +++ b/helper/kubevirt/kubevirt.debug.vm.yaml @@ -0,0 +1,73 @@ +apiVersion: kubevirt.io/v1 +kind: VirtualMachine +metadata: + #namespace: default + labels: + kubevirt.io/vm: vm-ubuntu-debug + name: vm-ubuntu-debug +spec: + dataVolumeTemplates: + - metadata: + creationTimestamp: null + name: vm-ubuntu-debug + spec: + pvc: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 8Gi + #storageClassName: kubermatic-vm-disk + source: + http: + #url: http://vm-image-registry.kube-system.svc/vms/ubuntu-22.04-server-cloudimg-amd64.img + #latest cloudimg + url: https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img + running: true + template: + metadata: + labels: + kubevirt.io/vm: vm-ubuntu-debug + spec: + dnsConfig: + nameservers: + - 8.8.8.8 + dnsPolicy: None + domain: + devices: + disks: + - disk: + bus: virtio + name: datavolumedisk + - disk: + bus: virtio + name: cloudinitdisk +# interfaces: +# - macAddress: 12:78:03:8b:95:d7 +# name: default +# machine: +# type: q35 +# networks: +# - name: default + resources: + requests: + memory: "8Gi" + cpu: "2" + limits: + memory: "8Gi" + cpu: "2" + terminationGracePeriodSeconds: 30 + volumes: + - dataVolume: + name: vm-ubuntu-debug + name: datavolumedisk + - cloudInitNoCloud: + userData: | + #!/bin/sh + uname -a + mkdir -p /root/.ssh + cat << EOF >> /root/.ssh/authorized_keys + #### TODO ADD YOUR SSH PUBLIC KEY EOF + echo 'ssh key added ...' + cat /root/.ssh/authorized_keys + name: cloudinitdisk \ No newline at end of file