|
2 | 2 |
|
3 | 3 | The project includes automated tests for testing the Ingress Controller in a Kubernetes cluster. The tests are written in Python3 and use the pytest framework.
|
4 | 4 |
|
5 |
| -Below you will find the instructions on how to run the tests against a Minikube cluster. However, you are not limited to Minikube and can use other types of Kubernetes clusters. See the [Configuring the Tests](#configuring-the-tests) section to find out about various configuration options. |
| 5 | +Below you will find the instructions on how to run the tests against a Minikube and kind clusters. However, you are not limited to those options and can use other types of Kubernetes clusters. See the [Configuring the Tests](#configuring-the-tests) section to find out about various configuration options. |
6 | 6 |
|
7 | 7 | ## Running Tests in Minikube
|
8 | 8 |
|
@@ -36,22 +36,47 @@ Run the tests:
|
36 | 36 | ```
|
37 | 37 | The tests will use the Ingress Controller for NGINX with the default *nginx/nginx-ingress:edge* image. See the section below to learn how to configure the tests including the image and the type of NGINX -- NGINX or NGINX Plus.
|
38 | 38 |
|
| 39 | +## Running Tests in Kind |
| 40 | + |
| 41 | +### Prerequisites: |
| 42 | + |
| 43 | +* [Kind](https://kind.sigs.k8s.io/). |
| 44 | +* Docker. |
| 45 | + |
| 46 | +#### Step 1 - Create a Kind Cluster |
| 47 | + |
| 48 | +```bash |
| 49 | +$ make create-kind-cluster |
| 50 | +``` |
| 51 | + |
| 52 | +#### Step 2 - Run the Tests |
| 53 | + |
| 54 | +**Note**: if you have the Ingress Controller deployed in the cluster, please uninstall it first, making sure to remove its namespace and RBAC resources. |
| 55 | + |
| 56 | +Run the tests in Docker: |
| 57 | +```bash |
| 58 | +$ cd tests |
| 59 | +$ make build |
| 60 | +$ make run-tests-in-kind |
| 61 | +``` |
| 62 | +The tests will use the Ingress Controller for NGINX with the default *nginx/nginx-ingress:edge* image. See the section below to learn how to configure the tests including the image and the type of NGINX -- NGINX or NGINX Plus. |
| 63 | + |
39 | 64 | ## Configuring the Tests
|
40 | 65 |
|
41 | 66 | The table below shows various configuration options for the tests. If you use Python3 to run the tests, use the command-line arguments. If you use Docker, use the [Makefile](Makefile) variables.
|
42 | 67 |
|
43 | 68 |
|
44 | 69 | | Command-line Argument | Makefile Variable | Description | Default |
|
45 | 70 | | :----------------------- | :------------ | :------------ | :----------------------- |
|
46 |
| -| `--context` | `CONTEXT` | The context to use in the kubeconfig file. | `""` | |
| 71 | +| `--context` | `CONTEXT`, not supported by `run-tests-in-kind` target. | The context to use in the kubeconfig file. | `""` | |
47 | 72 | | `--image` | `BUILD_IMAGE` | The Ingress Controller image. | `nginx/nginx-ingress:edge` |
|
48 | 73 | | `--image-pull-policy` | `PULL_POLICY` | The pull policy of the Ingress Controller image. | `IfNotPresent` |
|
49 | 74 | | `--deployment-type` | `DEPLOYMENT_TYPE` | The type of the IC deployment: deployment or daemon-set. | `deployment` |
|
50 | 75 | | `--ic-type` | `IC_TYPE` | The type of the Ingress Controller: nginx-ingress or nginx-ingress-plus. | `nginx-ingress` |
|
51 |
| -| `--service` | `SERVICE` | The type of the Ingress Controller service: nodeport or loadbalancer. | `nodeport` | |
52 |
| -| `--node-ip` | `NODE_IP` | The public IP of a cluster node. Not required if you use the loadbalancer service (see --service argument). | `""` | |
| 76 | +| `--service` | `SERVICE`, not supported by `run-tests-in-kind` target. | The type of the Ingress Controller service: nodeport or loadbalancer. | `nodeport` | |
| 77 | +| `--node-ip` | `NODE_IP`, not supported by `run-tests-in-kind` target. | The public IP of a cluster node. Not required if you use the loadbalancer service (see --service argument). | `""` | |
53 | 78 | | `--kubeconfig` | `N/A` | An absolute path to a kubeconfig file. | `~/.kube/config` or the value of the `KUBECONFIG` env variable |
|
54 |
| -| `N/A` | `KUBE_CONFIG_FOLDER` | A path to a folder with a kubeconfig file. | `~/.kube/` | |
| 79 | +| `N/A` | `KUBE_CONFIG_FOLDER`, not supported by `run-tests-in-kind` target. | A path to a folder with a kubeconfig file. | `~/.kube/` | |
55 | 80 | | `--show-ic-logs` | `SHOW_IC_LOGS` | A flag to control accumulating IC logs in stdout. | `no` |
|
56 | 81 | | `N/A` | `PYTEST_ARGS` | Any additional pytest command-line arguments (i.e `-m "smoke"`) | `""` |
|
57 | 82 |
|
|
0 commit comments