cat centos.yaml | grep -ia3 centos-kubevirt-image
volumes:
- name: containervolume
containerDisk:
image: munnaeeebd/centos-kubevirt-image:latest
- name: cloudinitvolume
cloudInitNoCloud:
userData: |-
kubectl get pod | grep centos
virt-launcher-centos-5kfvw 2/2 Running 0 21h
cat cirros-with-cirros-pvc.yaml | grep -ia3 cirros-pvc
volumes:
- name: containervolume
persistentVolumeClaim:
claimName: cirros-pvc
- name: cloudinitvolume
cloudInitNoCloud:
userData: |-
kubectl get pod | grep cirros
virt-launcher-cirros-57x2r 1/1 Running 0 78m
my question is, is it normal that containerDisk create one additional container than PVC
As explained in this GitHub post it is designed behavior.
The compute container contains the QEMU process with running Virtual Machine. The Virtual Machine reads the machine image from mounted volume served from the other volumecontainer.
The second container only provides the data.
With this design you have the benefit of packaging a Virtual Machine in the container image and uploading it to any container registry. Once it is uploaded, it can be used by KubeVirt as container disk.