Skip to content

Instantly share code, notes, and snippets.

@guangbochen
Created August 25, 2020 06:44
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/81a40237c3e71c51fd0926395fbf7ab4 to your computer and use it in GitHub Desktop.
Save guangbochen/81a40237c3e71c51fd0926395fbf7ab4 to your computer and use it in GitHub Desktop.
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
name: centos-net2
spec:
dataVolumeTemplates:
- metadata:
name: centos-net2-rootdisk-kfg0p
spec:
pvc:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
source:
http:
url: https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2.xz
running: true
template:
spec:
domain:
cpu:
cores: 1
devices:
disks:
- disk:
bus: virtio
name: rootdisk
- disk:
bus: virtio
name: cloudinitdisk
interfaces:
- name: default
masquerade: {}
- name: test1
bridge: {}
resources:
requests:
memory: 2Gi
hostname: centos-net2
networks:
- name: default
pod: {} # Stock pod network
- name: test1
multus:
networkName: macvlan-conf
volumes:
- dataVolume:
name: centos-net2-rootdisk-kfg0p
name: rootdisk
- cloudInitNoCloud:
networkData: |
network:
version: 1
config:
- type: physical
name: eth1
subnets:
- type: dhcp
userData: |-
#cloud-config
name: default
hostname: ctar
password: root
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