This repository contains an example of how to verify the Rancher Turtles integration of CAPI providers. At the moment we only require one test that uses a GitOps flow.
For more information about the Rancher Turtles test framework and how to use it, please follow the instructions in the Rancher Turtles repository.
This is a simplified example on how to consume the test framework, to validate Cluster provisioning and import into Rancher.
Running this suite for a CAPI provider will:
- Download all required tools, like
ginkgo
,helm
, and more. - Create a managment cluster in the desired environment type.
- Install Rancher and Turtles with all prerequisites.
- Install additional CAPIProviders.
- Apply a CAPI Cluster template to provision a new Cluster.
- Verify that the CAPI Cluster is initialized correctly.
- Verify that the CAPI Cluster has been successfully imported in Rancher.
- Verify that the CAPI Cluster can be deleted correctly.
- docker
- kind
To run the suite, execute the following command:
make test-e2e
MANAGEMENT_CLUSTER_ENVIRONMENT
environment variable supports the following values:
isolated-kind
(Default)
Provision a local, isolated, management Cluster using kind.kind
Provision a local management Cluster using kind.ngrok-operator
is also deployed to provide external connectivity to Rancher.
Note this requiresNGROK_AUTHTOKEN
,NGROK_API_KEY
, andRANCHER_HOSTNAME
to be set.eks
Provision a EKS Cluster. Note this requireseksctl
to be installed.
Test artifacts will be collected in the ARTIFACTS_FOLDER
, by default _artifacts
.
crust-gather is used to collect all events and logs.
-
Can't find
github.com/rancher/turtles v0.0.0-00010101000000-000000000000
dependency.Import
turtles
directly in yourgo.mod
:require ( github.com/rancher/turtles v0.24.1 github.com/rancher/turtles/test v0.24.1 )
-
Skip test environment cleanup.
In case of test failures it's useful to debug the environment before it's deleted.
You can skip both management cluster and downstream cluster.
For more information please read the documentation.SKIP_RESOURCE_CLEANUP=true SKIP_DELETION_TEST=true make test-e2e
-
The Rancher import test validation is failing.
Failures at the
Waiting for the rancher cluster to have a deployed agent
step, normally indicate that the downstream Cluster has not been initialized correctly. Thecattle-cluster-agent
Pod needs a working cluster, for example with a CNI installed, in order to start. Another common problem is theRANCHER_HOSTNAME
setup. Thecattle-cluster-agent
may not be able to connect to the configured endpoint, if the Rancher Ingress was not configured correctly, depending on theMANAGEMENT_CLUSTER_ENVIRONMENT
type.