forked from Billy99/ovn-kuber-traffic-flow-tests
-
Notifications
You must be signed in to change notification settings - Fork 4
/
launch.sh
executable file
·81 lines (66 loc) · 2.32 KB
/
launch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
shopt -s expand_aliases
# Source the variables and functions in utilities.sh
. utilities.sh
# Make sure kubectl is installed. Create an alias if not.
# This needs to be done before other files are sourced.
test_for_kubectl
COMMAND="launch"
# Source the functions in other files
. variables.sh
. generate-yaml.sh
. labels.sh
. multi-cluster.sh
determine-default-data
process-help $1
install_j2_renderer
generate_yamls
if [ "$FT_VARS" == true ]; then
dump-working-data
fi
FT_SRIOV_SERVER=false
FT_NORMAL_CLIENT=false
FT_SRIOV_CLIENT=false
add_labels
if [ "$FT_CLIENTONLY" == true ]; then
FT_SRIOV_SERVER=false
fi
if [ "$FT_NAMESPACE" != default ]; then
echo "Creating Namespace"
kubectl apply -f ./manifests/yamls/namespace.yaml
fi
if [ "$FT_HOSTONLY" == false ]; then
if [ "$FT_SRIOV_SERVER" == true ] || [ "$FT_SRIOV_CLIENT" == true ]; then
kubectl apply -f ./manifests/yamls/netAttachDef-sriov.yaml
fi
if [ "$FT_CLIENTONLY" == false ]; then
# Create Cluster Networked Pods and Services
kubectl apply -f ./manifests/yamls/svc-nodePort.yaml
kubectl apply -f ./manifests/yamls/svc-clusterIP.yaml
# Launch "SR-IOV" daemonset as well if node has it enabled
if [ "$FT_SRIOV_SERVER" == true ]; then
kubectl apply -f ./manifests/yamls/http-server-pod-v4-sriov.yaml
kubectl apply -f ./manifests/yamls/iperf-server-pod-v4-sriov.yaml
else
kubectl apply -f ./manifests/yamls/http-server-pod-v4.yaml
kubectl apply -f ./manifests/yamls/iperf-server-pod-v4.yaml
fi
fi
if [ "$FT_NORMAL_CLIENT" == true ]; then
kubectl apply -f ./manifests/yamls/client-daemonSet.yaml
fi
if [ "$FT_SRIOV_CLIENT" == true ]; then
kubectl apply -f ./manifests/yamls/client-daemonSet-sriov.yaml
fi
fi
# Create Host networked Pods and Services
if [ "$FT_CLIENTONLY" == false ]; then
kubectl apply -f ./manifests/yamls/svc-nodePort-host.yaml
kubectl apply -f ./manifests/yamls/svc-clusterIP-host.yaml
kubectl apply -f ./manifests/yamls/http-server-pod-v4-host.yaml
kubectl apply -f ./manifests/yamls/iperf-server-pod-v4-host.yaml
fi
kubectl apply -f ./manifests/yamls/client-daemonSet-host.yaml
kubectl apply -f ./manifests/yamls/tools-daemonSet.yaml
podman run -itd --rm -p $IPERF_CLUSTERIP_POD_SVC_PORT --entrypoint iperf3 --name=$IPERF3_SERVER_NAME $TEST_IMAGE -s
manage_multi_cluster