forked from easzlab/kubeasz
-
Notifications
You must be signed in to change notification settings - Fork 1
/
download.sh
106 lines (91 loc) · 3.66 KB
/
download.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash
# This script describes where to download the official released binaries needed
# It's suggested to download the entire *.tar.gz at https://pan.baidu.com/s/1c4RFaA
# example releases
K8S_VER=v1.10.4
ETCD_VER=v3.3.8
DOCKER_VER=17.03.2-ce
CNI_VER=v0.6.0
DOCKER_COMPOSE=1.18.0
HARBOR=v1.5.2
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."
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
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:"
echo https://github.com/vmware/harbor/releases/download/${HARBOR}/harbor-offline-installer-${HARBOR}.tgz
echo "\n----download cni plugins at:"
echo https://github.com/containernetworking/plugins/releases
sleep 30
### prepare 'cfssl' cert tool suit
echo "\nMoving 'cfssl' to 'bin' dir..."
if [ -f "cfssl_linux-amd64" ]; then
mv -f cfssl_linux-amd64 ../bin/cfssl
else
echo Please download 'cfssl' at 'https://pkg.cfssl.org/R1.2/cfssl_linux-amd64'
fi
if [ -f "cfssljson_linux-amd64" ]; then
mv -f cfssljson_linux-amd64 ../bin/cfssljson
else
echo Please download 'cfssljson' at 'https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64'
fi
if [ -f "cfssl-certinfo_linux-amd64" ]; then
mv -f cfssl-certinfo_linux-amd64 ../bin/cfssl-certinfo
else
echo Please download 'cfssl-certinfo' at 'https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64'
fi
### prepare 'etcd' binaries
if [ -f "etcd-${ETCD_VER}-linux-amd64.tar.gz" ]; then
echo "\nextracting etcd binaries..."
tar zxf etcd-${ETCD_VER}-linux-amd64.tar.gz
mv -f etcd-${ETCD_VER}-linux-amd64/etcd* ../bin
else
echo Please download 'etcd-${ETCD_VER}-linux-amd64.tar.gz' first
fi
### prepare kubernetes binaries
if [ -f "kubernetes-server-linux-amd64.tar.gz" ]; then
echo "\nextracting kubernetes binaries..."
tar zxf kubernetes-server-linux-amd64.tar.gz
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
else
echo Please download 'kubernetes-server-linux-amd64.tar.gz' first
fi
### prepare docker binaries
if [ -f "docker-${DOCKER_VER}.tgz" ]; then
echo "\nextracting docker binaries..."
tar zxf docker-${DOCKER_VER}.tgz
mv -f docker/docker* ../bin
if [ -f "docker/completion/bash/docker" ]; then
mv -f docker/completion/bash/docker ../roles/docker/files/docker
fi
else
echo Please download 'docker-${DOCKER_VER}.tgz' first
fi
### prepare cni plugins, needed by flannel;
if [ -f "cni-${CNI_VER}.tgz" ]; then
echo "\nextracting cni plugins binaries..."
tar zxf cni-${CNI_VER}.tgz
mv -f bridge ../bin
mv -f flannel ../bin
mv -f host-local ../bin
mv -f loopback ../bin
mv -f portmap ../bin
else
echo Please download 'cni-${CNI_VER}.tgz' first
fi