diff --git a/deployments/kwok-perf-test/deploy-tool.sh b/deployments/kwok-perf-test/deploy-tool.sh new file mode 100755 index 000000000..64bb64fde --- /dev/null +++ b/deployments/kwok-perf-test/deploy-tool.sh @@ -0,0 +1,121 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +show_help() { + cat << EOF +Invalid option: -$OPTARG +Usage: $0 [-d] [-i ] + +Options: + -d, --delete Delete the specified number of deployments. + -i, --interval Set the interval between deployments in seconds. + +Arguments: + Number of deployments to create or delete (required). + Number of replicas for each deployment (required). +EOF +} + +deploy_deployments() { + for (( i=0; i" + exit 1 +fi + +KWOK_REPO=kubernetes-sigs/kwok +KWOK_LATEST_RELEASE=$(curl "https://api.github.com/repos/${KWOK_REPO}/releases/latest" | jq -r '.tag_name') +kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/kwok.yaml" +kubectl apply -f "https://github.com/${KWOK_REPO}/releases/download/${KWOK_LATEST_RELEASE}/stage-fast.yaml" + +for (( i=0;i<$1; i++)) +do + kubectl apply -f - <