mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	AWS kube-up: Clean up distro handling
The only tested-working distros are vivid, wily & jessie. vivid should not really be used because it is no longer supported, so recommend wily or jessie instead. For other distros, recommend jessie instead. Fix #21218
This commit is contained in:
		@@ -49,24 +49,51 @@ MASTER_DISK_ID=
 | 
				
			|||||||
# Well known tags
 | 
					# Well known tags
 | 
				
			||||||
TAG_KEY_MASTER_IP="kubernetes.io/master-ip"
 | 
					TAG_KEY_MASTER_IP="kubernetes.io/master-ip"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Defaults: ubuntu -> wily
 | 
					 | 
				
			||||||
if [[ "${KUBE_OS_DISTRIBUTION}" == "ubuntu" ]]; then
 | 
					 | 
				
			||||||
  KUBE_OS_DISTRIBUTION=wily
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# For GCE script compatibility
 | 
					 | 
				
			||||||
OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION}
 | 
					OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
case "${KUBE_OS_DISTRIBUTION}" in
 | 
					# Defaults: ubuntu -> wily
 | 
				
			||||||
  trusty|wheezy|jessie|vivid|wily|coreos)
 | 
					if [[ "${OS_DISTRIBUTION}" == "ubuntu" ]]; then
 | 
				
			||||||
    source "${KUBE_ROOT}/cluster/aws/${KUBE_OS_DISTRIBUTION}/util.sh"
 | 
					  OS_DISTRIBUTION=wily
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Loads the distro-specific utils script.
 | 
				
			||||||
 | 
					# If the distro is not recommended, prints warnings or exits.
 | 
				
			||||||
 | 
					function load_distro_utils () {
 | 
				
			||||||
 | 
					case "${OS_DISTRIBUTION}" in
 | 
				
			||||||
 | 
					  jessie)
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
 | 
					  wily)
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
 | 
					  vivid)
 | 
				
			||||||
 | 
					    echo "vivid is currently end-of-life and does not get updates." >&2
 | 
				
			||||||
 | 
					    echo "Please consider using wily or jessie instead" >&2
 | 
				
			||||||
 | 
					    echo "(will continue in 10 seconds)" >&2
 | 
				
			||||||
 | 
					    sleep 10
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
 | 
					  coreos)
 | 
				
			||||||
 | 
					    echo "coreos is no longer supported by kube-up; please use jessie instead" >&2
 | 
				
			||||||
 | 
					    exit 2
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
 | 
					  trusty)
 | 
				
			||||||
 | 
					    echo "trusty is no longer supported by kube-up; please use jessie or wily instead" >&2
 | 
				
			||||||
 | 
					    exit 2
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
 | 
					  wheezy)
 | 
				
			||||||
 | 
					    echo "wheezy is no longer supported by kube-up; please use jessie instead" >&2
 | 
				
			||||||
 | 
					    exit 2
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
  *)
 | 
					  *)
 | 
				
			||||||
    echo "Cannot start cluster using os distro: ${KUBE_OS_DISTRIBUTION}" >&2
 | 
					    echo "Cannot start cluster using os distro: ${OS_DISTRIBUTION}" >&2
 | 
				
			||||||
 | 
					    echo "The current recommended distro is jessie" >&2
 | 
				
			||||||
    exit 2
 | 
					    exit 2
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					source "${KUBE_ROOT}/cluster/aws/${OS_DISTRIBUTION}/util.sh"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					load_distro_utils
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This removes the final character in bash (somehow)
 | 
					# This removes the final character in bash (somehow)
 | 
				
			||||||
AWS_REGION=${ZONE%?}
 | 
					AWS_REGION=${ZONE%?}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -266,7 +293,7 @@ function detect-security-groups {
 | 
				
			|||||||
# Vars set:
 | 
					# Vars set:
 | 
				
			||||||
#   AWS_IMAGE
 | 
					#   AWS_IMAGE
 | 
				
			||||||
function detect-image () {
 | 
					function detect-image () {
 | 
				
			||||||
case "${KUBE_OS_DISTRIBUTION}" in
 | 
					case "${OS_DISTRIBUTION}" in
 | 
				
			||||||
  trusty|coreos)
 | 
					  trusty|coreos)
 | 
				
			||||||
    detect-trusty-image
 | 
					    detect-trusty-image
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
@@ -283,7 +310,7 @@ case "${KUBE_OS_DISTRIBUTION}" in
 | 
				
			|||||||
    detect-jessie-image
 | 
					    detect-jessie-image
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
  *)
 | 
					  *)
 | 
				
			||||||
    echo "Please specify AWS_IMAGE directly (distro ${KUBE_OS_DISTRIBUTION} not recognized)"
 | 
					    echo "Please specify AWS_IMAGE directly (distro ${OS_DISTRIBUTION} not recognized)"
 | 
				
			||||||
    exit 2
 | 
					    exit 2
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
@@ -834,7 +861,7 @@ function subnet-setup {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function kube-up {
 | 
					function kube-up {
 | 
				
			||||||
  echo "Starting cluster using os distro: ${KUBE_OS_DISTRIBUTION}" >&2
 | 
					  echo "Starting cluster using os distro: ${OS_DISTRIBUTION}" >&2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  get-tokens
 | 
					  get-tokens
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user