diff --git a/README.md b/README.md index a15649f4..8aac2803 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ KubeKey can install Kubernetes and KubeSphere together. The dependency that need ## Usage -### Get the Installer Excutable File +### Get the Installer Executable File * Binary downloads of the KubeKey can be found on the [Releases page](https://github.com/kubesphere/kubekey/releases). Unpack the binary and you are good to go! @@ -93,7 +93,7 @@ KubeKey can install Kubernetes and KubeSphere together. The dependency that need > Note: > > * Docker needs to be installed before building. -> * If you have problem to access `https://proxy.golang.org/`, excute `build.sh -p` instead. +> * If you have problem to access `https://proxy.golang.org`, execute `build.sh -p` instead. ### Create a Cluster @@ -105,6 +105,7 @@ Quick Start is for `all-in-one` installation which is a good start to get famili ##### Command +> If you have problem to access `https://storage.googleapis.com`, execute first `export KKZONE=cn`. ```shell script ./kk create cluster [--with-kubernetes version] [--with-kubesphere version] ``` @@ -133,6 +134,8 @@ Quick Start is for `all-in-one` installation which is a good start to get famili You have more control to customize parameters or create a multi-node cluster using the advanced installation. Specifically, create a cluster by specifying a configuration file. +> If you have problem to access `https://storage.googleapis.com`, execute first `export KKZONE=cn`. + 1. First, create an example configuration file ```shell script diff --git a/README_zh-CN.md b/README_zh-CN.md index 19e358b7..67d2ff20 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -106,6 +106,7 @@ KubeKey 可以同时安装 Kubernetes 和 KubeSphere。根据 KubeSphere 所安 > 注意: 由于 Kubernetes 暂不支持大写 NodeName, hostname 中包含大写字母将导致后续安装过程无法正常结束 ##### 命令 +> 如果无法访问 `https://storage.googleapis.com`, 请先执行 `export KKZONE=cn`. ```shell script ./kk create cluster [--with-kubernetes version] [--with-kubesphere version] @@ -135,6 +136,8 @@ KubeKey 可以同时安装 Kubernetes 和 KubeSphere。根据 KubeSphere 所安 您可以使用高级安装来控制自定义参数或创建多节点群集。具体来说,通过指定配置文件来创建集群。 +> 如果无法访问 `https://storage.googleapis.com`, 请先执行 `export KKZONE=cn`. + 1. 首先,创建一个示例配置文件 ```shell script diff --git a/pkg/cluster/preinstall/preinstall.go b/pkg/cluster/preinstall/preinstall.go index f9514610..5bee0679 100644 --- a/pkg/cluster/preinstall/preinstall.go +++ b/pkg/cluster/preinstall/preinstall.go @@ -59,9 +59,9 @@ func FilesDownloadHttp(mgr *manager.Manager, filepath, version, arch string) err helm.GetCmd = fmt.Sprintf("curl -o %s/helm-%s-linux-%s.tar.gz %s && cd %s && tar -zxf helm-%s-linux-%s.tar.gz && mv linux-%s/helm . && rm -rf *linux-%s*", filepath, helm.Version, helm.Arch, helm.Url, filepath, helm.Version, helm.Arch, helm.Arch, helm.Arch) } - kubeadm.GetCmd = fmt.Sprintf("curl -o %s %s", kubeadm.Path, kubeadm.Url) - kubelet.GetCmd = fmt.Sprintf("curl -o %s %s", kubelet.Path, kubelet.Url) - kubectl.GetCmd = fmt.Sprintf("curl -o %s %s", kubectl.Path, kubectl.Url) + kubeadm.GetCmd = fmt.Sprintf("curl -L -o %s %s", kubeadm.Path, kubeadm.Url) + kubelet.GetCmd = fmt.Sprintf("curl -L -o %s %s", kubelet.Path, kubelet.Url) + kubectl.GetCmd = fmt.Sprintf("curl -L -o %s %s", kubectl.Path, kubectl.Url) kubecni.GetCmd = fmt.Sprintf("curl -L -o %s %s", kubecni.Path, kubecni.Url) binaries := []files.KubeBinary{kubeadm, kubelet, kubectl, helm, kubecni} @@ -72,7 +72,7 @@ func FilesDownloadHttp(mgr *manager.Manager, filepath, version, arch string) err for i := 5; i > 0; i-- { if output, err := exec.Command("/bin/sh", "-c", binary.GetCmd).CombinedOutput(); err != nil { fmt.Println(string(output)) - return errors.Wrap(err, fmt.Sprintf("Failed to download %s binary", binary.Name)) + return errors.New(fmt.Sprintf("Failed to download %s binary: %s", binary.Name, binary.GetCmd)) } if err := SHA256Check(binary, version); err != nil { diff --git a/scripts/downloadKubekey.sh b/scripts/downloadKubekey.sh index 3bde9d99..eac110bd 100755 --- a/scripts/downloadKubekey.sh +++ b/scripts/downloadKubekey.sh @@ -57,17 +57,20 @@ fi DOWNLOAD_URL="https://github.com/kubesphere/kubekey/releases/download/${KUBEKEY_VERSION}/kubekey-${KUBEKEY_VERSION}-${OSTYPE}-${ARCH}.tar.gz" if [ "x${KKZONE}" = "xcn" ]; then - export KKZONE=cn DOWNLOAD_URL="https://kubernetes.pek3b.qingstor.com/kubekey/releases/download/${KUBEKEY_VERSION}/kubekey-${KUBEKEY_VERSION}-${OSTYPE}-${ARCH}.tar.gz" fi -echo "\nDownloading kubekey ${KUBEKEY_VERSION} from ${DOWNLOAD_URL} ...\n" +echo "" +echo "Downloading kubekey ${KUBEKEY_VERSION} from ${DOWNLOAD_URL} ..." +echo "" curl -fsLO "$DOWNLOAD_URL" if [ $? -ne 0 ]; then - echo "\n\n" - echo "Failed to download Kubekey ${KUBEKEY_VERSION} !\n" - echo "Please verify the version you are trying to download.\n\n" + echo "" + echo "Failed to download Kubekey ${KUBEKEY_VERSION} !" + echo "" + echo "Please verify the version you are trying to download." + echo "" exit fi @@ -75,4 +78,6 @@ filename="kubekey-${KUBEKEY_VERSION}-${OSTYPE}-${ARCH}.tar.gz" tar -xzf "${filename}" # rm "${filename}" -echo "\nKubekey ${KUBEKEY_VERSION} Download Complete!\n" +echo "" +echo "Kubekey ${KUBEKEY_VERSION} Download Complete!" +echo ""