...

Text file src/k8s.io/kubernetes/test/e2e/testing-manifests/auth/encrypt/README.md

Documentation: k8s.io/kubernetes/test/e2e/testing-manifests/auth/encrypt

     1# Encryption at rest testing manifests
     2
     3This 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
     7The `run-e2e.sh` script does the following:
     8
     91. Installs required prerequisites: [`kind`](https://sigs.k8s.io/kind) and [`kubetest2`](https://github.com/kubernetes-sigs/kubetest2).
    102. Builds the `e2e.test`, `ginkgo` and `kubectl` binaries.
    113. Creates local registry if not already present. This registry is used to push the kms mock plugin image.
    124. Build and push the kms mock plugin image to the local registry.
    135. Connect local registry to kind network so that kind cluster created using `kubetest2` in prow CI job can pull the kms mock plugin image.
    146. Create kind cluster using `kubetest2` and run e2e tests.
    157. Collect logs and metrics from kind cluster.
    168. Delete kind cluster.
    17
    18The 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
    28Run the script locally with the following command:
    29
    30```bash
    31test/e2e/testing-manifests/auth/encrypt/run-e2e.sh
    32```
    33
    34### Create a local cluster with mock KMS provider
    35
    36The `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
    39SKIP_RUN_TESTS=true SKIP_DELETE_CLUSTER=true SKIP_COLLECT_LOGS=true test/e2e/testing-manifests/auth/encrypt/run-e2e.sh
    40```
    41
    42Delete the cluster after use:
    43
    44```bash
    45kind delete cluster --name=kms
    46```

View as plain text