forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix calling function before declaration Set Name tags on instances Hide import-key-pair error Fix instances names resolution Implement kube-down for AWS provider Add cluster validation routines. Make changes according to kubernetes#1255 Implement post-deployment cluster validation Set proper master name in userdata scripts Fix kube-down path in hint Add getting started for AWS
- Loading branch information
1 parent
4a21dbb
commit 1ff79fd
Showing
14 changed files
with
793 additions
and
1 deletion.
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,31 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2014 Google Inc. 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. | ||
|
||
ZONE=eu-west-1 | ||
MASTER_SIZE=t2.small | ||
MINION_SIZE=t2.small | ||
NUM_MINIONS=4 | ||
|
||
IMAGE=ami-0307d674 | ||
INSTANCE_PREFIX=kubernetes | ||
AWS_SSH_KEY=$HOME/.ssh/kube_aws_rsa | ||
|
||
MASTER_NAME="ip-172-20-0-9.$ZONE.compute.internal" | ||
MASTER_TAG="${INSTANCE_PREFIX}-master" | ||
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="" |
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,30 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2014 Google Inc. 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. | ||
|
||
# Tear down a Kubernetes cluster. | ||
|
||
# exit on any error | ||
set -e | ||
|
||
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" |
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,36 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2014 Google Inc. 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. | ||
|
||
# Bring up a Kubernetes cluster. | ||
# | ||
# If the full release name (s3://<bucket>/<release>) is passed in then we take | ||
# that directly. If not then we assume we are doing development stuff and take | ||
# the defaults in the release config. | ||
|
||
# exit on any error | ||
set -e | ||
|
||
source $(dirname $0)/../kube-env.sh | ||
source $(dirname $0)/../$KUBERNETES_PROVIDER/util.sh | ||
|
||
echo "Starting cluster using provider: $KUBERNETES_PROVIDER" | ||
|
||
verify-prereqs | ||
kube-up | ||
|
||
source $(dirname $0)/validate-cluster.sh | ||
|
||
echo "Done" |
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,32 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2014 Google Inc. 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. | ||
|
||
# Download and install release | ||
|
||
# This script assumes that the environment variable MASTER_RELEASE_TAR contains | ||
# 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 "Unpacking release" | ||
rm -rf master-release || false | ||
tar xzf master-release.tgz | ||
|
||
echo "Running release install script" | ||
master-release/src/scripts/master-release-install.sh |
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,54 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2014 Google Inc. 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. | ||
|
||
# Prepopulate the name of the Master | ||
mkdir -p /etc/salt/minion.d | ||
echo "master: $MASTER_NAME" > /etc/salt/minion.d/master.conf | ||
|
||
cat <<EOF >/etc/salt/minion.d/grains.conf | ||
grains: | ||
roles: | ||
- kubernetes-master | ||
cloud: aws | ||
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 | ||
auto_accept: True | ||
EOF | ||
|
||
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 | ||
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 | ||
# install. See https://github.com/saltstack/salt-bootstrap/issues/270 | ||
# | ||
# -M installs the master | ||
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 |
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,37 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2014 Google Inc. 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. | ||
|
||
# Prepopulate the name of the Master | ||
mkdir -p /etc/salt/minion.d | ||
echo "master: $MASTER_NAME" > /etc/salt/minion.d/master.conf | ||
|
||
# Turn on debugging for salt-minion | ||
# echo "DAEMON_ARGS=\"\$DAEMON_ARGS --log-file-level=debug\"" > /etc/default/salt-minion | ||
|
||
# Our minions will have a pool role to distinguish them from the master. | ||
cat <<EOF >/etc/salt/minion.d/grains.conf | ||
grains: | ||
roles: | ||
- kubernetes-pool | ||
cbr-cidr: $MINION_IP_RANGE | ||
cloud: aws | ||
EOF | ||
|
||
# Install Salt | ||
# | ||
# We specify -X to avoid a race condition that can cause minion failure to | ||
# install. See https://github.com/saltstack/salt-bootstrap/issues/270 | ||
curl -L --connect-timeout 20 --retry 6 --retry-delay 10 https://bootstrap.saltstack.com | sh -s -- -X |
Oops, something went wrong.