This document describes the integration and extension mechanisms to exercise VM related code. The primary goals are to:
Note: We currently use mock/simulated VMs for testing purposes. In the future, the testing might switch to utilize actual compute instances from different providers.
Scenarios in which one might want to add a VM test in this doc:
Most integration tests in Istio use the Echo application. To test connectivity, security and telemetry for a VM in the mesh, we deploy an instance of the Echo application as a VM resource. A VM Echo instance will simulate a VM, disabling kube-dns, Service Account mount, etc. For more information around VM onboarding, refer to this doc.
To deploy an echo instance as a VM
DeployAsVm
to be true in echo.Config
. We used DefaultVMImage in the example.For example,
ports := []echo.Port{
{
Name: "http",
Protocol: protocol.HTTP,
InstancePort: 8090,
ServicePort: 8090,
},
}
echo.Config{
Service: "vm",
Namespace: "virtual-machine",
Ports: ports,
Pilot: p,
DeployAsVM: true,
VMImage: vm.DefaultVMImage
}
The default image referenced with DefaultVMImage
from vm
package should be used for all pre-submit tests since this is the only image available in the pre-submit stage. Using additional images are only possible in post-submit tests as shown in the next section. A complete list of supported additional images can be found in vm_test.go
. If VMImage
is not provided while DeployAsVM
is on, it will default the Docker image to be DefaultVMImage
.
We list the supported OSes in vm_test.go and the images will be created in prow/lib.sh.
To add additional supported images for testing:
prow/lib.sh
by adding images to the targets to build images for CI/CD.util.go
to be tested in PostSubmit jobs.DefaultVMImage
in util.go
in case the default supported image changes.Note: We will only build default image for pre-submit jobs and build all others for post-submit jobs to save time in CI/CD.
Detailed steps to onboard a VM could be found in VM onboarding documentation.
Currently, these steps are pre-configured and built in the deployment. However, each of them could be tested by tweaking the VM deployment template.