Skip to content

Commit

Permalink
Skip Kubernetes download if the package has exist
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
rootsongjc committed Dec 29, 2018
1 parent ae9cee8 commit 0f5c75f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vagrant/*
.DS_Store
*.tar.gz
kubernetes
3 changes: 1 addition & 2 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ Kubernetes service IP范围:10.254.0.0/16
```bash
git clone https://github.com/rootsongjc/kubernetes-vagrant-centos-cluster.git
cd kubernetes-vagrant-centos-cluster
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz
```

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

使用vagrant启动集群。

Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ Clone this repo into your local machine and download kubernetes binary release f
vagrant plugin install vagrant-winnfsd
git clone https://github.com/rootsongjc/kubernetes-vagrant-centos-cluster.git
cd kubernetes-vagrant-centos-cluster
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz
```

Note: you can find download address of the Kubernetes releases [here](https://kubernetes.io/docs/imported/release/notes/).
**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.

Set up Kubernetes cluster with vagrant.

Expand All @@ -75,8 +74,6 @@ vagrant up

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

**Note**

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.

**Add centos/7 box manually**
Expand Down
5 changes: 2 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ mv /etc/yum.repos.d/CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo
# using socat to port forward in helm tiller
# install kmod and ceph-common for rook
yum install -y wget curl conntrack-tools vim net-tools telnet tcpdump bind-utils socat ntp kmod ceph-common dos2unix

kubernetes_release="kubernetes-server-linux-amd64.tar.gz"
# Download Kubernetes
if [ $(hostname) = "node1" ]
then
if [[ $(hostname) = "node1"] && [ ! -f "$kubernetes_release" ]]; then
wget https://storage.googleapis.com/kubernetes-release/release/v1.11.0/kubernetes-server-linux-amd64.tar.gz -P /vagrant/
fi

Expand Down

0 comments on commit 0f5c75f

Please sign in to comment.