Skip to content

Instantly share code, notes, and snippets.

@aojea
Last active August 27, 2023 14:47
Show Gist options
  • Save aojea/2711b6fd2fc3ebe071051b312d4f4f1c to your computer and use it in GitHub Desktop.
Save aojea/2711b6fd2fc3ebe071051b312d4f4f1c to your computer and use it in GitHub Desktop.
netperf network performance test kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: netperf-server
labels:
app: netperf-server
spec:
replicas: 1
selector:
matchLabels:
app: netperf-server
template:
metadata:
labels:
app: netperf-server
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- netperf-client
topologyKey: "kubernetes.io/hostname"
containers:
- name: netperf-server
image: cilium/netperf
ports:
- containerPort: 12865
name: server
terminationGracePeriodSeconds: 0
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: netperf-server-host
labels:
app: netperf-server-host
spec:
replicas: 1
selector:
matchLabels:
app: netperf-server
template:
metadata:
labels:
app: netperf-server
spec:
hostNetwork: true
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- netperf-client
topologyKey: "kubernetes.io/hostname"
containers:
- name: netperf-server
image: cilium/netperf
ports:
- containerPort: 12865
name: server
terminationGracePeriodSeconds: 0
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: netperf-client
labels:
app: netperf-client
spec:
replicas: 1
selector:
matchLabels:
app: netperf-client
template:
metadata:
labels:
app: netperf-client
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- netperf-server
topologyKey: "kubernetes.io/hostname"
containers:
- name: netperf-client
image: networkstatic/netperf
command: ['/bin/sh', '-c', 'sleep infinity']
terminationGracePeriodSeconds: 0
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: netperf-client-host
labels:
app: netperf-client-host
spec:
replicas: 1
selector:
matchLabels:
app: netperf-client
template:
metadata:
labels:
app: netperf-client
spec:
hostNetwork: true
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- netperf-server
topologyKey: "kubernetes.io/hostname"
containers:
- name: netperf-client
image: networkstatic/netperf
command: ['/bin/sh', '-c', 'sleep infinity']
terminationGracePeriodSeconds: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment