Skip to content

Commit

Permalink
Update the AWS config.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Nov 10, 2014
1 parent 1ff79fd commit 62bd634
Show file tree
Hide file tree
Showing 15 changed files with 368 additions and 481 deletions.
14 changes: 10 additions & 4 deletions cluster/aws/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ZONE=eu-west-1
MASTER_SIZE=t2.small
MINION_SIZE=t2.small
# TODO: this isn't quite piped into all the right places...
ZONE=us-west-2
MASTER_SIZE=t2.micro
MINION_SIZE=t2.micro
NUM_MINIONS=4

IMAGE=ami-0307d674
# This is the ubuntu 14.04 image for us-west-2 + ebs
# See here: http://cloud-images.ubuntu.com/locator/ec2/ for other images
# This will need to be updated from time to time as amis are deprecated
IMAGE=ami-55d69e65
INSTANCE_PREFIX=kubernetes
AWS_SSH_KEY=$HOME/.ssh/kube_aws_rsa

Expand All @@ -29,3 +33,5 @@ MINION_TAG="${INSTANCE_PREFIX}-minion"
MINION_NAMES=($(eval echo ip-172-20-0-1{0..$(($NUM_MINIONS-1))}.$ZONE.compute.internal))
MINION_IP_RANGES=($(eval echo "10.244.{1..${NUM_MINIONS}}.0/24"))
MINION_SCOPES=""
POLL_SLEEP_INTERVAL=3
PORTAL_NET="10.0.0.0/16"
36 changes: 0 additions & 36 deletions cluster/aws/kube-up.sh

This file was deleted.

24 changes: 12 additions & 12 deletions cluster/aws/kube-down.sh → ...ws/templates/create-dynamic-salt-files.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Tear down a Kubernetes cluster.
# Create the overlay files for the salt tree. We create these in a separate
# place so that we can blow away the rest of the salt configs on a kube-push and
# re-apply these.

# exit on any error
set -e
mkdir -p /srv/salt-overlay/pillar
cat <<EOF >/srv/salt-overlay/pillar/cluster-params.sls
node_instance_prefix: $NODE_INSTANCE_PREFIX
portal_net: $PORTAL_NET
use-fluentd-es: $FLUENTD_ELASTICSEARCH
use-fluentd-gcp: $FLUENTD_GCP
EOF

source $(dirname $0)/../kube-env.sh
source $(dirname $0)/../$KUBERNETES_PROVIDER/util.sh

echo "Bringing down cluster using provider: $KUBERNETES_PROVIDER"

verify-prereqs
kube-down

echo "Done"
mkdir -p /srv/salt-overlay/salt/nginx
echo $MASTER_HTPASSWD > /srv/salt-overlay/salt/nginx/htpasswd
14 changes: 8 additions & 6 deletions cluster/aws/templates/download-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
# the release tar to download and unpack. It is meant to be pushed to the
# master and run.

echo "Downloading release ($MASTER_RELEASE_TAR)"
wget $MASTER_RELEASE_TAR
echo "Downloading binary release tar ($SERVER_BINARY_TAR_URL)"
wget "$SERVER_BINARY_TAR_URL" .

echo "Downloading binary release tar ($SALT_TAR_URL)"
wget "$SALT_TAR_URL" .

echo "Unpacking release"
rm -rf master-release || false
tar xzf master-release.tgz
echo "Unpacking Salt tree"
rm -rf kubernetes
tar xzf "${SALT_TAR_URL##*/}"

echo "Running release install script"
master-release/src/scripts/master-release-install.sh
sudo kubernetes/saltbase/install.sh "${SERVER_BINARY_TAR_URL##*/}"
15 changes: 9 additions & 6 deletions cluster/aws/templates/salt-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ grains:
cloud: aws
EOF

cat <<EOF > /etc/aws.conf
{
"Global": {
"Region": "${AWS_ZONE}"
}
}
EOF

# Auto accept all keys from minions that try to join
mkdir -p /etc/salt/master.d
cat <<EOF >/etc/salt/master.d/auto-accept.conf
Expand All @@ -35,12 +43,9 @@ cat <<EOF >/etc/salt/master.d/reactor.conf
# React to new minions starting by running highstate on them.
reactor:
- 'salt/minion/*/start':
- /srv/reactor/start.sls
- /srv/reactor/highstate-new.sls
EOF

mkdir -p /srv/salt/nginx
echo $MASTER_HTPASSWD > /srv/salt/nginx/htpasswd

# Install Salt
#
# We specify -X to avoid a race condition that can cause minion failure to
Expand All @@ -50,5 +55,3 @@ echo $MASTER_HTPASSWD > /srv/salt/nginx/htpasswd
set +x
curl -L --connect-timeout 20 --retry 6 --retry-delay 10 http://bootstrap.saltstack.com | sh -s -- -M -X
set -x

echo $MASTER_HTPASSWD > /srv/salt/nginx/htpasswd
Loading

0 comments on commit 62bd634

Please sign in to comment.