From 3b6e15310f087c3a24cd8d5bd793875017517d8a Mon Sep 17 00:00:00 2001 From: zhanglikun Date: Fri, 2 Feb 2024 17:53:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BD=E5=86=85=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++++++- download.sh | 36 ++++++++++++++++++++++++++---------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 553eba3..63b50df 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,13 @@ # offline-kubernetes-install -完全离线的情况下, 安装k8s集群, 基于 CentOS7, k8s 1.21.10 版本, 容器运行时 是docker, 安装工具是kubeadm, 全部采用容器化或者rpm包的形式部署, 坚决不使用二进制。 + +## 项目特点 +基于 CentOS7, k8s 1.21.10 版本 + +- 完全离线的情况下, 安装k8s集群 +- 容器运行时为 docker +- 安装工具为 kubeadm +- 全部采用容器化或者rpm包的形式部署 +- 支持使用国内源进行下载 ## 系统要求 diff --git a/download.sh b/download.sh index 7bdf772..9c898cd 100755 --- a/download.sh +++ b/download.sh @@ -1,17 +1,33 @@ #!/bin/bash set -euo pipefail +source .env + cd temp/ -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/docker-ce-20.10.23-3.el7.x86_64/docker-ce-20.10.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/flannel/flannel.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/ingress-nginx/ingress-nginx.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/kernel_5.4/kernel_5.4.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/kubeadm_images/kubeadm_images.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/kubeadm_rpms/kubeadm_rpms.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/keepalived/keepalived.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/bash-completion/bash-completion-2.1-8.el7.noarch.rpm -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/git/git-2.31.1.tar.gz -curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/rsync/rsync-3.1.2-12.el7_9.x86_64.rpm + +if [ x${USE_CHINA_MIRROR} == "xyes" ]; then + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/docker-ce/docker-ce-20.10.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/flannel/flannel.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/ingress-nginx/ingress-nginx.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/kernel_5.4/kernel_5.4.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/kubeadm/kubeadm_images.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/kubeadm/kubeadm_rpms.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/keepalived/keepalived.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/rpms/bash-completion-2.1-8.el7.noarch.rpm + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/git/git-2.31.1.tar.gz + curl -OL -C - https://git.babudiu.com/iuxt/offline-kubernetes-install/releases/download/rpms/rsync-3.1.2-12.el7_9.x86_64.rpm +else + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/docker-ce-20.10.23-3.el7.x86_64/docker-ce-20.10.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/flannel/flannel.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/ingress-nginx/ingress-nginx.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/kernel_5.4/kernel_5.4.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/kubeadm_images/kubeadm_images.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/kubeadm_rpms/kubeadm_rpms.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/keepalived/keepalived.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/bash-completion/bash-completion-2.1-8.el7.noarch.rpm + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/git/git-2.31.1.tar.gz + curl -OL -C - https://github.com/iuxt/offline-kubernetes-install/releases/download/rsync/rsync-3.1.2-12.el7_9.x86_64.rpm +fi md5sum -c md5.sum