k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/test/e2e/dra/README.md (about)

     1  # Overview
     2  
     3  The tests in this directory cover dynamic resource allocation support in
     4  Kubernetes. They do not test the correct behavior of arbitrary dynamic resource
     5  allocation drivers.
     6  
     7  If such a driver is needed, then the in-tree test/e2e/dra/test-driver is used,
     8  with a slight twist: instead of deploying that driver directly in the cluster,
     9  the necessary sockets for interaction with kubelet (registration and dynamic
    10  resource allocation) get proxied into the e2e.test binary. This reuses the work
    11  done for CSI mock testing. The advantage is that no separate images are needed
    12  for the test driver and that the e2e test has full control over all gRPC calls,
    13  in case that it needs that for operations like error injection or checking
    14  calls.
    15  
    16  ## Cluster setup preparation
    17  
    18  The container runtime must support CDI. CRI-O supports CDI starting from release 1.23,
    19  Containerd supports CDI starting from release 1.7. To bring up a Kind cluster with Containerd,
    20  two things are needed:
    21  - [build binaries from Kubernetes source code tree](https://github.com/kubernetes/community/blob/master/contributors/devel/development.md#building-kubernetes)
    22  - [Kind](https://github.com/kubernetes-sigs/kind)
    23  
    24  > NB: Kind switched to use worker-node base image with Containerd 1.7 by default starting from
    25  release 0.20, build kind from latest main branch sources or use Kind release binary 0.20 or later.
    26  
    27  ### Build kind node image
    28  
    29  After building Kubernetes, in Kubernetes source code tree build new node image:
    30  ```bash
    31  $ kind build node-image --image dra/node:latest $(pwd)
    32  ```
    33  
    34  ## Bring up a Kind cluster
    35  ```bash
    36  $ kind create cluster --config test/e2e/dra/kind.yaml --image dra/node:latest
    37  ```
    38  
    39  
    40  ## Run tests
    41  
    42  - Build ginkgo
    43  
    44  ```bash
    45  $ make ginkgo
    46  ```
    47  
    48  - Run e2e tests for the `Dynamic Resource Allocation` feature:
    49  
    50  ```bash
    51  $ KUBECONFIG=~/.kube/config _output/bin/ginkgo -p -v -focus=Feature:DynamicResourceAllocation ./test/e2e
    52  ```