cilium-cli icon indicating copy to clipboard operation
cilium-cli copied to clipboard

Add CLI argument for specifying CiliumNetworkPolicies in Performance Tests

Open learnitall opened this issue 3 years ago â€ĸ 0 comments

Introduces the CLI argument --perf-policy-file, which allows for users to specify custom CiliumNetworkPolicies when running performance tests, for use in demos or other situations where the something besides the default is desired.

Example usage:

❯ ./cilium connectivity test --perf --perf-duration=1s --perf-policy-file=./my-policy.yaml --verbose
...

[=] Test [network-perf]
â„šī¸  📜 Applying CiliumNetworkPolicy 'my-policy' to namespace 'cilium-test'..
[-] Scenario [network-perf/perf-pod-to-pod]
[.] Action [network-perf/perf-pod-to-pod/netperf: cilium-test/perf-client-668f667cd5-kbwsr (10.244.3.161) -> cilium-test/perf-server-84bf59fcf-q9txx (10.244.3.75:5201)]
[.] Action [network-perf/perf-pod-to-pod/netperf: cilium-test/perf-client-other-node-5699666544-cp2lw (10.244.2.189) -> cilium-test/perf-server-84bf59fcf-q9txx (10.244.3.75:5201)]
â„šī¸  📜 Deleting CiliumNetworkPolicy 'my-policy' from namespace 'cilium-test'..

đŸ”Ĩ Performance Test Summary
-----------------------------------------------------------------------------------------------------------------------------
📋 Scenario                                           | Test            | Num Samples     | Duration        | Avg value
-----------------------------------------------------------------------------------------------------------------------------
📋 perf-client-other-node-5699666544-cp2lw            | UDP_STREAM      | 1               | 1s              | 800.36 (Mb/s)
📋 perf-client-668f667cd5-kbwsr                       | TCP_RR          | 1               | 1s              | 45366.61 (OP/s)
📋 perf-client-668f667cd5-kbwsr                       | TCP_STREAM      | 1               | 1s              | 2113.75 (Mb/s)
📋 perf-client-668f667cd5-kbwsr                       | UDP_RR          | 1               | 1s              | 44847.80 (OP/s)
📋 perf-client-668f667cd5-kbwsr                       | UDP_STREAM      | 1               | 1s              | 2594.78 (Mb/s)
📋 perf-client-other-node-5699666544-cp2lw            | TCP_RR          | 1               | 1s              | 22060.88 (OP/s)
📋 perf-client-other-node-5699666544-cp2lw            | TCP_STREAM      | 1               | 1s              | 1127.11 (Mb/s)
📋 perf-client-other-node-5699666544-cp2lw            | UDP_RR          | 1               | 1s              | 25126.35 (OP/s)
-----------------------------------------------------------------------------------------------------------------------------

✅ All 1 tests (2 actions) successful, 0 tests skipped, 0 scenarios skipped.

If a given policy file cannot be read, then an error is thrown and the test is cancelled:

❯ ./cilium connectivity test --perf --perf-duration=1s --perf-policy-file=doesnotexist.yaml --verbose
...
â„šī¸  Cilium version: 1.11.3
connectivity test failed: unable to read user given policy file 'doesnotexist.yaml' for performance tests: open doesnotexist.yaml: no such file or directory

Signed-off-by: Ryan Drew [email protected]

learnitall avatar May 04 '22 16:05 learnitall