Example of a pod definition for an ephemeral device

Example of a pod definition for an ephemeral deviceΒΆ

Virtlet stores all ephemeral volumes in the local libvirt pool storage in var/lib/virtlet/volumes. The volume configuration is defined under the volume section.

The following text is an example of a pod (virtual machine) definition with an ephemeral volume of 2048 MB capacity.

 apiVersion: v1
 kind: Pod
 metadata:
   name: test-vm-pod
   annotations:
     kubernetes.io/target-runtime: virtlet
 spec:
   affinity:
   nodeAffinity:
     requiredDuringSchedulingIgnoredDuringExecution:
       nodeSelectorTerms:
       - matchExpressions:
         - key: extraRuntime
           operator: In
           values:
           - virtlet
   containers:
   - name: test-vm
     image: download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
     volumeMounts:
  - name: containerd
    mountPath: /var/lib/containerd
volumes:
- name: containerd
  flexVolume:
    driver: "virtlet/flexvolume_driver"
    options:
      type: qcow2
      capacity: 2048MB