2016-09-23 18:08:40 +00:00
|
|
|
#!/usr/bin/env bash
|
2020-09-10 06:39:46 +00:00
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
|
|
|
this=`basename $0`
|
|
|
|
this_dir=`dirname $0`
|
|
|
|
|
|
|
|
show_help() {
|
2016-09-23 18:08:40 +00:00
|
|
|
cat << EOF
|
2020-09-10 06:39:46 +00:00
|
|
|
Usage: $this [-a APPLICATION_NAME]
|
2016-09-23 18:08:40 +00:00
|
|
|
Runs ten pods without discovery enabled with the specified application.
|
|
|
|
|
|
|
|
-a APPLICATION_NAME run the pods with APPLICATION_NAME application.
|
|
|
|
APPLICATION_NAME can be one of parsec or cloverleaf.
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ $# -eq 0 ]
|
|
|
|
then
|
|
|
|
show_help
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
app="parsec"
|
|
|
|
|
|
|
|
OPTIND=1
|
|
|
|
options="ha:"
|
|
|
|
while getopts $options option
|
|
|
|
do
|
2020-09-10 06:39:46 +00:00
|
|
|
case $option in
|
2016-09-23 18:08:40 +00:00
|
|
|
a)
|
|
|
|
if [ "$OPTARG" == "parsec" ] || [ "$OPTARG" == "cloverleaf" ]
|
|
|
|
then
|
|
|
|
app=$OPTARG
|
|
|
|
else
|
|
|
|
echo "Invalid application name."
|
|
|
|
show_help
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
;;
|
2020-09-10 06:39:46 +00:00
|
|
|
h)
|
2016-09-23 18:08:40 +00:00
|
|
|
show_help
|
|
|
|
exit 0
|
|
|
|
;;
|
2020-09-10 06:39:46 +00:00
|
|
|
'?')
|
2016-09-23 18:08:40 +00:00
|
|
|
show_help
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Using application name = $app."
|
|
|
|
echo "Creating pods without node feature discovery enabled."
|
|
|
|
for i in {1..10}
|
|
|
|
do
|
|
|
|
if [ "$app" == "parsec" ]
|
|
|
|
then
|
2020-09-10 06:39:46 +00:00
|
|
|
sed -e "s/NUM/$i-wo-discovery/" -e "s/IMG/demo-1/" -e "s/APP/$app/" \
|
|
|
|
"$this_dir/demo-pod-without-discovery.yaml.template" | kubectl create -f -
|
2016-09-23 18:08:40 +00:00
|
|
|
else
|
2020-09-10 06:39:46 +00:00
|
|
|
sed -e "s/NUM/$i-wo-discovery/" -e "s/IMG/demo-2/" -e "s/APP/$app/" \
|
|
|
|
"$this_dir/demo-pod-without-discovery.yaml.template" | kubectl create -f -
|
2016-09-23 18:08:40 +00:00
|
|
|
fi
|
|
|
|
echo "WithoutDiscovery" >> labels-without-discovery-$app.log
|
2020-09-10 06:39:46 +00:00
|
|
|
done
|
2016-09-23 18:08:40 +00:00
|
|
|
echo "Ten pods without node feature discovery started."
|