2017-11-11 19:14:21 +08:00
|
|
|
|
#!/bin/bash
|
2019-03-19 18:00:54 +08:00
|
|
|
|
# This script describes where to download the official released binaries needed
|
2018-09-29 09:06:19 +08:00
|
|
|
|
# It's suggested to download the entire *.tar.gz at https://pan.baidu.com/s/1c4RFaA
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
2018-09-29 09:06:19 +08:00
|
|
|
|
# example releases
|
2019-03-28 20:49:08 +08:00
|
|
|
|
K8S_VER=v1.13.4
|
2018-09-29 09:06:19 +08:00
|
|
|
|
ETCD_VER=v3.3.8
|
2019-03-28 20:49:08 +08:00
|
|
|
|
DOCKER_VER=18.09.2
|
|
|
|
|
CNI_VER=v0.7.5
|
2018-09-29 09:06:19 +08:00
|
|
|
|
DOCKER_COMPOSE=1.18.0
|
2019-03-28 20:49:08 +08:00
|
|
|
|
HARBOR=v1.5.4
|
2018-09-29 09:06:19 +08:00
|
|
|
|
|
|
|
|
|
echo "\nNote1: Before this script, please finish downloading binaries manually from following urls."
|
|
|
|
|
echo "\nNote2:If binaries are not ready, use `Ctrl + C` to stop this script."
|
2017-11-28 21:13:21 +08:00
|
|
|
|
|
2017-11-11 19:14:21 +08:00
|
|
|
|
echo "\n----download k8s binary at:"
|
|
|
|
|
echo https://dl.k8s.io/${K8S_VER}/kubernetes-server-linux-amd64.tar.gz
|
|
|
|
|
|
|
|
|
|
echo "\n----download etcd binary at:"
|
|
|
|
|
echo https://github.com/coreos/etcd/releases/download/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz
|
|
|
|
|
echo https://storage.googleapis.com/etcd/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz
|
|
|
|
|
|
|
|
|
|
echo "\n----download docker binary at:"
|
|
|
|
|
echo https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz
|
|
|
|
|
|
|
|
|
|
echo "\n----download ca tools at:"
|
|
|
|
|
echo https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
|
|
|
|
|
echo https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
|
|
|
|
|
echo https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64
|
|
|
|
|
|
2017-12-25 15:05:21 +08:00
|
|
|
|
echo "\n----download docker-compose at:"
|
|
|
|
|
echo https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE}/docker-compose-Linux-x86_64
|
|
|
|
|
|
|
|
|
|
echo "\n----download harbor-offline-installer at:"
|
2019-03-26 10:42:38 +08:00
|
|
|
|
echo https://storage.googleapis.com/harbor-releases/harbor-offline-installer-${HARBOR}.tgz
|
2017-12-25 15:05:21 +08:00
|
|
|
|
|
2018-01-07 22:32:14 +08:00
|
|
|
|
echo "\n----download cni plugins at:"
|
2018-02-19 08:35:59 +08:00
|
|
|
|
echo https://github.com/containernetworking/plugins/releases
|
2018-01-07 22:32:14 +08:00
|
|
|
|
|
2017-11-28 21:13:21 +08:00
|
|
|
|
sleep 30
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
2018-09-29 09:06:19 +08:00
|
|
|
|
### prepare 'cfssl' cert tool suit
|
|
|
|
|
echo "\nMoving 'cfssl' to 'bin' dir..."
|
2017-11-11 19:14:21 +08:00
|
|
|
|
if [ -f "cfssl_linux-amd64" ]; then
|
2018-02-19 08:35:59 +08:00
|
|
|
|
mv -f cfssl_linux-amd64 ../bin/cfssl
|
2017-11-11 19:14:21 +08:00
|
|
|
|
else
|
2018-09-29 09:06:19 +08:00
|
|
|
|
echo Please download 'cfssl' at 'https://pkg.cfssl.org/R1.2/cfssl_linux-amd64'
|
2017-11-11 19:14:21 +08:00
|
|
|
|
fi
|
|
|
|
|
if [ -f "cfssljson_linux-amd64" ]; then
|
2018-02-19 08:35:59 +08:00
|
|
|
|
mv -f cfssljson_linux-amd64 ../bin/cfssljson
|
2017-11-11 19:14:21 +08:00
|
|
|
|
else
|
2018-09-29 09:06:19 +08:00
|
|
|
|
echo Please download 'cfssljson' at 'https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64'
|
2017-11-11 19:14:21 +08:00
|
|
|
|
fi
|
|
|
|
|
if [ -f "cfssl-certinfo_linux-amd64" ]; then
|
2018-02-19 08:35:59 +08:00
|
|
|
|
mv -f cfssl-certinfo_linux-amd64 ../bin/cfssl-certinfo
|
2017-11-11 19:14:21 +08:00
|
|
|
|
else
|
2018-09-29 09:06:19 +08:00
|
|
|
|
echo Please download 'cfssl-certinfo' at 'https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64'
|
2017-11-11 19:14:21 +08:00
|
|
|
|
fi
|
|
|
|
|
|
2018-09-29 09:06:19 +08:00
|
|
|
|
### prepare 'etcd' binaries
|
2017-11-11 19:14:21 +08:00
|
|
|
|
if [ -f "etcd-${ETCD_VER}-linux-amd64.tar.gz" ]; then
|
|
|
|
|
echo "\nextracting etcd binaries..."
|
|
|
|
|
tar zxf etcd-${ETCD_VER}-linux-amd64.tar.gz
|
2018-02-19 08:35:59 +08:00
|
|
|
|
mv -f etcd-${ETCD_VER}-linux-amd64/etcd* ../bin
|
2017-11-11 19:14:21 +08:00
|
|
|
|
else
|
2018-09-29 09:06:19 +08:00
|
|
|
|
echo Please download 'etcd-${ETCD_VER}-linux-amd64.tar.gz' first
|
2017-11-11 19:14:21 +08:00
|
|
|
|
fi
|
|
|
|
|
|
2018-09-29 09:06:19 +08:00
|
|
|
|
### prepare kubernetes binaries
|
2017-11-11 19:14:21 +08:00
|
|
|
|
if [ -f "kubernetes-server-linux-amd64.tar.gz" ]; then
|
|
|
|
|
echo "\nextracting kubernetes binaries..."
|
|
|
|
|
tar zxf kubernetes-server-linux-amd64.tar.gz
|
2018-02-19 08:35:59 +08:00
|
|
|
|
mv -f kubernetes/server/bin/kube-apiserver ../bin
|
|
|
|
|
mv -f kubernetes/server/bin/kube-controller-manager ../bin
|
|
|
|
|
mv -f kubernetes/server/bin/kubectl ../bin
|
|
|
|
|
mv -f kubernetes/server/bin/kubelet ../bin
|
|
|
|
|
mv -f kubernetes/server/bin/kube-proxy ../bin
|
|
|
|
|
mv -f kubernetes/server/bin/kube-scheduler ../bin
|
2017-11-11 19:14:21 +08:00
|
|
|
|
else
|
2018-09-29 09:06:19 +08:00
|
|
|
|
echo Please download 'kubernetes-server-linux-amd64.tar.gz' first
|
2017-11-11 19:14:21 +08:00
|
|
|
|
fi
|
|
|
|
|
|
2018-09-29 09:06:19 +08:00
|
|
|
|
### prepare docker binaries
|
2017-11-11 19:14:21 +08:00
|
|
|
|
if [ -f "docker-${DOCKER_VER}.tgz" ]; then
|
|
|
|
|
echo "\nextracting docker binaries..."
|
|
|
|
|
tar zxf docker-${DOCKER_VER}.tgz
|
2018-02-19 08:35:59 +08:00
|
|
|
|
mv -f docker/docker* ../bin
|
2017-11-11 19:14:21 +08:00
|
|
|
|
if [ -f "docker/completion/bash/docker" ]; then
|
2018-01-05 23:05:22 +08:00
|
|
|
|
mv -f docker/completion/bash/docker ../roles/docker/files/docker
|
2017-11-11 19:14:21 +08:00
|
|
|
|
fi
|
|
|
|
|
else
|
2019-03-19 18:00:54 +08:00
|
|
|
|
echo Please download 'docker-${DOCKER_VER}.tgz' first
|
2017-11-11 19:14:21 +08:00
|
|
|
|
fi
|
2018-01-07 22:32:14 +08:00
|
|
|
|
|
2018-09-29 09:06:19 +08:00
|
|
|
|
### prepare cni plugins, needed by flannel;
|
2018-01-07 22:32:14 +08:00
|
|
|
|
if [ -f "cni-${CNI_VER}.tgz" ]; then
|
|
|
|
|
echo "\nextracting cni plugins binaries..."
|
|
|
|
|
tar zxf cni-${CNI_VER}.tgz
|
2018-02-19 08:35:59 +08:00
|
|
|
|
mv -f bridge ../bin
|
|
|
|
|
mv -f flannel ../bin
|
|
|
|
|
mv -f host-local ../bin
|
|
|
|
|
mv -f loopback ../bin
|
|
|
|
|
mv -f portmap ../bin
|
2018-01-07 22:32:14 +08:00
|
|
|
|
else
|
2019-03-19 18:00:54 +08:00
|
|
|
|
echo Please download 'cni-${CNI_VER}.tgz' first
|
2018-01-07 22:32:14 +08:00
|
|
|
|
fi
|