Skip to content

Instantly share code, notes, and snippets.

@PhilipSchmid
Last active October 6, 2023 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilipSchmid/d0fb3c906f1ecf3202e2082b3edb58f8 to your computer and use it in GitHub Desktop.
Save PhilipSchmid/d0fb3c906f1ecf3202e2082b3edb58f8 to your computer and use it in GitHub Desktop.
iperf3 Deployment for Kubernetes network performance tests
apiVersion: apps/v1
kind: Deployment
metadata:
name: iperf3
spec:
replicas: 2
selector:
matchLabels:
app: iperf3
template:
metadata:
labels:
app: iperf3
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- iperf3
topologyKey: "kubernetes.io/hostname"
containers:
- name: iperf3
image: nicolaka/netshoot
args: ["sleep","infinity"]

Network Performance Testing on Kubernets

  1. Deploy iperf3: kubectl apply -f deploy-iperf3.yaml
  2. Check Pods, wait until ready: kubectl get pods -o wide
  3. Start the server in the first Pod:
# Exec into the Pod 1:
kubectl exec -it iperf3-<pod-1> -- /bin/bash
# Verify Pod IP:
ip addr
# Start the server:
iperf3 -s -p 12345
  1. Start the client, connecting to the Pod IP of Pod 1:
# Exec into the Pod 2:
kubectl exec -it iperf3-<pod-2> -- /bin/bash
# Start the client:
iperf3 -c <pod-1-ip> -p 12345
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment