mirror of
https://github.com/k8snetworkplumbingwg/whereabouts.git
synced 2025-06-03 06:42:26 +00:00
Simple scale script
Adds a script that can be used with the the local kind cluster to test the impact of changes to whereabouts from a scale perspective Signed-off-by: Benjamin Pickard <bpickard@redhat.com>
This commit is contained in:
parent
c89ee2c373
commit
9ce8d77302
26
script/scale-test.sh
Executable file
26
script/scale-test.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
#An easy way to run this is to create a kind cluster using ./hack/e2e-setup-kind-cluster
|
||||
|
||||
HERE="$(dirname "$(readlink --canonicalize ${BASH_SOURCE[0]})")"
|
||||
ROOT="$(readlink --canonicalize "$HERE/..")"
|
||||
WHEREABOUTSNAD="$ROOT/yamls/whereaboutsScaleNAD.yaml"
|
||||
SCALEDEPLOYMENT="$ROOT/yamls/scaleTestDeployment.yaml"
|
||||
|
||||
#create the whereabouts nad
|
||||
oc apply -f "$WHEREABOUTSNAD"
|
||||
#start a timer to record how long the pods take to spin up
|
||||
start=$SECONDS
|
||||
#create the deployment (change the replicas feild in the scale-deployment yaml if you want to test a different number of pods)
|
||||
oc apply -f "$SCALEDEPLOYMENT"
|
||||
kubectl rollout status deploy/scale-deployment
|
||||
#wait for all pods to be deployed
|
||||
|
||||
#Log the amount of time it took the pods to create
|
||||
createTime=$(( SECONDS - start ))
|
||||
echo Pod creation duration:"$createTime"
|
||||
|
||||
#delete the deployment and track pod deletion timing
|
||||
oc delete deploy/scale-deployment
|
||||
|
25
yamls/scaleTestDeployment.yaml
Normal file
25
yamls/scaleTestDeployment.yaml
Normal file
@ -0,0 +1,25 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: scale-deployment
|
||||
labels:
|
||||
app: scale-deployment
|
||||
spec:
|
||||
replicas: 10 #use this to modify the number of pods spun up by the scale-test script
|
||||
selector:
|
||||
matchLabels:
|
||||
app: scale-pod
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
k8s.v1.cni.cncf.io/networks: whereabouts-scale
|
||||
labels:
|
||||
app: scale-pod
|
||||
spec:
|
||||
containers:
|
||||
- name: scale
|
||||
image: nicolaka/netshoot
|
||||
command:
|
||||
- sleep
|
||||
- "3600"
|
||||
imagePullPolicy: IfNotPresent
|
16
yamls/whereaboutsScaleNAD.yaml
Normal file
16
yamls/whereaboutsScaleNAD.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
apiVersion: "k8s.cni.cncf.io/v1"
|
||||
kind: NetworkAttachmentDefinition
|
||||
metadata:
|
||||
name: whereabouts-scale
|
||||
spec:
|
||||
config: '{
|
||||
"cniVersion": "0.3.0",
|
||||
"name": "whereabouts-scale",
|
||||
"type": "macvlan",
|
||||
"master": "eth0",
|
||||
"mode": "bridge",
|
||||
"ipam": {
|
||||
"type": "whereabouts",
|
||||
"range": "192.168.2.225/24"
|
||||
}
|
||||
}'
|
Loading…
Reference in New Issue
Block a user