From b8112beb34d75520c420789c6d39d61641cf4f8a Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Sat, 18 Jun 2016 17:00:48 -0400 Subject: [PATCH] AWS kube-up: remove support for vivid Vivid is EOL, and Docker is no longer packaged for it. Remove support for it in 1.3 (in 1.2 we had warned users it was EOL). Also remove unused wheezy, trusty & coreos & do general cleanup. --- cluster/aws/{trusty => common}/common.sh | 0 cluster/aws/coreos/node.yaml | 182 ----------------------- cluster/aws/coreos/util.sh | 55 ------- cluster/aws/jessie/util.sh | 2 +- cluster/aws/options.md | 4 + cluster/aws/trusty/util.sh | 22 --- cluster/aws/util.sh | 81 +--------- cluster/aws/vivid/util.sh | 87 ----------- cluster/aws/wheezy/util.sh | 81 ---------- cluster/aws/wily/util.sh | 2 +- cluster/saltbase/salt/docker/init.sls | 10 -- 11 files changed, 8 insertions(+), 518 deletions(-) rename cluster/aws/{trusty => common}/common.sh (100%) delete mode 100644 cluster/aws/coreos/node.yaml delete mode 100644 cluster/aws/coreos/util.sh delete mode 100644 cluster/aws/trusty/util.sh delete mode 100644 cluster/aws/vivid/util.sh delete mode 100644 cluster/aws/wheezy/util.sh diff --git a/cluster/aws/trusty/common.sh b/cluster/aws/common/common.sh similarity index 100% rename from cluster/aws/trusty/common.sh rename to cluster/aws/common/common.sh diff --git a/cluster/aws/coreos/node.yaml b/cluster/aws/coreos/node.yaml deleted file mode 100644 index aa70ffdf672..00000000000 --- a/cluster/aws/coreos/node.yaml +++ /dev/null @@ -1,182 +0,0 @@ -#cloud-config - -coreos: - units: - - name: kubernetes-install-rkt.service - command: start - content: | - [Unit] - Description=Fetch rkt - Documentation=http://github.com/coreos/rkt - Requires=network-online.target - After=network-online.target - [Service] - Type=oneshot - EnvironmentFile=/etc/kube-env - ExecStartPre=/usr/bin/mkdir -p /opt/rkt - ExecStartPre=/usr/bin/wget \ - -O /opt/rkt/rkt-v${RKT_VERSION}.tar.gz \ - https://github.com/coreos/rkt/releases/download/v${RKT_VERSION}/rkt-v${RKT_VERSION}.tar.gz - ExecStart=/usr/bin/tar xzvf /opt/rkt/rkt-v${RKT_VERSION}.tar.gz -C /opt --overwrite - - - name: hostname-override.service - command: start - content: | - [Unit] - Description=Kubelet Hostname Override - Requires=network-online.target - After=network-online.target - - [Service] - Type=oneshot - RemainAfterExit=yes - EnvironmentFile=/etc/kube-env - ExecStart=/run/setup-hostname-override.sh - - - name: kubernetes-install-minion.service - command: start - content: | - [Unit] - Description=Install Kubernetes Server - Requires=network-online.target - After=network-online.target - - [Service] - Type=oneshot - RemainAfterExit=yes - EnvironmentFile=/etc/kube-env - ExecStartPre=/usr/bin/mkdir -p /opt/kubernetes/pkg - ExecStartPre=/usr/bin/curl --location --create-dirs --output /opt/kubernetes/pkg/kubernetes-server-linux-amd64.tar.gz ${SERVER_BINARY_TAR_URL} - ExecStart=/usr/bin/tar xf /opt/kubernetes/pkg/kubernetes-server-linux-amd64.tar.gz -C /opt --overwrite - - - name: kubelet.service - command: start - content: | - [Unit] - Description=Run Kubelet service - Requires=kubernetes-install-minion.service - After=kubernetes-install-minion.service - Requires=hostname-override.service - After=hostname-override.service - - [Service] - EnvironmentFile=/etc/kube-env - EnvironmentFile=/etc/hostname-override - ExecStartPre=/usr/bin/mkdir -p /etc/kubernetes/manifests - ExecStartPre=/run/setup-auth.sh - ExecStart=/opt/kubernetes/server/bin/kubelet \ - --api-servers=https://${MASTER_IP} \ - --config=/etc/kubernetes/manifests \ - --allow-privileged=False \ - --v=2 \ - --cluster-dns=10.0.0.10 \ - --cluster-domain=${DNS_DOMAIN} \ - --logtostderr=true \ - --hostname-override=${HOSTNAME_OVERRIDE} \ - --container-runtime=${KUBERNETES_CONTAINER_RUNTIME} - Restart=always - RestartSec=10 - KillMode=process - - - name: kube-proxy.service - command: start - content: | - [Unit] - Description=Start Kube-proxy service as Daemon - Requires=kubernetes-install-minion.service - After=kubernetes-install-minion.service - Requires=kubernetes-install-rkt.service - After=kubernetes-install-rkt.service - [Service] - EnvironmentFile=/etc/kube-env - ExecStartPre=/run/config-kube-proxy.sh - ExecStart=/opt/kubernetes/server/bin/kube-proxy \ - --master=https://${MASTER_IP} \ - --kubeconfig=/var/lib/kube-proxy/kubeconfig \ - --v=2 \ - --logtostderr=true \ - --hostname-override=${HOSTNAME_OVERRIDE} - Restart=always - RestartSec=10 - - - name: rkt-metadata.socket - command: start - content: | - [Unit] - Description=rkt metadata service socket - PartOf=rkt-metadata.service - Requires=kubernetes-install-rkt.service - After=kubernetes-install-rkt.service - [Socket] - ListenStream=/run/rkt/metadata-svc.sock - SocketMode=0660 - SocketUser=root - SocketGroup=root - RemoveOnStop=true - - - name: rkt-metadata.service - command: start - content: | - [Unit] - Description=rkt metadata service - Documentation=http://github.com/coreos/rkt - Requires=rkt-metadata.socket - After=network.target rkt-metadata.socket - Requires=kubernetes-install-rkt.service - After=kubernetes-install-rkt.service - [Service] - EnvironmentFile=/etc/kube-env - ExecStart=/opt/rkt-${RKT_VERSION}/rkt metadata-service -write_files: - - path: /run/setup-hostname-override.sh - permissions: "0755" - content: | - #!/bin/bash - set -x - source /etc/kube-env - if [[ -z "${HOSTNAME_OVERRIDE}" ]]; then - HOSTNAME_OVERRIDE=`curl --silent http://169.254.169.254/2007-01-19/meta-data/local-hostname` - fi - if [[ -z "${HOSTNAME_OVERRIDE}" ]]; then - HOSTNAME_OVERRIDE=`hostname -f` - fi - echo "HOSTNAME_OVERRIDE=${HOSTNAME_OVERRIDE}" > /etc/hostname-override - - path: /run/setup-auth.sh - permissions: "0755" - content: | - #!/bin/bash -e - set -x - source /etc/kube-env - - /usr/bin/mkdir -p /var/lib/kubelet - printf '{"BearerToken": "%s", "Insecure": true }' ${KUBE_BEARER_TOKEN} > /var/lib/kubelet/kubernetes_auth - - path: /run/config-kube-proxy.sh - permissions: "0755" - content: | - #!/bin/bash -e - set -x - source /etc/kube-env - - /usr/bin/mkdir -p /var/lib/kube-proxy - cat > /var/lib/kube-proxy/kubeconfig << EOF - apiVersion: v1 - kind: Config - users: - - name: kube-proxy - user: - token: $KUBE_PROXY_TOKEN - clusters: - - name: local - cluster: - insecure-skip-tls-verify: true - contexts: - - context: - cluster: local - user: kube-proxy - name: service-account-context - current-context: service-account-context - EOF - - path: /etc/kube-env - permissions: 0644 - owner: root - content: | diff --git a/cluster/aws/coreos/util.sh b/cluster/aws/coreos/util.sh deleted file mode 100644 index 602cb5e2514..00000000000 --- a/cluster/aws/coreos/util.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/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 CoreOS. - -SSH_USER=core - -function detect-minion-image (){ - if [[ -z "${KUBE_NODE_IMAGE-}" ]]; then - KUBE_NODE_IMAGE=$(curl -s -L http://${COREOS_CHANNEL}.release.core-os.net/amd64-usr/current/coreos_production_ami_all.json | python -c "import json,sys;obj=json.load(sys.stdin);print filter(lambda t: t['name']=='${AWS_REGION}', obj['amis'])[0]['hvm']") - fi - if [[ -z "${KUBE_NODE_IMAGE-}" ]]; then - echo "unable to determine KUBE_NODE_IMAGE" - exit 2 - fi -} - -function generate-minion-user-data() { - - # this is a bit of a hack. We make all of our "variables" in - # our cloud config controlled by env vars from this script - cat ${KUBE_ROOT}/cluster/aws/coreos/node.yaml - cat <&2 - echo "Please consider using wily or jessie instead" >&2 - echo "(will continue in 10 seconds)" >&2 - sleep 10 + echo "vivid is no longer supported by kube-up; please use jessie instead" >&2 + exit 2 ;; coreos) echo "coreos is no longer supported by kube-up; please use jessie instead" >&2 @@ -328,18 +326,9 @@ function detect-security-groups { # AWS_IMAGE function detect-image () { case "${OS_DISTRIBUTION}" in - trusty|coreos) - detect-trusty-image - ;; - vivid) - detect-vivid-image - ;; wily) detect-wily-image ;; - wheezy) - detect-wheezy-image - ;; jessie) detect-jessie-image ;; @@ -350,72 +339,6 @@ case "${OS_DISTRIBUTION}" in esac } -# Detects the AMI to use for trusty (considering the region) -# Used by CoreOS & Ubuntu -# -# Vars set: -# AWS_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 - if [[ -z "${AWS_IMAGE-}" ]]; then - case "${AWS_REGION}" in - ap-northeast-1) - AWS_IMAGE=ami-93876e93 - ;; - - ap-northeast-2) - AWS_IMAGE=ami-62ac620c - ;; - - ap-southeast-1) - AWS_IMAGE=ami-66546234 - ;; - - eu-central-1) - AWS_IMAGE=ami-e2a694ff - ;; - - eu-west-1) - AWS_IMAGE=ami-d7fd6ea0 - ;; - - sa-east-1) - AWS_IMAGE=ami-a357eebe - ;; - - us-east-1) - AWS_IMAGE=ami-6089d208 - ;; - - us-west-1) - AWS_IMAGE=ami-cf7d998b - ;; - - cn-north-1) - AWS_IMAGE=ami-d436a4ed - ;; - - us-gov-west-1) - AWS_IMAGE=ami-01523322 - ;; - - ap-southeast-2) - AWS_IMAGE=ami-cd4e3ff7 - ;; - - us-west-2) - AWS_IMAGE=ami-3b14370b - ;; - - *) - echo "Please specify AWS_IMAGE directly (region ${AWS_REGION} not recognized)" - exit 1 - esac - fi -} - # Detects the RootDevice to use in the Block Device Mapping (considering the AMI) # # Vars set: diff --git a/cluster/aws/vivid/util.sh b/cluster/aws/vivid/util.sh deleted file mode 100644 index f5fcd50f702..00000000000 --- a/cluster/aws/vivid/util.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/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 , 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-ee023e80 - ;; - - ap-northeast-2) - AWS_IMAGE=ami-c2df11ac - ;; - - ap-southeast-1) - AWS_IMAGE=ami-7ad91519 - ;; - - eu-central-1) - AWS_IMAGE=ami-9c7960f0 - ;; - - eu-west-1) - AWS_IMAGE=ami-6a379c19 - ;; - - sa-east-1) - AWS_IMAGE=ami-7d49c811 - ;; - - us-east-1) - AWS_IMAGE=ami-b5bd98df - ;; - - us-west-1) - AWS_IMAGE=ami-b30571d3 - ;; - - cn-north-1) - AWS_IMAGE=ami-4c7ab321 - ;; - - #us-gov-west-1) - # AWS_IMAGE=?Not available? - # ;; - - ap-southeast-2) - AWS_IMAGE=ami-d11431b2 - ;; - - us-west-2) - AWS_IMAGE=ami-58a2b839 - ;; - - *) - echo "Please specify AWS_IMAGE directly (region ${AWS_REGION} not recognized)" - exit 1 - esac - fi -} - diff --git a/cluster/aws/wheezy/util.sh b/cluster/aws/wheezy/util.sh deleted file mode 100644 index 8a72ae4dce7..00000000000 --- a/cluster/aws/wheezy/util.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/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 Wheezy. - -source "${KUBE_ROOT}/cluster/aws/trusty/common.sh" - -SSH_USER=admin - -# Detects the AMI to use for wheezy (considering the region) -# Source: https://wiki.debian.org/Cloud/AmazonEC2Image/Wheezy -# -# Vars set: -# AWS_IMAGE -function detect-wheezy-image () { - if [[ -z "${AWS_IMAGE-}" ]]; then - case "${AWS_REGION}" in - ap-northeast-1) - AWS_IMAGE=ami-b25d44b3 - ;; - - ap-southeast-1) - AWS_IMAGE=ami-aeb49ffc - ;; - - ap-southeast-2) - AWS_IMAGE=ami-6b770351 - ;; - - eu-central-1) - AWS_IMAGE=ami-98043785 - ;; - - eu-west-1) - AWS_IMAGE=ami-61e56916 - ;; - - sa-east-1) - AWS_IMAGE=ami-3d8b3720 - ;; - - us-east-1) - AWS_IMAGE=ami-e0efab88 - ;; - - us-west-1) - AWS_IMAGE=ami-b4869ff1 - ;; - - us-west-2) - AWS_IMAGE=ami-431a4273 - ;; - - us-gov-west-1) - AWS_IMAGE=ami-d13455f2 - ;; - - cn-north-1) - AWS_IMAGE=ami-48029071 - ;; - - *) - echo "Please specify AWS_IMAGE directly (region ${AWS_REGION} not recognized)" - exit 1 - esac - fi -} diff --git a/cluster/aws/wily/util.sh b/cluster/aws/wily/util.sh index af1fba4747c..ff194040fd6 100644 --- a/cluster/aws/wily/util.sh +++ b/cluster/aws/wily/util.sh @@ -15,7 +15,7 @@ # limitations under the License. -source "${KUBE_ROOT}/cluster/aws/trusty/common.sh" +source "${KUBE_ROOT}/cluster/aws/common/common.sh" SSH_USER=ubuntu diff --git a/cluster/saltbase/salt/docker/init.sls b/cluster/saltbase/salt/docker/init.sls index b9008d701a6..55e5f1aadd5 100644 --- a/cluster/saltbase/salt/docker/init.sls +++ b/cluster/saltbase/salt/docker/init.sls @@ -243,16 +243,6 @@ net.ipv4.ip_forward: {% set override_deb_url='http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.11.2-0~trusty_amd64.deb' %} {% set override_deb_sha1='022dee31e68c6d572eaac750915786e4a6729d2a' %} -{% elif grains.get('cloud', '') == 'aws' - and grains.get('os_family', '') == 'Debian' - and grains.get('oscodename', '') == 'vivid' -%} -# TODO: Get from google storage? -{% set docker_pkg_name='docker-engine' %} -{% set override_docker_ver='1.9.1-0~vivid' %} -{% set override_deb='docker-engine_1.9.1-0~vivid_amd64.deb' %} -{% set override_deb_url='http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_1.9.1-0~vivid_amd64.deb' %} -{% set override_deb_sha1='81741f6f16630632de53762c5554238d57b3b9cb' %} - {% elif grains.get('cloud', '') == 'aws' and grains.get('os_family', '') == 'Debian' and grains.get('oscodename', '') == 'wily' -%}