Skip to content

Commit 8f8f455

Browse files
authored
Merge branch 'master' into ankaggar/ankaggar/PNI-CRD
2 parents 297d352 + f712771 commit 8f8f455

File tree

6 files changed

+521
-1
lines changed

6 files changed

+521
-1
lines changed

.pipelines/cni/cilium/cilium-scale-test.yaml

+409
Large diffs are not rendered by default.

hack/aks/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -264,3 +264,6 @@ down: ## Delete the cluster
264264

265265
restart-vmss: ## Restarts the nodes in the cluster
266266
$(AZCLI) vmss restart -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME)
267+
268+
scale-vmss: ## Scales the nodes in the cluster
269+
$(AZCLI) vmss scale -g MC_${GROUP}_${CLUSTER}_${REGION} --name $(VMSS_NAME) --new-capacity $(NODE_COUNT)

hack/manifests/apache.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: apachebench
5+
spec:
6+
selector:
7+
matchLabels:
8+
app: apachebench
9+
template:
10+
metadata:
11+
labels:
12+
app: apachebench
13+
spec:
14+
containers:
15+
- name: ubuntu-tools
16+
image: tamilmani1989/ubuntu18-tools
17+
command: ["/bin/sleep", "3650d"]
18+

hack/manifests/netperf-pod.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: container6
5+
namespace: default
6+
spec:
7+
selector:
8+
matchLabels:
9+
app: container6
10+
replicas: 3
11+
template: # create pods using pod definition in this template
12+
metadata:
13+
# unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is
14+
# generated from the deployment name
15+
labels:
16+
app: container6
17+
netperf: "true"
18+
spec:
19+
nodeSelector:
20+
netperf: "true"
21+
containers:
22+
- name: ubuntu
23+
image: tamilmani1989/ubuntu18-tools
24+
imagePullPolicy: Always
25+
command: ["/bin/sh","-c"]
26+
args: ["echo helloworld>hello.txt; php -S 0.0.0.0:9568"]
27+
securityContext:
28+
privileged: true

hack/scripts/netperf.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
# find the nodes with netperf pods and assign test vars
3+
node_found=0
4+
for node in $(kubectl get nodes -o name);
5+
do
6+
if [ $node_found -lt 2 ]; then
7+
echo "Current : $node"
8+
node_name="${node##*/}"
9+
echo "checking whether the node has any netperf pods deployed to it"
10+
pod_count=$(kubectl get pods -l app=container6 -o wide | grep "$node_name" -c)
11+
netperf_pod=$(kubectl get pods -l app=container6 -o wide | grep "$node_name" | awk '{print $1}')
12+
echo "netperf pod : $netperf_pod"
13+
echo "pod_count: $pod_count"
14+
15+
if [ $pod_count -gt 1 ]; then
16+
target_pod=$(echo $netperf_pod | cut -d" " -f 1)
17+
target_pod_ip=$(kubectl get pod "$target_pod" -o jsonpath='{.status.podIP}')
18+
same_vm_pod=$(echo $netperf_pod | cut -d" " -f 2)
19+
kubectl exec -it $target_pod -- netserver
20+
node_found=$((node_found + 1))
21+
echo "Number of nodes found with netperf pod: $node_found"
22+
else
23+
diff_vm_pod=$netperf_pod
24+
node_found=$((node_found + 1))
25+
echo "Number of nodes found with netperf pod: $node_found"
26+
fi
27+
fi
28+
done
29+
30+
echo "target netperf pod: $target_pod"
31+
echo "target netperf pod IP: $target_pod_ip"
32+
echo "same vm pod: $same_vm_pod"
33+
echo "different vm pod: $diff_vm_pod"
34+
35+
#netperf on same vm pod
36+
iteration=10
37+
while [ $iteration -ge 0 ]
38+
do
39+
echo "============ Iteration $iteration ==============="
40+
kubectl exec -it $same_vm_pod -- netperf -H $target_pod_ip -l 30 -t TCP_STREAM >> "test3_netperf/same_vm_iteration_$iteration.log"
41+
echo "==============================="
42+
sleep 5s
43+
iteration=$((iteration-1))
44+
done
45+
46+
#netperf on different vm pod
47+
iteration=10
48+
while [ $iteration -ge 0 ]
49+
do
50+
echo "============ Iteration $iteration ==============="
51+
kubectl exec -it $diff_vm_pod -- netperf -H $target_pod_ip -l 30 -t TCP_STREAM >> "test3_netperf/diff_vm_iteration_$iteration.log"
52+
echo "==============================="
53+
sleep 5s
54+
iteration=$((iteration-1))
55+
done

test/scale/label-nodes.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22
cmd=$1
33
retries=0
4+
node_count=0
45
while [ $retries -lt 5 ]; do
56
$cmd
67
if [ $? -eq 0 ]; then
@@ -17,15 +18,21 @@ fi
1718

1819
for node in $(kubectl get nodes -o name);
1920
do
21+
node_count=$((node_count + 1))
22+
echo $node_count
2023
echo "Current : $node"
2124
node_name="${node##*/}"
2225
echo "Apply label to the node"
2326
kubectl label node $node_name connectivity-test=true
2427
kubectl label node $node_name scale-test=true
28+
if [ $node_count -lt 3 ]; then
29+
kubectl label node $node_name netperf=true
30+
echo "labeled node for netperf testing"
31+
fi
2532
if [ $? -eq 0 ]; then
2633
echo "Label applied to the node"
2734
else
2835
echo "Error in applying label to the node $node_name"
2936
fi
30-
sleep 2s
37+
sleep 1s
3138
done

0 commit comments

Comments
 (0)