From 4d2c58078191074e3513e1959a1818cc9fb7b626 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 12 Feb 2016 13:25:07 -0500 Subject: [PATCH] AWS kube-up: Add support for wily vivid is technically no longer supported now, so we should support wily. --- cluster/aws/util.sh | 5 +- cluster/aws/wily/util.sh | 82 +++++++++++++++++++++++++++ cluster/saltbase/pillar/systemd.sls | 2 +- cluster/saltbase/salt/docker/init.sls | 9 +++ cluster/saltbase/salt/kubelet/default | 2 +- 5 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 cluster/aws/wily/util.sh diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index 80fde6177c6..1031ecf9c77 100755 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -57,7 +57,7 @@ fi OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION} case "${KUBE_OS_DISTRIBUTION}" in - trusty|wheezy|jessie|vivid|coreos) + trusty|wheezy|jessie|vivid|wily|coreos) source "${KUBE_ROOT}/cluster/aws/${KUBE_OS_DISTRIBUTION}/util.sh" ;; *) @@ -272,6 +272,9 @@ case "${KUBE_OS_DISTRIBUTION}" in vivid) detect-vivid-image ;; + wily) + detect-wily-image + ;; wheezy) detect-wheezy-image ;; diff --git a/cluster/aws/wily/util.sh b/cluster/aws/wily/util.sh new file mode 100644 index 00000000000..94df3c4c90f --- /dev/null +++ b/cluster/aws/wily/util.sh @@ -0,0 +1,82 @@ +#!/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-wily-image () { + # This is the ubuntu 15.10 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-3355505d + ;; + + ap-southeast-1) + AWS_IMAGE=ami-60975903 + ;; + + eu-central-1) + AWS_IMAGE=ami-6da2ba01 + ;; + + eu-west-1) + AWS_IMAGE=ami-36a71645 + ;; + + sa-east-1) + AWS_IMAGE=ami-fd36b691 + ;; + + us-east-1) + AWS_IMAGE=ami-6610390c + ;; + + us-west-1) + AWS_IMAGE=ami-6e64120e + ;; + + cn-north-1) + AWS_IMAGE=ami-17a76f7a + ;; + + us-gov-west-1) + AWS_IMAGE=ami-b0bad893 + ;; + + ap-southeast-2) + AWS_IMAGE=ami-3895b15b + ;; + + us-west-2) + AWS_IMAGE=ami-d95abcb9 + ;; + + *) + echo "Please specify AWS_IMAGE directly (region ${AWS_REGION} not recognized)" + exit 1 + esac + fi +} + diff --git a/cluster/saltbase/pillar/systemd.sls b/cluster/saltbase/pillar/systemd.sls index 83f4804f0b2..ee847382ab5 100644 --- a/cluster/saltbase/pillar/systemd.sls +++ b/cluster/saltbase/pillar/systemd.sls @@ -1,4 +1,4 @@ -{% if grains['oscodename'] in [ 'vivid', 'jessie' ] %} +{% if grains['oscodename'] in [ 'vivid', 'wily', 'jessie' ] %} is_systemd: True systemd_system_path: /lib/systemd/system {% elif grains['os_family'] == 'RedHat' %} diff --git a/cluster/saltbase/salt/docker/init.sls b/cluster/saltbase/salt/docker/init.sls index e71f1139d7a..62be7baa491 100644 --- a/cluster/saltbase/salt/docker/init.sls +++ b/cluster/saltbase/salt/docker/init.sls @@ -217,6 +217,15 @@ net.ipv4.ip_forward: {% set override_deb='docker-engine_1.8.3-0~vivid_amd64.deb' %} {% set override_deb_url='http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.8.3-0~vivid_amd64.deb' %} {% set override_deb_sha1='f0259b1f04635977325c0cfa7c0006e1e5de1341' %} +{% elif grains.get('cloud', '') == 'aws' + and grains.get('os_family', '') == 'Debian' + and grains.get('oscodename', '') == 'wily' -%} +# TODO: Get from google storage? +{% set docker_pkg_name='docker-engine' %} +{% set override_docker_ver='1.8.3-0~wily' %} +{% set override_deb='docker-engine_1.8.3-0~wily_amd64.deb' %} +{% set override_deb_url='http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.8.3-0~wily_amd64.deb' %} +{% set override_deb_sha1='aa00313498e0e8e73d9eedb39cbdff33b1474c16' %} {% else %} {% set docker_pkg_name='lxc-docker-1.7.1' %} {% set override_docker_ver='1.7.1' %} diff --git a/cluster/saltbase/salt/kubelet/default b/cluster/saltbase/salt/kubelet/default index e92a31a0f9c..b9e111cd258 100644 --- a/cluster/saltbase/salt/kubelet/default +++ b/cluster/saltbase/salt/kubelet/default @@ -117,7 +117,7 @@ {% set kubelet_container= "--kubelet-cgroups=/kubelet" -%} {% endif %} {% endif -%} -{% if grains['oscodename'] == 'vivid' -%} +{% if grains['oscodename'] in ['vivid','wily'] -%} {% set cgroup_root = "--cgroup-root=docker" -%} {% endif -%}