Skip to content

Instantly share code, notes, and snippets.

@ams0
Created October 2, 2020 09:42
Show Gist options
  • Select an option

  • Save ams0/3f7e1303d76e72f5d7d1d10f1cce4e33 to your computer and use it in GitHub Desktop.

Select an option

Save ams0/3f7e1303d76e72f5d7d1d10f1cce4e33 to your computer and use it in GitHub Desktop.
kubectl apply -f - <<EOF
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
generation: 1
labels:
kubevirt.io/os: windows
name: vm1
spec:
running: true
template:
metadata:
labels:
kubevirt.io/domain: vm1
spec:
nodeSelector: #nodeSelector matches nodes where performance key has high as value.
nested: "true"
domain:
cpu:
cores: 2
devices:
disks:
- disk:
bus: virtio
name: harddrive
machine:
type: q35
resources:
requests:
memory: 4096M
volumes:
- name: harddrive
persistentVolumeClaim:
claimName: winhd
---
apiVersion: v1
kind: Service
metadata:
name: vmrdp
spec:
externalTrafficPolicy: Cluster
ports:
- port: 3389
name: rdp
protocol: TCP
targetPort: 3389
selector:
kubevirt.io/domain: vm1
type: LoadBalancer
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment