Tekton Pipelines are CI/CD-style pipelines for Kubernetes. This repository provides KubeVirt-specific Tekton tasks, which focus on:
- Creating and managing resources (VMs, DataVolumes, DataSources)
- Executing commands in VMs
- Manipulating disk images with libguestfs tools
- Extracting and uploading disk images from multiple sources (VM, VMSnapshot, PVC)
In order to install the KubeVirt Tekton tasks in the active namespace you need to apply the following manifest. You have to repeat this for every namespace in which you'd like to run the tasks.
VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt-tekton-tasks/releases | \
jq '.[] | select(.prerelease==false) | .tag_name' | sort -V | tail -n1 | tr -d '"')
kubectl apply -f "https://github.com/kubevirt/kubevirt-tekton-tasks/releases/download/${VERSION}/kubevirt-tekton-tasks.yaml"
Visit RBAC permissions for running the tasks if the pipeline needs to create/access resources (VMs, PVCs, etc.) in a different namespace other than the one the pipeline runs in.
copy-template, modify-vm-template and create-vm-from-template tasks are deprecated and will be removed in future versions. These tasks based on templates will be replaced with create-vm task with enhancements related to instance types.
- execute-in-vm: execute commands over SSH
- cleanup-vm: execute commands and/or stop/delete VMs
- disk-virt-customize: execute virt-customize commands in PVCs
- disk-virt-sysprep: execute virt-sysprep commands in PVCs
- modify-windows-iso-file - modifies windows iso (replaces prompt bootloader with no-promt bootloader) and replaces original iso in PVC with updated one.
- disk-uploader - Extracts disk image and uploads it to a container registry.
Downloads a Windows ISO file into a PVC and automatically installs Windows 10, 11 or Server 2k22 with EFI enabled by using a custom Answer file into a new base DataVolume. Supported Windows versions: Windows 10, 11, Server 2k22
Applies customizations to an existing Windows 10, 11, Server 2k22 installation by using a custom Answer file and creates a new base DataVolume. Supported Windows versions: Windows 10, 11, Server 2k22
Extracts disk image from one of the sources (VM, VMSnapshot, PVC) and uploads to the container registry.
Unit Tester Pipeline - Unmaintained
Good unit tests are detached from the operating system and can run everywhere. However, this is not always the case. Your tests may require access to entire operating system, or run as root, or need a specific kernel.
This example shows how you can run your tests in your VM of choice.
The pipeline creates a VM, connects to it over SSH and runs tests inside it.
It also showcases the finally
construct.
Server Deployer Pipeline - Unmaintained
For complex application server deployments it might be easier to start the server as is in a VM rather than converting it to cloud-native application.
This example shows how you can initialize/modify a PVC and deploy such application in a VM.
Virt-sysprep Updater Pipeline - Unmaintained
Virt-sysprep can be used for preparing VM images which can be then used as base images for other VMs.
This example shows how you can update an operating system and seal VM's image by using virt-customize. Then, a VM is created from such image.
See Getting Started for the environment setup and development workflow.