Skip to content

Commit

Permalink
Merge pull request kubernetes#9381 from justinsb/aws_support_jessie
Browse files Browse the repository at this point in the history
AWS: Add support for Vivid Vervet & Debian Jessie
  • Loading branch information
vmarmol committed Jul 9, 2015
2 parents ffc5a86 + c78b71d commit ee8d285
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cluster/aws/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion cluster/aws/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
81 changes: 81 additions & 0 deletions cluster/aws/jessie/util.sh
Original file line number Diff line number Diff line change
@@ -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/trusty/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
}
9 changes: 7 additions & 2 deletions cluster/aws/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)]()
File renamed without changes.
4 changes: 1 addition & 3 deletions cluster/aws/ubuntu/util.sh → cluster/aws/trusty/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 16 additions & 5 deletions cluster/aws/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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|coreos)
trusty|wheezy|jessie|vivid|coreos)
source "${KUBE_ROOT}/cluster/aws/${KUBE_OS_DISTRIBUTION}/util.sh"
;;
*)
Expand Down Expand Up @@ -217,25 +222,31 @@ 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
;;
wheezy)
detect-wheezy-image
;;
jessie)
detect-jessie-image
;;
*)
echo "Please specify AWS_IMAGE directly (distro not recognized)"
exit 2
;;
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 <region>, 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
Expand Down
83 changes: 83 additions & 0 deletions cluster/aws/vivid/util.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/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.


source "${KUBE_ROOT}/cluster/aws/trusty/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 <region>, 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
}

2 changes: 1 addition & 1 deletion cluster/aws/wheezy/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions cluster/saltbase/salt/kubelet/default
Original file line number Diff line number Diff line change
Expand Up @@ -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') %}
Expand Down

0 comments on commit ee8d285

Please sign in to comment.