-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to find the limit for openshift.
May be used as an example for other platforms. Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 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
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,44 @@ | ||
#!/bin/bash | ||
|
||
wait_cleanup () { | ||
POD_NAMES=$(oc get pods -n openshift-ovn-kubernetes -l app=ovnkube-node -o jsonpath='{.items[*].metadata.name}') | ||
FLOW_COUNT=0 | ||
for POD_NAME in ${POD_NAMES[@]}; do | ||
POD_FLOW_COUNT=$(oc exec -n openshift-ovn-kubernetes $POD_NAME -c ovn-controller -- curl -s "127.0.0.1:29105/metrics"|grep ovs_vswitchd_bridge_flows_total|grep br-int|rev|cut -f1 -d' '|rev) | ||
if [ $POD_FLOW_COUNT -gt $FLOW_COUNT ]; then | ||
FLOW_COUNT=$POD_FLOW_COUNT | ||
fi | ||
done | ||
echo $FLOW_COUNT | ||
|
||
while [ $FLOW_COUNT -ge 10000 ]; do | ||
FLOW_COUNT=0 | ||
for POD_NAME in ${POD_NAMES[@]}; do | ||
POD_FLOW_COUNT=$(oc exec -n openshift-ovn-kubernetes $POD_NAME -c ovn-controller -- curl -s "127.0.0.1:29105/metrics"|grep ovs_vswitchd_bridge_flows_total|grep br-int|rev|cut -f1 -d' '|rev) | ||
if [ $POD_FLOW_COUNT -gt $FLOW_COUNT ]; then | ||
FLOW_COUNT=$POD_FLOW_COUNT | ||
fi | ||
done | ||
echo $FLOW_COUNT | ||
sleep 60 | ||
done | ||
echo "shutdown succeeded" | ||
} | ||
|
||
PLATFORM=openshift | ||
source ./env | ||
NETPOLS_PER_NAMESPACE=50 | ||
STEP=50 | ||
expectedStatus=0 | ||
status=$expectedStatus | ||
while [ $status -eq $expectedStatus ]; do | ||
echo $NETPOLS_PER_NAMESPACE | ||
wait_cleanup | ||
kube-burner init -m ./metrics.yml -c ../network-policy.yaml -u https://$(oc get route prometheus-k8s -n openshift-monitoring -o jsonpath="{.spec.host}") --token=$(oc create token prometheus-k8s -n openshift-monitoring) | ||
status=$? | ||
if [ $STEP -eq 0 ]; then | ||
echo "One iteration is finished" | ||
exit 0 | ||
fi | ||
NETPOLS_PER_NAMESPACE=$((NETPOLS_PER_NAMESPACE + STEP)) | ||
done |