E2E Tests
These tests spin up a temporary minikube cluster, deploy the latest built controller, and expose kubernetes-dashboard through Cloudflare Tunnel. The process creates real DNS records and Cloudflare Tunnel configurations, so be sure to use a dedicated test domain/tunnel.
Prerequisites
docker and minikube are installed and can access local container images
helm is available (used to install the controller via Helm Chart)
kubectl and jq are available for diagnostic collection
.env.e2e is located in the repository root, containing:
CLOUDFLARE_API_TOKEN
CLOUDFLARE_ACCOUNT_ID
CLOUDFLARE_TUNNEL_NAME
E2E_BASE_DOMAIN: the root domain under a Cloudflare Zone (e.g., strrl.cloud), the test will generate unique subdomains based on it
- (Optional) Chrome / Chromium installed locally for capturing dashboard screenshots; if missing, only a warning will be logged.
The E2E_CONTROLLER_IMAGE environment variable specifies the controller image used for testing, with a default value of cloudflare-tunnel-ingress-controller:e2e.
During test execution, random subdomains will be generated based on E2E_BASE_DOMAIN (e.g., cf-dashboard-<timestamp>.strrl.cloud), and Cloudflare DNS records and tunnel rules will be created accordingly.
Execution
make e2e
make e2e will first build E2E_CONTROLLER_IMAGE, then run test/e2e/e2e.sh. During the test:
- Start a uniquely named minikube profile;
- Validate the Cloudflare Token;
- Install the controller via Helm Chart;
- Enable
dashboard and metrics-server addons, and create an Ingress;
- Poll Cloudflare until the Dashboard is accessible via HTTPS;
- If available, capture a screenshot of the Dashboard page and save it to
test/e2e/artifacts/.
When the test exits, e2e.sh collects cluster resources and logs into test/e2e/artifacts/cluster-dump, then deletes the temporary kubeconfig and minikube profile. If cleanup is interrupted, you can manually execute:
minikube delete -p <profile>