k8s.io/kubernetes@v1.29.3/test/e2e/testing-manifests/auth/encrypt/README.md (about)

     1  # Encryption at rest testing manifests
     2  
     3  This directory contains manifests for testing encryption at rest with a [mock KMS provider](../../../../../staging/src/k8s.io/kms/internal/plugins/_mock). The mock KMS provider is a fake KMS provider that does not communicate with any external KMS. It is used for testing purposes only.
     4  
     5  ## run-e2e.sh
     6  
     7  The `run-e2e.sh` script does the following:
     8  
     9  1. Installs required prerequisites: [`kind`](https://sigs.k8s.io/kind) and [`kubetest2`](https://github.com/kubernetes-sigs/kubetest2).
    10  2. Builds the `e2e.test`, `ginkgo` and `kubectl` binaries.
    11  3. Creates local registry if not already present. This registry is used to push the kms mock plugin image.
    12  4. Build and push the kms mock plugin image to the local registry.
    13  5. Connect local registry to kind network so that kind cluster created using `kubetest2` in prow CI job can pull the kms mock plugin image.
    14  6. Create kind cluster using `kubetest2` and run e2e tests.
    15  7. Collect logs and metrics from kind cluster.
    16  8. Delete kind cluster.
    17  
    18  The script extracts runtime configurations through environment variables. The following environment variables are supported:
    19  
    20  | Variable              | Description                                                                     | Default |
    21  | --------------------- | ------------------------------------------------------------------------------- | ------- |
    22  | `SKIP_DELETE_CLUSTER` | If set to `true`, the kind cluster will not be deleted after the tests are run. | `false` |
    23  | `SKIP_RUN_TESTS`      | If set to `true`, the tests will not be run.                                    | `false` |
    24  | `SKIP_COLLECT_LOGS`   | If set to `true`, the logs and metrics will not be collected.                   | `false` |
    25  
    26  ### Running the script locally
    27  
    28  Run the script locally with the following command:
    29  
    30  ```bash
    31  test/e2e/testing-manifests/auth/encrypt/run-e2e.sh
    32  ```
    33  
    34  ### Create a local cluster with mock KMS provider
    35  
    36  The `run-e2e.sh` script can be used to create a local cluster with mock KMS provider. The following command creates a local cluster with mock KMS provider:
    37  
    38  ```bash
    39  SKIP_RUN_TESTS=true SKIP_DELETE_CLUSTER=true SKIP_COLLECT_LOGS=true test/e2e/testing-manifests/auth/encrypt/run-e2e.sh
    40  ```
    41  
    42  Delete the cluster after use:
    43  
    44  ```bash
    45  kind delete cluster --name=kms
    46  ```