Skip to content

Commit

Permalink
Merge pull request kubernetes-retired#1538 from roberthbailey/1000-no…
Browse files Browse the repository at this point in the history
…de-demo

Automatic merge from submit-queue

Add a simple script to scale up a cluster

Also change the html headings to "Scale Demo" since we now go well beyond 1M QPS.
  • Loading branch information
Kubernetes Submit Queue authored Aug 16, 2016
2 parents 2aaec45 + 954a158 commit d192df3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
39 changes: 39 additions & 0 deletions scale-demo/scale-up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed 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.

usage() {
echo "${0} <initial-size> <step-size> <target-size> [<sleep-duration-seconds>]"
}

if [[ "$#" -ne 3 ]] && [[ "$#" -ne 4 ]]; then
usage
exit 1
fi

declare -ir initial_size="${1}"
declare -ir step_size="${2}"
declare -ir target_size="${3}"
declare -ir sleep_duration_sec="${4:-7}"

echo "Scaling from ${initial_size} to ${target_size} by ${step_size} every ${sleep_duration_sec} seconds"

for ((i=${initial_size}; i<=${target_size}; i+=${step_size})); do
current_size="${i}"
echo "Scaling to ${current_size} loadbots"
echo "kubectl scale rc vegeta --replicas=${current_size}"
kubectl scale rc vegeta --replicas="${current_size}"
sleep "${sleep_duration_sec}"
done
2 changes: 1 addition & 1 deletion scale-demo/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body>
<div layout="column" style="margin-top: 20px; width: 80%" offset="10" ng-controller="AppCtrl">
<md-toolbar layout="row" layout-align="space-around center">
<h1 class="md-display-2">Kubernetes 1M Reqs/Second</h1>
<h1 class="md-display-2">Kubernetes Scale Demo</h1>
<a href="https://k8s.io"> <img src="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png" style="width:84; height: 84" />
</a>
</md-toolbar>
Expand Down
4 changes: 2 additions & 2 deletions scale-demo/www/pods.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<body>
<div layout="column" style="margin-top: 20px; width: 80%" offset="10" ng-controller="AppCtrl">
<md-toolbar layout="row" layout-align="space-around center">
<h1 class="md-display-2">Kubernetes 1M Reqs/Second</h1>
<h1 class="md-display-2">Kubernetes Scale Demo</h1>
<a href="https://k8s.io"> <img src="https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.png" style="width:84; height: 84" />
</a>
</md-toolbar>

<div layout="row" class="md-whiteframe-z2" style="padding: 10px">
<div layout-margin="10px" flex="20" style="text-align: right">
<div class="md-subhead">Version 0.2</div>
Expand Down

0 comments on commit d192df3

Please sign in to comment.