Skip to content

Instantly share code, notes, and snippets.

@guangbochen
Last active May 6, 2021 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guangbochen/fad8244efd1c2fa8dc4ace2d3dc5b7d9 to your computer and use it in GitHub Desktop.
Save guangbochen/fad8244efd1c2fa8dc4ace2d3dc5b7d9 to your computer and use it in GitHub Desktop.
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
name: ubuntu
spec:
dataVolumeTemplates:
- metadata:
name: ubuntu-disk
spec:
pvc:
storageClassName: local-path
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
source:
http:
url: https://cloud-images.ubuntu.com/bionic/20200819/bionic-server-cloudimg-amd64.img
running: true
template:
spec:
domain:
cpu:
cores: 1
devices:
disks:
- disk:
bus: virtio
name: rootdisk
bootOrder: 1
- disk:
bus: virtio
name: cloudinitdisk
resources:
requests:
memory: 2048M
volumes:
- dataVolume:
name: ubuntu-disk
name: rootdisk
- cloudInitNoCloud:
userData: |
#cloud-config
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
name: cloudinitdisk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment