Skip to content

Commit 0f5c75f

Browse files
committed
Skip Kubernetes download if the package has exist
- Untrack Kubernetes folder, it is the unzip folder of Kubernetes release - Update README, add notice about Kubernetes release download - Detect whether the Kubernetes package exist before download
1 parent ae9cee8 commit 0f5c75f

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.vagrant/*
22
.DS_Store
33
*.tar.gz
4+
kubernetes

README-cn.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,9 @@ Kubernetes service IP范围:10.254.0.0/16
5959
```bash
6060
git clone https://github.com/rootsongjc/kubernetes-vagrant-centos-cluster.git
6161
cd kubernetes-vagrant-centos-cluster
62-
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz
6362
```
6463

65-
注:您可以在[这里](https://kubernetes.io/docs/imported/release/notes/)找到Kubernetes的发行版下载地址。
64+
注:如果您是第一次运行该部署程序,那么可以直接执行下面的命令,它将自动帮你下载 Kubernetes 安装包,下一次你就不需要自己下载了,另外您也可以在[这里](https://kubernetes.io/docs/imported/release/notes/)找到Kubernetes的发行版下载地址,下载 Kubernetes发行版后重命名为`kubernetes-server-linux-amd64.tar.gz`,并移动到该项目的根目录下
6665

6766
使用vagrant启动集群。
6867

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ Clone this repo into your local machine and download kubernetes binary release f
6262
vagrant plugin install vagrant-winnfsd
6363
git clone https://github.com/rootsongjc/kubernetes-vagrant-centos-cluster.git
6464
cd kubernetes-vagrant-centos-cluster
65-
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz
6665
```
6766

68-
Note: you can find download address of the Kubernetes releases [here](https://kubernetes.io/docs/imported/release/notes/).
67+
**Note**: If this your first time to setup Kubernetes cluster with vagrant, just skip the above step and run the following command, it will download Kubernetes release automatically for you and no need to download the release next time. You can find the download address the Kubernetes releases [here](https://kubernetes.io/docs/imported/release/notes/). Download the release of version you wanted, move it to the root of this repo, rename it to `kubernetes-server-linux-amd64.tar.gz` then the `install.sh` script will skip the download step.
6968

7069
Set up Kubernetes cluster with vagrant.
7170

@@ -75,8 +74,6 @@ vagrant up
7574

7675
Wait about 10 minutes the kubernetes cluster will be setup automatically.
7776

78-
**Note**
79-
8077
If you have difficult to vagrant up the cluster because of have no way to downlaod the `centos/7` box, you can download the box and add it first.
8178

8279
**Add centos/7 box manually**

install.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ mv /etc/yum.repos.d/CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo
88
# using socat to port forward in helm tiller
99
# install kmod and ceph-common for rook
1010
yum install -y wget curl conntrack-tools vim net-tools telnet tcpdump bind-utils socat ntp kmod ceph-common dos2unix
11-
11+
kubernetes_release="kubernetes-server-linux-amd64.tar.gz"
1212
# Download Kubernetes
13-
if [ $(hostname) = "node1" ]
14-
then
13+
if [[ $(hostname) = "node1"] && [ ! -f "$kubernetes_release" ]]; then
1514
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz -P /vagrant/
1615
fi
1716

0 commit comments

Comments
 (0)