apiVersion: apps/v1 kind: Deployment metadata: name: iperf3-server-deployment labels: app: iperf3-server spec: replicas: 10 selector: matchLabels: app: iperf3-server template: metadata: labels: app: iperf3-server spec: affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: matchExpressions: - key: kubernetes.io/role operator: In values: - master tolerations: - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule containers: - name: iperf3-server image: networkstatic/iperf3 args: ['-s'] ports: - containerPort: 5201 protocol: TCP name: server-tcp - containerPort: 5201 protocol: UDP name: server-udp terminationGracePeriodSeconds: 0 --- apiVersion: v1 kind: Service metadata: name: iperf3-server spec: selector: app: iperf3-server ports: - protocol: TCP port: 5201 name: crappy-tcp targetPort: server-tcp - protocol: UDP port: 5201 name: crappy-udp targetPort: server-udp --- apiVersion: apps/v1 kind: DaemonSet metadata: name: iperf3-clients labels: app: iperf3-client spec: selector: matchLabels: app: iperf3-client template: metadata: labels: app: iperf3-client spec: tolerations: - key: node-role.kubernetes.io/master operator: Exists effect: NoSchedule containers: - name: iperf3-client image: networkstatic/iperf3 command: ['/bin/sh', '-c', 'sleep infinity'] # To benchmark manually: kubectl exec iperf3-clients-jlfxq -- /bin/sh -c 'iperf3 -c iperf3-server' terminationGracePeriodSeconds: 0