From 8e69495f7fb0780f249bacc029a680a7534ebdb4 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Sat, 6 Jun 2015 13:19:37 -0400 Subject: [PATCH 1/5] AWS: Add jessie support to cluster script --- cluster/aws/jessie/util.sh | 81 ++++++++++++++++++++++++++++++++++++++ cluster/aws/util.sh | 5 ++- 2 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 cluster/aws/jessie/util.sh diff --git a/cluster/aws/jessie/util.sh b/cluster/aws/jessie/util.sh new file mode 100644 index 00000000000..f7434d6c11e --- /dev/null +++ b/cluster/aws/jessie/util.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +# Copyright 2015 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. + + +# A library of helper functions for Jessie. + +source "${KUBE_ROOT}/cluster/aws/ubuntu/common.sh" + +SSH_USER=admin + +# Detects the AMI to use for jessie (considering the region) +# Source: https://wiki.debian.org/Cloud/AmazonEC2Image/Jessie +# +# Vars set: +# AWS_IMAGE +function detect-jessie-image () { + if [[ -z "${AWS_IMAGE-}" ]]; then + case "${AWS_REGION}" in + ap-northeast-1) + AWS_IMAGE=ami-e624fbe6 + ;; + + ap-southeast-1) + AWS_IMAGE=ami-ac360cfe + ;; + + ap-southeast-2) + AWS_IMAGE=ami-bbc5bd81 + ;; + + eu-central-1) + AWS_IMAGE=ami-02b78e1f + ;; + + eu-west-1) + AWS_IMAGE=ami-e31a6594 + ;; + + sa-east-1) + AWS_IMAGE=ami-0972f214 + ;; + + us-east-1) + AWS_IMAGE=ami-116d857a + ;; + + us-west-1) + AWS_IMAGE=ami-05cf2541 + ;; + + us-west-2) + AWS_IMAGE=ami-818eb7b1 + ;; + + cn-north-1) + AWS_IMAGE=ami-888815b1 + ;; + + us-gov-west-1) + AWS_IMAGE=ami-35b5d516 + ;; + + *) + echo "Please specify AWS_IMAGE directly (region not recognized)" + exit 1 + esac + fi +} diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index e42c5911c36..ef3615a8ebe 100644 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -31,7 +31,7 @@ ASG_NAME="${NODE_INSTANCE_PREFIX}-group" MASTER_DISK_ID= case "${KUBE_OS_DISTRIBUTION}" in - ubuntu|wheezy|coreos) + ubuntu|wheezy|jessie|coreos) source "${KUBE_ROOT}/cluster/aws/${KUBE_OS_DISTRIBUTION}/util.sh" ;; *) @@ -227,6 +227,9 @@ case "${KUBE_OS_DISTRIBUTION}" in wheezy) detect-wheezy-image ;; + jessie) + detect-jessie-image + ;; *) echo "Please specify AWS_IMAGE directly (distro not recognized)" exit 2 From bdb2196abe2a99e4e9d170fa97586c110ea40136 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Tue, 16 Jun 2015 18:23:25 -0400 Subject: [PATCH 2/5] AWS: Initial support for Ubuntu Vivid Vervet --- cluster/aws/util.sh | 5 ++- cluster/aws/vivid/util.sh | 85 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 cluster/aws/vivid/util.sh diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index ef3615a8ebe..d5232ba7139 100644 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -31,7 +31,7 @@ ASG_NAME="${NODE_INSTANCE_PREFIX}-group" MASTER_DISK_ID= case "${KUBE_OS_DISTRIBUTION}" in - ubuntu|wheezy|jessie|coreos) + ubuntu|wheezy|jessie|vivid|coreos) source "${KUBE_ROOT}/cluster/aws/${KUBE_OS_DISTRIBUTION}/util.sh" ;; *) @@ -224,6 +224,9 @@ case "${KUBE_OS_DISTRIBUTION}" in ubuntu|coreos) detect-ubuntu-image ;; + vivid) + detect-vivid-image + ;; wheezy) detect-wheezy-image ;; diff --git a/cluster/aws/vivid/util.sh b/cluster/aws/vivid/util.sh new file mode 100644 index 00000000000..63d28b14234 --- /dev/null +++ b/cluster/aws/vivid/util.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +# Copyright 2015 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. + + +# A library of helper functions for Ubuntu. + +source "${KUBE_ROOT}/cluster/aws/ubuntu/common.sh" + +SSH_USER=ubuntu + + +# Detects the AMI to use for ubuntu (considering the region) +# +# Vars set: +# AWS_IMAGE +function detect-vivid-image () { + # This is the ubuntu 15.04 image for , amd64, hvm:ebs-ssd + # 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 + if [[ -z "${AWS_IMAGE-}" ]]; then + case "${AWS_REGION}" in + ap-northeast-1) + AWS_IMAGE=ami-907fa690 + ;; + + ap-southeast-1) + AWS_IMAGE=ami-b4a79de6 + ;; + + eu-central-1) + AWS_IMAGE=ami-e8635bf5 + ;; + + eu-west-1) + AWS_IMAGE=ami-0fd0ae78 + ;; + + sa-east-1) + AWS_IMAGE=ami-f9f675e4 + ;; + + us-east-1) + AWS_IMAGE=ami-f57b8f9e + ;; + + us-west-1) + AWS_IMAGE=ami-87b643c3 + ;; + + cn-north-1) + AWS_IMAGE=ami-3abf2203 + ;; + + #us-gov-west-1) + # AWS_IMAGE=?Not available? + # ;; + + ap-southeast-2) + AWS_IMAGE=ami-1bb9c221 + ;; + + us-west-2) + AWS_IMAGE=ami-33566d03 + ;; + + *) + echo "Please specify AWS_IMAGE directly (region not recognized)" + exit 1 + esac + fi +} + From 89900fa19b03d8e2f1599bba02b1d4cafe2d8a01 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Tue, 16 Jun 2015 18:25:18 -0400 Subject: [PATCH 3/5] AWS: Ubuntu Vivid, set cgroup_root to docker Otherwise libcontainer generates systemd unit file names that start with "-", which are not valid. --- cluster/saltbase/salt/kubelet/default | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cluster/saltbase/salt/kubelet/default b/cluster/saltbase/salt/kubelet/default index 40c3d2b9893..0c9c023a628 100644 --- a/cluster/saltbase/salt/kubelet/default +++ b/cluster/saltbase/salt/kubelet/default @@ -75,6 +75,9 @@ {% set system_container = "--system-container=/system" -%} {% set cgroup_root = "--cgroup_root=/" -%} {% endif -%} +{% if grains['oscodename'] == 'vivid' -%} + {% set cgroup_root = "--cgroup_root=docker" -%} +{% endif -%} {% set pod_cidr = "" %} {% if grains['roles'][0] == 'kubernetes-master' and grains.get('cbr-cidr') %} From dfac73d31abb082f6fef869944d517f7333295f9 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Tue, 16 Jun 2015 18:32:22 -0400 Subject: [PATCH 4/5] AWS: Change default OS to Ubuntu Vivid Vervet The background for this change is in #9675. In short, Vivid Vervet gives us a supported/updated image, that runs Docker with a working storage engine, but doesn't require a reboot as part of node start. Fixes #9675. --- cluster/aws/config-default.sh | 2 +- cluster/aws/config-test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster/aws/config-default.sh b/cluster/aws/config-default.sh index e57947fadbb..59eaa57d76f 100644 --- a/cluster/aws/config-default.sh +++ b/cluster/aws/config-default.sh @@ -85,7 +85,7 @@ ADMISSION_CONTROL=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContext ENABLE_MINION_PUBLIC_IP=${KUBE_ENABLE_MINION_PUBLIC_IP:-true} # OS options for minions -KUBE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION:-ubuntu}" +KUBE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION:-vivid}" KUBE_MINION_IMAGE="${KUBE_MINION_IMAGE:-}" COREOS_CHANNEL="${COREOS_CHANNEL:-alpha}" CONTAINER_RUNTIME="${KUBE_CONTAINER_RUNTIME:-docker}" diff --git a/cluster/aws/config-test.sh b/cluster/aws/config-test.sh index b4179f38009..d8963e4f828 100755 --- a/cluster/aws/config-test.sh +++ b/cluster/aws/config-test.sh @@ -81,7 +81,7 @@ ADMISSION_CONTROL=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContext ENABLE_MINION_PUBLIC_IP=${KUBE_ENABLE_MINION_PUBLIC_IP:-true} # OS options for minions -KUBE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION:-ubuntu}" +KUBE_OS_DISTRIBUTION="${KUBE_OS_DISTRIBUTION:-vivid}" KUBE_MINION_IMAGE="${KUBE_MINION_IMAGE:-}" COREOS_CHANNEL="${COREOS_CHANNEL:-alpha}" CONTAINER_RUNTIME="${KUBE_CONTAINER_RUNTIME:-docker}" From c78b71d399639e6d290c4fa670a76a1bbbfffe16 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Wed, 24 Jun 2015 23:13:17 -0400 Subject: [PATCH 5/5] AWS: Treat ubuntu as an alias for 'latest ubuntu', i.e. 'vivid' --- cluster/aws/jessie/util.sh | 2 +- cluster/aws/options.md | 9 +++++++-- cluster/aws/{ubuntu => trusty}/common.sh | 0 cluster/aws/{ubuntu => trusty}/util.sh | 4 +--- cluster/aws/util.sh | 15 ++++++++++----- cluster/aws/vivid/util.sh | 4 +--- cluster/aws/wheezy/util.sh | 2 +- 7 files changed, 21 insertions(+), 15 deletions(-) rename cluster/aws/{ubuntu => trusty}/common.sh (100%) rename cluster/aws/{ubuntu => trusty}/util.sh (88%) diff --git a/cluster/aws/jessie/util.sh b/cluster/aws/jessie/util.sh index f7434d6c11e..acdf61c21b5 100644 --- a/cluster/aws/jessie/util.sh +++ b/cluster/aws/jessie/util.sh @@ -17,7 +17,7 @@ # A library of helper functions for Jessie. -source "${KUBE_ROOT}/cluster/aws/ubuntu/common.sh" +source "${KUBE_ROOT}/cluster/aws/trusty/common.sh" SSH_USER=admin diff --git a/cluster/aws/options.md b/cluster/aws/options.md index b915abef691..31a3b3ca6c2 100644 --- a/cluster/aws/options.md +++ b/cluster/aws/options.md @@ -76,8 +76,13 @@ If your machines don't have any ephemeral disks, this will default to the aufs d **KUBE_OS_DISTRIBUTION** -The distribution to use. Valid options: `wheezy`, `ubuntu`, `coreos`. +The distribution to use. Valid options: `trusty`, `vivid`, `coreos`, `wheezy`, `jessie` -Defaults to wheezy (Debian Wheezy), which is the same as is used by default on GCE. +Defaults to vivid (Ubuntu Vivid Vervet), which has a modern kernel and does not require updating or a reboot. + +`coreos` is also a good option. + +Other options may require reboots, updates or configuration, and should be used only if you have a compelling +requirement to do so. [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/aws/options.md?pixel)]() diff --git a/cluster/aws/ubuntu/common.sh b/cluster/aws/trusty/common.sh similarity index 100% rename from cluster/aws/ubuntu/common.sh rename to cluster/aws/trusty/common.sh diff --git a/cluster/aws/ubuntu/util.sh b/cluster/aws/trusty/util.sh similarity index 88% rename from cluster/aws/ubuntu/util.sh rename to cluster/aws/trusty/util.sh index 7961caa0f1a..25dd980b250 100644 --- a/cluster/aws/ubuntu/util.sh +++ b/cluster/aws/trusty/util.sh @@ -15,9 +15,7 @@ # limitations under the License. -# A library of helper functions for Ubuntu. - -source "${KUBE_ROOT}/cluster/aws/ubuntu/common.sh" +source "${KUBE_ROOT}/cluster/aws/trusty/common.sh" # TODO: Move image detection in here once it is no longer shared with CoreOS diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index d5232ba7139..6780ef798a6 100644 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -30,8 +30,13 @@ ASG_NAME="${NODE_INSTANCE_PREFIX}-group" # We could allow the master disk volume id to be specified in future MASTER_DISK_ID= +# Defaults: ubuntu -> vivid +if [[ "${KUBE_OS_DISTRIBUTION}" == "ubuntu" ]]; then + KUBE_OS_DISTRIBUTION=vivid +fi + case "${KUBE_OS_DISTRIBUTION}" in - ubuntu|wheezy|jessie|vivid|coreos) + trusty|wheezy|jessie|vivid|coreos) source "${KUBE_ROOT}/cluster/aws/${KUBE_OS_DISTRIBUTION}/util.sh" ;; *) @@ -221,8 +226,8 @@ function detect-security-groups { # AWS_IMAGE function detect-image () { case "${KUBE_OS_DISTRIBUTION}" in - ubuntu|coreos) - detect-ubuntu-image + trusty|coreos) + detect-trusty-image ;; vivid) detect-vivid-image @@ -240,12 +245,12 @@ case "${KUBE_OS_DISTRIBUTION}" in esac } -# Detects the AMI to use for ubuntu (considering the region) +# Detects the AMI to use for trusty (considering the region) # Used by CoreOS & Ubuntu # # Vars set: # AWS_IMAGE -function detect-ubuntu-image () { +function detect-trusty-image () { # This is the ubuntu 14.04 image for , amd64, hvm:ebs-ssd # 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 diff --git a/cluster/aws/vivid/util.sh b/cluster/aws/vivid/util.sh index 63d28b14234..114903f66f3 100644 --- a/cluster/aws/vivid/util.sh +++ b/cluster/aws/vivid/util.sh @@ -15,9 +15,7 @@ # limitations under the License. -# A library of helper functions for Ubuntu. - -source "${KUBE_ROOT}/cluster/aws/ubuntu/common.sh" +source "${KUBE_ROOT}/cluster/aws/trusty/common.sh" SSH_USER=ubuntu diff --git a/cluster/aws/wheezy/util.sh b/cluster/aws/wheezy/util.sh index 195542096f3..b5a61331026 100644 --- a/cluster/aws/wheezy/util.sh +++ b/cluster/aws/wheezy/util.sh @@ -17,7 +17,7 @@ # A library of helper functions for Wheezy. -source "${KUBE_ROOT}/cluster/aws/ubuntu/common.sh" +source "${KUBE_ROOT}/cluster/aws/trusty/common.sh" SSH_USER=admin