Skip to content

Commit

Permalink
Merge pull request #133 from kubermatic/kubevirt-debug-vm
Browse files Browse the repository at this point in the history
add KubeVirt Debug VM
  • Loading branch information
toschneck authored Nov 14, 2024
2 parents 692483c + 5604aa7 commit 1750b51
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
73 changes: 73 additions & 0 deletions helper/kubevirt/kubevirt.debug.vm.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1750b51

Please sign in to comment.