master
Meliurwen 4 years ago
parent a9ce9c5863
commit 03f5b5e5b8
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 2
      .gitignore
  2. 3
      iperf2.yaml
  3. 10
      iperf3-k8s.sh

2
.gitignore vendored

@ -0,0 +1,2 @@
*.json
*.csv

@ -63,13 +63,12 @@ spec:
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: ReplicaSet kind: DaemonSet
metadata: metadata:
name: iperf2-clients name: iperf2-clients
labels: labels:
app: iperf2-client app: iperf2-client
spec: spec:
replicas: 18
selector: selector:
matchLabels: matchLabels:
app: iperf2-client app: iperf2-client

@ -37,9 +37,17 @@ echo
CLIENTS=$(kubectl get pods -l app=iperf3-client -o name | cut -d'/' -f2) CLIENTS=$(kubectl get pods -l app=iperf3-client -o name | cut -d'/' -f2)
arguments="$*"
timestamp="$(date +"%Y-%m-%d_%H-%M-%S")"
for POD in ${CLIENTS}; do for POD in ${CLIENTS}; do
HOST=$(kubectl get pod "${POD}" -o jsonpath='{.status.hostIP}') HOST=$(kubectl get pod "${POD}" -o jsonpath='{.status.hostIP}')
kubectl exec -it "${POD}" -- iperf3 -c iperf3-server -T "Client on ${HOST}" "$@" if [[ "${arguments}" == *"-J"* ]]; then
kubectl exec -it "${POD}" -- iperf3 -c iperf3-server -T "${HOST}" "$@" > "reports/${timestamp}-${HOST}-${POD}.json"
else
kubectl exec -it "${POD}" -- iperf3 -c iperf3-server -T "${HOST}" "$@"
fi
echo echo
done done

Loading…
Cancel
Save