-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UDP Service LB examples and scripts update (#155)
* Adding examples for udp service LB Signed-off-by: Sharanakumar <[email protected]> * scripts update - copy json files to ACC with split mode Signed-off-by: Sharanakumar <[email protected]> * README update Signed-off-by: Sharanakumar <[email protected]> --------- Signed-off-by: Sharanakumar <[email protected]>
- Loading branch information
1 parent
ef5972d
commit 1157005
Showing
10 changed files
with
134 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
## Details | ||
This directory includes a service manifest file and a script to run the tests. | ||
- iperf_tcp.yaml | ||
- This file has the manifests to create an iperf server and a client. | ||
- The iperf server is started as a service with two backend endpoints and | ||
- This file has the manifests to create an iperf tcp server and a client. | ||
- The iperf server is started as a tcp service with two backend endpoints and | ||
the iperf client is started as a daemonset. | ||
- run.sh | ||
- Script to run the test. The script sends 100 client requests to the iperf server. | ||
- Script to run the test. The script sends 100 client tcp requests to the iperf server. | ||
- clean_up.sh | ||
- Script to delete the server and client pods. | ||
|
||
## How to Run | ||
- Create the iperf server and client | ||
- # kubectl create -f iperf_tcp.yaml | ||
- Run the tests | ||
- # ./run.sh <client-pod-name> | ||
- # ./run.sh \<client-pod-name\> | ||
- Delete iperf server and client pods | ||
- # ./clean_up.sh | ||
|
||
## iperf docker image details | ||
- https://github.com/lroktu/iperf | ||
- https://hub.docker.com/r/lroktu/iperf |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Details | ||
This directory includes a service manifest file and a script to run the tests. | ||
- iperf_udp.yaml | ||
- This file has the manifests to create an iperf udp server and a client. | ||
- The iperf server is started as a udp service with two backend endpoints and | ||
the iperf client is started as a daemonset. | ||
- run.sh | ||
- Script to run the test. The script sends 100 client udp requests to the iperf server. | ||
- clean_up.sh | ||
- Script to delete the server and client pods. | ||
|
||
## How to Run | ||
- Create the iperf server and client | ||
- # kubectl create -f iperf_udp.yaml | ||
- Run the tests | ||
- # ./run.sh \<client-pod-name\> | ||
- Delete iperf server and client pods | ||
- # ./clean_up.sh | ||
|
||
## iperf docker image details | ||
- https://github.com/lroktu/iperf | ||
- https://hub.docker.com/r/lroktu/iperf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
kubectl delete --cascade -f iperf_udp.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: iperf-server-deployment-udp | ||
labels: | ||
app: iperf-server-udp | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: iperf-server-udp | ||
template: | ||
metadata: | ||
labels: | ||
app: iperf-server-udp | ||
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: iperf-server-udp | ||
image: lroktu/iperf | ||
args: ['-s', '-u', '-p', '5202'] | ||
command: [iperf] | ||
ports: | ||
- containerPort: 5202 | ||
name: server | ||
protocol: UDP | ||
terminationGracePeriodSeconds: 0 | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: iperf-server-udp | ||
spec: | ||
selector: | ||
app: iperf-server-udp | ||
ports: | ||
- protocol: UDP | ||
port: 5202 | ||
targetPort: server | ||
|
||
--- | ||
|
||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: iperf-client | ||
labels: | ||
app: iperf-client | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: iperf-client | ||
template: | ||
metadata: | ||
labels: | ||
app: iperf-client | ||
spec: | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
operator: Exists | ||
effect: NoSchedule | ||
containers: | ||
- name: iperf-client | ||
image: lroktu/iperf | ||
command: ['/bin/sh', '-c', 'sleep infinity'] | ||
terminationGracePeriodSeconds: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
if [ -z "$1" ]; then | ||
echo "Error: Missing argument. Please provide client pod name as command line argument." | ||
exit 1 | ||
fi | ||
|
||
CLIENT="$1" | ||
|
||
# Loop 100 times | ||
for i in {1..100}; do | ||
echo "This is iteration $i" | ||
kubectl exec "$CLIENT" -- iperf -c iperf-server-udp -u -p 5202 -t 2 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters