Skip to content

Commit 096d093

Browse files
Merge pull request #309 from josecastillolema/eip-readme
EgressIP testing docs
2 parents fac1803 + c977e57 commit 096d093

1 file changed

Lines changed: 55 additions & 8 deletions

File tree

README.md

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ tft:
7474
cpu_limit: "(25)"
7575
mem_request: "(26)"
7676
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)
8184
```
8285

8386
1. "name" - This is the name of the test. Any string value to identify the test.
@@ -154,6 +157,7 @@ kubeconfig_infra: (30)
154157
| 65 | HOST_TO_LOAD_BALANCER_TO_POD_DIFF_NODE |
155158
| 66 | HOST_TO_LOAD_BALANCER_TO_HOST_SAME_NODE |
156159
| 67 | HOST_TO_LOAD_BALANCER_TO_HOST_DIFF_NODE |
160+
| 68 | POD_TO_EXTERNAL_EGRESS |
157161
4. "duration" - The duration that each individual test will run for.
158162
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".
159163
6. "name" - This is the connection name. Any string value to identify the connection.
@@ -186,12 +190,19 @@ kubeconfig_infra: (30)
186190
25. "cpu_limit" - (Optional) CPU limit for server and client pods (e.g. "20m", "1000m"). No CPU limit is set if omitted.
187191
26. "mem_request" - (Optional) Memory request for server and client pods (e.g. "50Mi", "100Mi"). No memory request is set if omitted.
188192
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
192203
files. "kubeconfig_infra" must be set for DPU cluster mode. If both are empty, the configs
193204
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
195206
which host worker node they belong to. For NVIDIA DPUs, use `provisioning.dpu.nvidia.com/host`.
196207

197208

@@ -354,6 +365,42 @@ tft:
354365
- name: "worker-2"
355366
```
356367

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+
357404
## Environment variables
358405

359406
- `TFT_TEST_IMAGE` specify the test image. Defaults to `ghcr.io/ovn-kubernetes/kubernetes-traffic-flow-tests:latest`.

0 commit comments

Comments
 (0)