|
74 | 74 | cpu_limit: "(25)" |
75 | 75 | mem_request: "(26)" |
76 | 76 | mem_limit: "(27)" |
77 | | - privileged_pod: (28) |
78 | | - capabilities_pod: (29) |
79 | | -kubeconfig: (30) |
80 | | -kubeconfig_infra: (30) |
| 77 | + egress_ip: |
| 78 | + ip: "(28)" |
| 79 | + node: "(29)" |
| 80 | + privileged_pod: (30) |
| 81 | + capabilities_pod: (31) |
| 82 | +kubeconfig: (32) |
| 83 | +kubeconfig_infra: (32) |
81 | 84 | ``` |
82 | 85 |
|
83 | 86 | 1. "name" - This is the name of the test. Any string value to identify the test. |
@@ -154,6 +157,7 @@ kubeconfig_infra: (30) |
154 | 157 | | 65 | HOST_TO_LOAD_BALANCER_TO_POD_DIFF_NODE | |
155 | 158 | | 66 | HOST_TO_LOAD_BALANCER_TO_HOST_SAME_NODE | |
156 | 159 | | 67 | HOST_TO_LOAD_BALANCER_TO_HOST_DIFF_NODE | |
| 160 | + | 68 | POD_TO_EXTERNAL_EGRESS | |
157 | 161 | 4. "duration" - The duration that each individual test will run for. |
158 | 162 | 5. "pre_provision" - (Optional) Whether to pre-provision all pods and services once before the test run begins, rather than creating and tearing them down per test case. Defaults to false. Takes in "true/false". |
159 | 163 | 6. "name" - This is the connection name. Any string value to identify the connection. |
@@ -186,12 +190,19 @@ kubeconfig_infra: (30) |
186 | 190 | 25. "cpu_limit" - (Optional) CPU limit for server and client pods (e.g. "20m", "1000m"). No CPU limit is set if omitted. |
187 | 191 | 26. "mem_request" - (Optional) Memory request for server and client pods (e.g. "50Mi", "100Mi"). No memory request is set if omitted. |
188 | 192 | 27. "mem_limit" - (Optional) Memory limit for server and client pods (e.g. "100Mi", "200Mi"). No memory limit is set if omitted. |
189 | | -28. "privileged_pod" - (Optional) - Whether to run test pods as privileged. Defaults to false. Can be set at test level or per-node (server/client). |
190 | | -29. "capabilities_pod" - (Optional) - Linux capabilities for test pods. Format: `{"add": ["NET_ADMIN", "SYS_TIME"]}`. Can be set at test level (applies to all pods) or per-node (server/client) for fine-grained control. Per-node settings take precedence over test-level settings. |
191 | | -30. "kubeconfig", "kubeconfig_infra": if set to non-empty strings, then these are the KUBECONFIG |
| 193 | +28. "egress_ip" - (Optional) Configures the connection to use an OVN-Kubernetes EgressIP. Only |
| 194 | + applicable to the `POD_TO_EXTERNAL_EGRESS` (68) test case. See |
| 195 | + [EgressIP Tests](#egressip-tests) below. |
| 196 | + - "ip" - The EgressIP address to assign. Must fall within the egress node's |
| 197 | + `k8s.ovn.org/host-cidrs` subnets. |
| 198 | +29. "node" - (Optional) The node to label as `k8s.ovn.org/egress-assignable` and to assign the |
| 199 | + EgressIP to. Defaults to the connection's client node if unset. |
| 200 | +30. "privileged_pod" - (Optional) - Whether to run test pods as privileged. Defaults to false. Can be set at test level or per-node (server/client). |
| 201 | +31. "capabilities_pod" - (Optional) - Linux capabilities for test pods. Format: `{"add": ["NET_ADMIN", "SYS_TIME"]}`. Can be set at test level (applies to all pods) or per-node (server/client) for fine-grained control. Per-node settings take precedence over test-level settings. |
| 202 | +32. "kubeconfig", "kubeconfig_infra": if set to non-empty strings, then these are the KUBECONFIG |
192 | 203 | files. "kubeconfig_infra" must be set for DPU cluster mode. If both are empty, the configs |
193 | 204 | are detected based on the files we find at /root/kubeconfig.*. |
194 | | -31. "dpu_node_host_label": (Required for DPU mode) The label on DPU nodes that identifies |
| 205 | +33. "dpu_node_host_label": (Required for DPU mode) The label on DPU nodes that identifies |
195 | 206 | which host worker node they belong to. For NVIDIA DPUs, use `provisioning.dpu.nvidia.com/host`. |
196 | 207 |
|
197 | 208 |
|
@@ -354,6 +365,42 @@ tft: |
354 | 365 | - name: "worker-2" |
355 | 366 | ``` |
356 | 367 |
|
| 368 | +## EgressIP Tests |
| 369 | + |
| 370 | +Test case `POD_TO_EXTERNAL_EGRESS` (68) is like `POD_TO_EXTERNAL`, but the client connection is |
| 371 | +configured to use an OVN-Kubernetes [EgressIP](https://github.com/ovn-kubernetes/ovn-kubernetes/blob/master/docs/features/cluster-egress-controls/egress-ip.md) |
| 372 | +and the source IP seen by the server is verified to match. |
| 373 | + |
| 374 | +Configure it via the `egress_ip` field on a connection: |
| 375 | + |
| 376 | +```yaml |
| 377 | +tft: |
| 378 | + - name: "EgressIP Test" |
| 379 | + test_cases: POD_TO_EXTERNAL_EGRESS |
| 380 | + connections: |
| 381 | + - name: "egressip-conn" |
| 382 | + type: "iperf-tcp" |
| 383 | + egress_ip: |
| 384 | + ip: "192.168.1.100" |
| 385 | + node: "worker-1" # optional, defaults to the connection's client node |
| 386 | + server: |
| 387 | + - name: "worker-2" |
| 388 | + client: |
| 389 | + - name: "worker-1" |
| 390 | +``` |
| 391 | + |
| 392 | +- `ip` - The EgressIP address to assign. It must fall within one of the egress node's |
| 393 | + `k8s.ovn.org/host-cidrs` subnets, otherwise the test fails before running. |
| 394 | +- `node` - (Optional) The node to label `k8s.ovn.org/egress-assignable=true` and assign the |
| 395 | + EgressIP to. Defaults to the connection's client node. |
| 396 | + |
| 397 | +Before the test runs, the framework labels the egress node, creates and applies an `EgressIP` |
| 398 | +custom resource (see `manifests/egressip.yaml.j2`) scoped to the test namespace, and polls its |
| 399 | +status for up to 120 seconds until the IP is assigned to a node. After the test runs, the |
| 400 | +server's captured output is parsed for the client's observed source IP (`remote_host` from the |
| 401 | +iperf3 JSON output) and compared against the configured EgressIP; the test fails if they don't |
| 402 | +match. The `EgressIP` resource and the egress node's labels are removed during cleanup. |
| 403 | + |
357 | 404 | ## Environment variables |
358 | 405 |
|
359 | 406 | - `TFT_TEST_IMAGE` specify the test image. Defaults to `ghcr.io/ovn-kubernetes/kubernetes-traffic-flow-tests:latest`. |
|
0 commit comments