Skip to content

Commit

Permalink
Drop k8s 1.7 + broken/unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Shvedunov committed Apr 24, 2018
1 parent effba5c commit e5f5062
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 1,901 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ services: docker
language: minimal

env:
- TEST_CASE=1.7
- TEST_CASE=1.7-flannel
- TEST_CASE=1.7-calico
- TEST_CASE=1.7-calico-kdd
- TEST_CASE=1.7-weave
- TEST_CASE=1.8
- TEST_CASE=1.8-flannel
- TEST_CASE=1.8-calico
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ Docker 1.12+ is recommended. If you're not using one of the
preconfigured scripts (see below) and not building from source, it's
better to have `kubectl` executable in your path matching the
version of k8s binaries you're using (i.e. for example better don't
use `kubectl` 1.8.x with `hyperkube` 1.7.x).
use `kubectl` 1.10.x with `hyperkube` 1.9.x).

`kubeadm-dind-cluster` supports k8s versions 1.7.x (tested with 1.7.12),
1.8.x (tested with 1.8.6) and 1.9.x (tested with 1.9.1).
`kubeadm-dind-cluster` supports k8s versions 1.8.x, 1.9.x and 1.10.x.

**As of now, running `kubeadm-dind-cluster` on Docker with `btrfs`
storage driver is not supported.**
Expand All @@ -49,7 +48,7 @@ work.

## Using preconfigured scripts
`kubeadm-dind-cluster` currently provides preconfigured scripts for
Kubernetes 1.7, 1.8 and 1.9. This may be convenient for use with
Kubernetes 1.8, 1.9 and 1.10. This may be convenient for use with
projects that extend or use Kubernetes. For example, you can start
Kubernetes 1.8 like this:

Expand Down Expand Up @@ -81,7 +80,7 @@ $ # remove DIND containers and volumes
$ ./dind-cluster-v1.8.sh clean
```

Replace 1.8 with 1.7 or 1.9 to use other Kubernetes versions.
Replace 1.8 with 1.9 or 1.10 to use other Kubernetes versions.
**Important note:** you need to do `./dind-cluster....sh clean` when
you switch between Kubernetes versions (but no need to do this between
rebuilds if you use `BUILD_HYPERKUBE=y` like described below).
Expand Down
57 changes: 31 additions & 26 deletions build/buildconf.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
# Version 1.7.15
KUBEADM_URL_1_7='https://storage.googleapis.com/kubernetes-release/release/v1.7.15/bin/linux/amd64/kubeadm'
KUBEADM_SHA1_1_7=b7f12f329192d37386ace277edd816b034b7f8ee
HYPERKUBE_URL_1_7='https://storage.googleapis.com/kubernetes-release/release/v1.7.15/bin/linux/amd64/hyperkube'
HYPERKUBE_SHA1_1_7=86aab83667820d0444a3c4d7dc5ed5788237f91d
# Version 1.8.11
KUBEADM_URL_1_8='https://storage.googleapis.com/kubernetes-release/release/v1.8.11/bin/linux/amd64/kubeadm'
KUBEADM_SHA1_1_8=dbdbaf6f31dc1111b38a80fa8af29024924d1fc0
HYPERKUBE_URL_1_8='https://storage.googleapis.com/kubernetes-release/release/v1.8.11/bin/linux/amd64/hyperkube'
HYPERKUBE_SHA1_1_8=cbcb32519807c15cf1a55efb86ff3b22ddf28eb9
KUBECTL_URL_1_8='https://storage.googleapis.com/kubernetes-release/release/v1.8.11/bin/linux/amd64/kubectl'
KUBECTL_SHA1_1_8=6a089bec1802611ad9f5120c486a6e0e00095279
KUBECTL_DARWIN_URL_1_8='https://storage.googleapis.com/kubernetes-release/release/v1.8.11/bin/darwin/amd64/kubectl'
KUBECTL_DARWIN_SHA1_1_8=d0b4c54e65b66e106758a84cddb6a5528527b017

# Version 1.8.10
KUBEADM_URL_1_8='https://storage.googleapis.com/kubernetes-release/release/v1.8.10/bin/linux/amd64/kubeadm'
KUBEADM_SHA1_1_8=61a87be3c3aca1e0c40ca6e0a975bdbce15eb3f1
HYPERKUBE_URL_1_8='https://storage.googleapis.com/kubernetes-release/release/v1.8.10/bin/linux/amd64/hyperkube'
HYPERKUBE_SHA1_1_8=59c85373484ff70291f8bc706c4440fe8d96ce52

# Version 1.9.6
KUBEADM_URL_1_9='https://storage.googleapis.com/kubernetes-release/release/v1.9.6/bin/linux/amd64/kubeadm'
KUBEADM_SHA1_1_9=3eba73297aac155bcebc9d006eb1ca0cf7ff86f0
HYPERKUBE_URL_1_9='https://storage.googleapis.com/kubernetes-release/release/v1.9.6/bin/linux/amd64/hyperkube'
HYPERKUBE_SHA1_1_9=f456848d59eb7e42f59f9d11d46804ee43e6abd8

# Version 1.10.0
KUBEADM_URL_1_10='https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubeadm'
KUBEADM_SHA1_1_10=ba8ba627c1b3eb576835098ce41c1c9895bbbcee
HYPERKUBE_URL_1_10='https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/hyperkube'
HYPERKUBE_SHA1_1_10=38a2c236a67d0ccbb3ac9404ace6a2705341fb7a
# Version 1.9.7
KUBEADM_URL_1_9='https://storage.googleapis.com/kubernetes-release/release/v1.9.7/bin/linux/amd64/kubeadm'
KUBEADM_SHA1_1_9=794841e3f05ccd7f6b6759d487beb14cf4812273
HYPERKUBE_URL_1_9='https://storage.googleapis.com/kubernetes-release/release/v1.9.7/bin/linux/amd64/hyperkube'
HYPERKUBE_SHA1_1_9=79b333a44c20c5f8c40d45e09fa0898b88665dd5
KUBECTL_URL_1_9='https://storage.googleapis.com/kubernetes-release/release/v1.9.7/bin/linux/amd64/kubectl'
KUBECTL_SHA1_1_9=7425dbf67007cee328b85da3bf5155d01d3939e2
KUBECTL_DARWIN_URL_1_9='https://storage.googleapis.com/kubernetes-release/release/v1.9.7/bin/darwin/amd64/kubectl'
KUBECTL_DARWIN_SHA1_1_9=b9f6122fe29dd29fff01194cc00a40a5451581fd

# Version 1.10.1
KUBEADM_URL_1_10='https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/linux/amd64/kubeadm'
KUBEADM_SHA1_1_10=c66a5c0baf77f37534dbc1624c8bd19045726b68
HYPERKUBE_URL_1_10='https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/linux/amd64/hyperkube'
HYPERKUBE_SHA1_1_10=8dc20c079f2caf3a362047e1aa674a177e8a4fb5
KUBECTL_URL_1_10='https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/linux/amd64/kubectl'
KUBECTL_SHA1_1_10=a5c8e589bed21ec471e8c582885a8c9972a84da1
KUBECTL_DARWIN_URL_1_10='https://storage.googleapis.com/kubernetes-release/release/v1.10.1/bin/darwin/amd64/kubectl'
KUBECTL_DARWIN_SHA1_1_10=e869ab8298bd92056b23568343ebd4a6c84f9817
# url and sha1sum of kubeadm binary -- only used for prebuilt kubeadm
KUBEADM_URL=${KUBEADM_URL:-${KUBEADM_URL_1_9}}
KUBEADM_SHA1=${KUBEADM_SHA1:-${KUBEADM_SHA1_1_9}}
KUBEADM_URL=${KUBEADM_URL:-${KUBEADM_URL_1_10}}
KUBEADM_SHA1=${KUBEADM_SHA1:-${KUBEADM_SHA1_1_10}}

# url and sha1sum of hyperkube binary -- only used for prebuilt hyperkube
HYPERKUBE_URL=${HYPERKUBE_URL:-${HYPERKUBE_URL_1_9}}
HYPERKUBE_SHA1=${HYPERKUBE_SHA1:-${HYPERKUBE_SHA1_1_9}}
HYPERKUBE_URL=${HYPERKUBE_URL:-${HYPERKUBE_URL_1_10}}
HYPERKUBE_SHA1=${HYPERKUBE_SHA1:-${HYPERKUBE_SHA1_1_10}}
2 changes: 1 addition & 1 deletion build/genfixed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DIND_ROOT=$(dirname "${BASH_SOURCE}")/..

fixed_dir="${DIND_ROOT}/fixed"
mkdir -p "${fixed_dir}"
for tag in v1.7 v1.8 v1.9 v1.10; do
for tag in v1.8 v1.9 v1.10; do
dest="${fixed_dir}/dind-cluster-${tag}.sh"
sed "s@#%CONFIG%@EMBEDDED_CONFIG=y;DIND_IMAGE=mirantis/kubeadm-dind-cluster:${tag}@" \
"${DIND_ROOT}/dind-cluster.sh" >"${dest}"
Expand Down
20 changes: 12 additions & 8 deletions build/genvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,26 @@ set -o nounset
set -o pipefail
set -o errtrace

VERSIONS=(1.7.15 1.8.10 1.9.6 1.10.0)
VERSIONS=(1.8.11 1.9.7 1.10.1)

first=1
for version in ${VERSIONS[@]}; do
base_url="https://storage.googleapis.com/kubernetes-release/release/v${version}/bin/linux/amd64"
base_url="https://storage.googleapis.com/kubernetes-release/release/v${version}/bin"
linux_url="${base_url}/linux/amd64"
darwin_url="${base_url}/darwin/amd64"
if [[ ${first} ]]; then
first=
else
echo
fi
echo "# Version ${version}"
suffix="$(tr .- _ <<<"${version}" | sed 's/^\([0-9]*_[0-9]*\).*/\1/')"
if [[ ! (${version} =~ ^1\.4\.) ]]; then
echo "KUBEADM_URL_${suffix}='${base_url}/kubeadm'"
echo "KUBEADM_SHA1_${suffix}=$(curl -sSL "${base_url}/kubeadm.sha1")"
fi
echo "HYPERKUBE_URL_${suffix}='${base_url}/hyperkube'"
echo "HYPERKUBE_SHA1_${suffix}=$(curl -sSL "${base_url}/hyperkube.sha1")"
echo "KUBEADM_URL_${suffix}='${linux_url}/kubeadm'"
echo "KUBEADM_SHA1_${suffix}=$(curl -sSL "${linux_url}/kubeadm.sha1")"
echo "HYPERKUBE_URL_${suffix}='${linux_url}/hyperkube'"
echo "HYPERKUBE_SHA1_${suffix}=$(curl -sSL "${linux_url}/hyperkube.sha1")"
echo "KUBECTL_URL_${suffix}='${linux_url}/kubectl'"
echo "KUBECTL_SHA1_${suffix}=$(curl -sSL "${linux_url}/kubectl.sha1")"
echo "KUBECTL_DARWIN_URL_${suffix}='${darwin_url}/kubectl'"
echo "KUBECTL_DARWIN_SHA1_${suffix}=$(curl -sSL "${darwin_url}/kubectl.sha1")"
done
4 changes: 2 additions & 2 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ NUM_NODES=${NUM_NODES:-2}
# KUBEADM_DIND_LOCAL=

# Use prebuilt DIND image
DIND_IMAGE="${DIND_IMAGE:-mirantis/kubeadm-dind-cluster:v1.8}"
DIND_IMAGE="${DIND_IMAGE:-mirantis/kubeadm-dind-cluster:v1.10}"

# Set to non-empty string to enable building kubeadm
# BUILD_KUBEADM=y
Expand All @@ -29,7 +29,7 @@ DIND_IMAGE="${DIND_IMAGE:-mirantis/kubeadm-dind-cluster:v1.8}"
# download kubectl on the host
# Set automatically based on DIND image version tag
# if image version tag is of the form vNNN.NNN
# LOCAL_KUBECTL_VERSION="${LOCAL_KUBECTL_VERSION:-v1.7}"
# LOCAL_KUBECTL_VERSION="${LOCAL_KUBECTL_VERSION:-v1.10}"

# Set custom URL for Dashboard yaml file
# DASHBOARD_URL="${DASHBOARD_URL:-https://rawgit.com/kubernetes/dashboard/bfab10151f012d1acc5dfb1979f3172e2400aa3c/src/deploy/kubernetes-dashboard.yaml}"
Expand Down
93 changes: 35 additions & 58 deletions dind-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -384,25 +384,20 @@ function dind::ensure-downloaded-kubectl {
local full_kubectl_version

case "${LOCAL_KUBECTL_VERSION}" in
v1.7)
full_kubectl_version=v1.7.15
kubectl_sha1_linux=f4bd9f71af5cbd6c0a84ad50c07db3206bf04d13
kubectl_sha1_darwin=505e5561d3fbd18360037f47f587f6d7519ddf86
;;
v1.8)
full_kubectl_version=v1.8.10
kubectl_sha1_linux=1164e216945102901499d7bf839ed293beb714c2
kubectl_sha1_darwin=59c85373484ff70291f8bc706c4440fe8d96ce52
full_kubectl_version=v1.8.11
kubectl_sha1_linux=6a089bec1802611ad9f5120c486a6e0e00095279
kubectl_sha1_darwin=d0b4c54e65b66e106758a84cddb6a5528527b017
;;
v1.9)
full_kubectl_version=v1.9.6
kubectl_sha1_linux=04d344ac9b2a6514f0d94c2df79073e42d6c1182
kubectl_sha1_darwin=eb9e2f7978a94c433a2d27432cfd8dd77fb5997e
full_kubectl_version=v1.9.7
kubectl_sha1_linux=7425dbf67007cee328b85da3bf5155d01d3939e2
kubectl_sha1_darwin=b9f6122fe29dd29fff01194cc00a40a5451581fd
;;
v1.10)
full_kubectl_version=v1.10.0
kubectl_sha1_linux=7a17e4f1b7f084b49771467ed16859bc46508eae
kubectl_sha1_darwin=367ae1a818660f673212a65965ca9bfd2cdf109e
full_kubectl_version=v1.10.1
kubectl_sha1_linux=a5c8e589bed21ec471e8c582885a8c9972a84da1
kubectl_sha1_darwin=e869ab8298bd92056b23568343ebd4a6c84f9817
;;
"")
return 0
Expand Down Expand Up @@ -728,14 +723,6 @@ function dind::set-master-opts {
fi
}

cached_k8s_version=
function dind::k8s-version {
if [[ ! ${cached_k8s_version} ]]; then
cached_k8s_version="$("${kubectl}" version --short | grep 'Server Version' | sed 's/.*: v\|\.[0-9]*$//g')"
fi
echo "${cached_k8s_version}"
}

function dind::ensure-dashboard-clusterrolebinding {
# 'create' may cause etcd timeout, yet create the clusterrolebinding.
# So use 'apply' to actually create it
Expand All @@ -755,15 +742,6 @@ function dind::deploy-dashboard {
dind::retry dind::ensure-dashboard-clusterrolebinding
}

function dind::at-least-kubeadm-1-8 {
# kubeadm 1.6 and below doesn't support 'version -o short' and will
# thus produce an empty string
local ver="$(docker exec kube-master kubeadm version -o short 2>/dev/null|sed 's/^\(v[0-9]*\.[0-9]*\).*$/\1/')"
if [[ ! ${ver} || ${ver} = v1.7 ]]; then
return 1
fi
}

function dind::init {
local -a opts
dind::set-master-opts
Expand All @@ -775,47 +753,46 @@ function dind::init {
# FIXME: I tried using custom tokens with 'kubeadm ex token create' but join failed with:
# 'failed to parse response as JWS object [square/go-jose: compact JWS format must have three parts]'
# So we just pick the line from 'kubeadm init' output
if dind::at-least-kubeadm-1-8; then
# Using a template file in the image to build a kubeadm.conf file and to customize
# it based on CNI plugin, IP mode, and environment settings. User can add additional
# customizations to template and then rebuild the image used (build/build-local.sh).
local pod_subnet_disable="# "
# TODO: May want to specify each of the plugins that require --pod-network-cidr
if [[ ${CNI_PLUGIN} != "bridge" ]]; then
pod_subnet_disable=""
fi
local bind_address="0.0.0.0"
if [[ ${IP_MODE} = "ipv6" ]]; then
bind_address="::"
fi
dind::proxy kube-master
dind::custom-docker-opts kube-master
# Using a template file in the image to build a kubeadm.conf file and to customize
# it based on CNI plugin, IP mode, and environment settings. User can add additional
# customizations to template and then rebuild the image used (build/build-local.sh).
local pod_subnet_disable="# "
# TODO: May want to specify each of the plugins that require --pod-network-cidr
if [[ ${CNI_PLUGIN} != "bridge" ]]; then
pod_subnet_disable=""
fi
local bind_address="0.0.0.0"
if [[ ${IP_MODE} = "ipv6" ]]; then
bind_address="::"
fi
dind::proxy kube-master
dind::custom-docker-opts kube-master

# HACK: Indicating mode, so that wrapkubeadm will not set a cluster CIDR for kube-proxy
# in IPv6 (only) mode.
if [[ ${IP_MODE} = "ipv6" ]]; then
docker exec --privileged -i kube-master touch /v6-mode
fi
# HACK: Indicating mode, so that wrapkubeadm will not set a cluster CIDR for kube-proxy
# in IPv6 (only) mode.
if [[ ${IP_MODE} = "ipv6" ]]; then
docker exec --privileged -i kube-master touch /v6-mode
fi

docker exec --privileged -i kube-master bash <<EOF
docker exec --privileged -i kube-master bash <<EOF
sed -e "s|{{ADV_ADDR}}|${kube_master_ip}|" \
-e "s|{{POD_SUBNET_DISABLE}}|${pod_subnet_disable}|" \
-e "s|{{POD_NETWORK_CIDR}}|${POD_NETWORK_CIDR}|" \
-e "s|{{SVC_SUBNET}}|${SERVICE_CIDR}|" \
-e "s|{{BIND_ADDR}}|${bind_address}|" \
/etc/kubeadm.conf.tmpl > /etc/kubeadm.conf
EOF
if [[ ${DNS_SERVICE} == "coredns" ]]; then
docker exec -i kube-master /bin/sh -c "cat >>/etc/kubeadm.conf" <<EOF
if [[ ${DNS_SERVICE} == "coredns" ]]; then
docker exec -i kube-master /bin/sh -c "cat >>/etc/kubeadm.conf" <<EOF
featureGates:
CoreDNS: true
EOF
fi
init_args=(--config /etc/kubeadm.conf)
else
init_args=(--pod-network-cidr="${POD_NETWORK_CIDR}")
fi
# TODO: --skip-preflight-checks needs to be replaced with
# --ignore-preflight-errors=all for k8s 1.10+
# (need to check k8s 1.9)
init_args=(--config /etc/kubeadm.conf)
# required when building from source
if [[ ${BUILD_KUBEADM} || ${BUILD_HYPERKUBE} ]]; then
docker exec kube-master mount --make-shared /k8s
Expand Down
Loading

0 comments on commit e5f5062

Please sign in to comment.