Skip to content

Commit

Permalink
Refactor drivers code (cloud-bulldozer#131)
Browse files Browse the repository at this point in the history
* Refactor drivers code

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

* Update docs

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

* Fix hostnet arguments

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

* Fixing netperf flags

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

* Fix hostNetwork code

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

* Remove binary from clean target

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

* Require one driver at least

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

* Inform about k8s-netperf version

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>

---------

Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 committed Feb 22, 2024
1 parent 842a364 commit c99337e
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 197 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RHEL_VERSION = ubi9
CONTAINER ?= podman
CONTAINER_BUILD ?= podman build --force-rm
CONTAINER_NS ?= quay.io/cloud-bulldozer/netperf
SOURCES := $(shell find . -type f -name "*.go")

# k8s-netperf version
GIT_COMMIT = $(shell git rev-parse HEAD)
Expand Down Expand Up @@ -49,7 +50,7 @@ gha-push:
@echo "Pushing Container Images & manifest"
$(CONTAINER) manifest push $(CONTAINER_NS)-manifest:latest $(CONTAINER_NS)

clean: $(BIN_PATH)
clean:
rm -rf bin/$(ARCH)

$(BIN_PATH): $(SOURCES)
Expand Down
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Running Networking Performance Tests against K8s
| netperf | TCP_CRR | Working | No|

## Setup

```shell
$ git clone http://github.com/cloud-bulldozer/k8s-netperf
$ cd k8s-netperf
Expand All @@ -37,7 +38,7 @@ $ kubectl create ns netperf
$ kubectl create sa -n netperf netperf
```

If you run with `-all`, you will need to allow `hostNetwork` for the netperf sa.
If you run with `--all`, you will need to allow `hostNetwork` for the netperf sa.

Example
```shell
Expand All @@ -55,21 +56,25 @@ Usage:
k8s-netperf [flags]

Flags:
--across Place the client and server across availability zones
--all Run all tests scenarios - hostNet and podNetwork (if possible)
--clean Clean-up resources created by k8s-netperf (default true)
--config string K8s netperf Configuration File (default "netperf.yml")
--debug Enable debug log
-h, --help help for k8s-netperf
--iperf Use iperf3 as load driver (along with netperf)
--uperf Use uperf as load driver (along with netperf)
--netperf Use netperf as load driver (default true)
--iperf Use iperf3 as load driver
--uperf Use uperf as load driver
--clean Clean-up resources created by k8s-netperf (default true)
--json Instead of human-readable output, return JSON to stdout
--local Run network performance tests with Server-Pods/Client-Pods on the same Node
--metrics Show all system metrics retrieved from prom
--across Place the client and server across availability zones
--all Run all tests scenarios - hostNet and podNetwork (if possible)
--debug Enable debug log
--prom string Prometheus URL
--uuid string User provided UUID
--search string OpenSearch URL, if you have auth, pass in the format of https://user:pass@url:port
--metrics Show all system metrics retrieved from prom
--tcp-tolerance float Allowed %diff from hostNetwork to podNetwork, anything above tolerance will result in k8s-netperf exiting 1. (default 10)
--uuid string User provided UUID
--version k8s-netperf version
-h, --help help for k8s-netperf


```
- `--across` will force the client to be across availability zones from the server
Expand All @@ -79,12 +84,14 @@ Flags:
- When using `--prom` with a non-openshift clsuter, it will be necessary to pass the prometheus URL.
- `--metrics` will enable displaying prometheus captured metrics to stdout. By default they will be written to a csv file.
- `--iperf` will enable the iperf3 load driver for any stream test (TCP_STREAM, UDP_STREAM). iperf3 doesn't have a RR or CRR test-type.
- `--uperf` will enable the uperf load driver for any stream test (TCP_STREAM, UDP_STREAM). uperf doesn't have CRR test-type.
> *Note: With OpenShift, we attempt to discover the OpenShift route. If that route is not reachable, it might be required to `port-forward` the service and pass that via the `--prom` option.*
### Config file
#### Config File v2
The v2 config file will be executed in the order the tests are presented in the config file.
```yml
tests :
- TCPStream: # Place-holder of a test name
Expand Down
Loading

0 comments on commit c99337e

Please sign in to comment.