Search code examples
dockerkubernetesgitlabvirtual-machinevirtualization

How to host VM images in GitLab docker registry


I would like to know if it is somehow possible to use the GitLab Docker registry to host VM images as well? My use case is the following:

We have a working GitLab CE installation. It is already possible to host Docker images in the Docker registry. We are using kubevirt to deploy VMs to kubernetes. The GitLab registry integrates nicely with Kubernetes, such that it is possible to pull Docker images from our GitLab registry and authentication is handled with a Kubernetes secret resource and imagePullSecrets. Now it would be great, if it was possible for Kubernetes to pull VM images to be deployed via kubevirt as well.

Any thoughts on this or other possible solutions are highly appreciated.


Solution

  • After a little investigation I found a solution using GitLab and the Containerzied Data Importer. Basically, you create a Docker image that wraps your VM image and push this to GitLab as described here. By using the custom DataVolume resource, kubevirt is able to pull those images and create persistent volumes for use as VM disks.