kubernetes/test/e2e/dra
Patrick Ohly 1847d5b1a2 DRA e2e+integration: test ResourceSlice controller
The "create 100 slices" E2E sometimes flaked with timeouts (e.g. 95 out of 100
slices created). It created too much load for an E2E test.

The same test now uses ktesting as API, which makes it possible to run it as
integration test with the original 100 slices and with more moderate 10 slices
as E2E test.

(cherry picked from commit c47ad64820)
2026-01-16 08:10:37 +01:00
..
test-driver [DRA] Add ShareID to kubelet plugin API 2025-11-06 03:28:35 +09:00
utils DRA e2e: make driver deployment possible in Go unit tests 2026-01-16 07:53:00 +01:00
deploy_device_plugin.go DRA: e2e: test extended resources after device plugin uninstall 2025-10-27 16:24:35 +02:00
dra.go DRA e2e+integration: test ResourceSlice controller 2026-01-16 08:10:37 +01:00
kind.yaml DRA: log more information 2025-12-16 09:58:05 +01:00
OWNERS DRA: add wg/device-management label automatically 2024-10-28 16:36:04 +01:00
README.md Make golang::setup-env turn on workspaces 2024-02-29 22:07:42 -08:00

Overview

The tests in this directory cover dynamic resource allocation support in Kubernetes. They do not test the correct behavior of arbitrary dynamic resource allocation drivers.

If such a driver is needed, then the in-tree test/e2e/dra/test-driver is used, with a slight twist: instead of deploying that driver directly in the cluster, the necessary sockets for interaction with kubelet (registration and dynamic resource allocation) get proxied into the e2e.test binary. This reuses the work done for CSI mock testing. The advantage is that no separate images are needed for the test driver and that the e2e test has full control over all gRPC calls, in case that it needs that for operations like error injection or checking calls.

Cluster setup preparation

The container runtime must support CDI. CRI-O supports CDI starting from release 1.23, Containerd supports CDI starting from release 1.7. To bring up a Kind cluster with Containerd, two things are needed:

NB: Kind switched to use worker-node base image with Containerd 1.7 by default starting from release 0.20, build kind from latest main branch sources or use Kind release binary 0.20 or later.

Build kind node image

After building Kubernetes, in Kubernetes source code tree build new node image:

$ kind build node-image --image dra/node:latest $(pwd)

Bring up a Kind cluster

$ kind create cluster --config test/e2e/dra/kind.yaml --image dra/node:latest

Run tests

  • Build ginkgo
$ make ginkgo
  • Run e2e tests for the Dynamic Resource Allocation feature:
$ KUBECONFIG=~/.kube/config _output/bin/ginkgo -p -v -focus=Feature:DynamicResourceAllocation ./test/e2e