apiVersion: batch/v1
kind: Job
metadata:
name: iperf-test
spec:
completions: 4
parallelism: 4
template:
spec:
restartPolicy: Never
containers:
- name: iperf-client
image: networkstatic/iperf3
command: ["/bin/sh", "-c"]
args:
- |
TARGETS=("10.0.0.11" "10.0.0.12" "10.0.0.13" "10.0.0.14");
TARGET=${TARGETS[$((JOB_COMPLETION_INDEX))]};
echo "Testing $TARGET";
iperf3 -c $TARGET -t 30 -J > /results/iperf_${TARGET}.json
env:
- name: JOB_COMPLETION_INDEX
valueFrom:
fieldRef:
fieldPath: metadata.annotations['batch.kubernetes.io/job-completion-index']
volumeMounts:
- name: results
mountPath: /results
volumes:
- name: results
emptyDir: {}