From 9d87d0565a566019dc0a882fe27480475b4b50b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Mon, 13 Feb 2023 19:34:42 +0100 Subject: [PATCH] Download binaries from dl.k8s.io instead of GCR --- .github/workflows/functional_verified.yml | 2 +- .github/workflows/master.yml | 10 +++++----- .github/workflows/pr.yml | 12 ++++++------ .github/workflows/time-to-k8s-public-chart.yml | 2 +- deploy/prow/Dockerfile | 2 +- hack/jenkins/installers/check_install_docker.sh | 2 +- hack/jenkins/linux_integration_tests_none.sh | 2 +- .../kubeadm_constants/update_kubeadm_constants.go | 2 +- pkg/minikube/download/binary.go | 2 +- pkg/minikube/download/download.go | 6 ++++++ pkg/minikube/reason/match_test.go | 2 +- .../en/docs/tutorials/continuous_integration.md | 2 +- 12 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/functional_verified.yml b/.github/workflows/functional_verified.yml index 3a2147cf86d3..13c919edd67c 100644 --- a/.github/workflows/functional_verified.yml +++ b/.github/workflows/functional_verified.yml @@ -88,7 +88,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/arm64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/arm64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 038542a5b7e0..cd5af6f3d5af 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -105,7 +105,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - name: Docker Info @@ -205,7 +205,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - name: Docker Info @@ -305,7 +305,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true @@ -408,7 +408,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 @@ -507,7 +507,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 321d8072d860..9a3eb738e597 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -103,7 +103,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - name: Docker Info @@ -203,7 +203,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - name: Docker Info @@ -306,7 +306,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true # https://rootlesscontaine.rs/getting-started/common/cgroup2/ @@ -423,7 +423,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true @@ -527,7 +527,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 @@ -627,7 +627,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 diff --git a/.github/workflows/time-to-k8s-public-chart.yml b/.github/workflows/time-to-k8s-public-chart.yml index 4d74088c29ae..01103806bb71 100644 --- a/.github/workflows/time-to-k8s-public-chart.yml +++ b/.github/workflows/time-to-k8s-public-chart.yml @@ -43,7 +43,7 @@ jobs: - name: Install kubectl shell: bash run: | - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl" sudo install kubectl /usr/local/bin/kubectl kubectl version --client=true - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 diff --git a/deploy/prow/Dockerfile b/deploy/prow/Dockerfile index 78a3a1662151..f3cf19dfcbff 100644 --- a/deploy/prow/Dockerfile +++ b/deploy/prow/Dockerfile @@ -76,7 +76,7 @@ RUN echo "Installing Packages ..." \ && update-alternatives --set iptables /usr/sbin/iptables-legacy \ && update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy \ && echo "Installing Kubectl ..." \ - && curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" \ + && curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" \ && chmod +x ./kubectl \ && cp kubectl /usr/local/bin # copy in image utility scripts diff --git a/hack/jenkins/installers/check_install_docker.sh b/hack/jenkins/installers/check_install_docker.sh index 23acba7304ee..df76218fc291 100755 --- a/hack/jenkins/installers/check_install_docker.sh +++ b/hack/jenkins/installers/check_install_docker.sh @@ -30,5 +30,5 @@ rm get-docker.sh sudo adduser jenkins docker || true echo "Installing latest kubectl" -curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${ARCH}/kubectl" +curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${ARCH}/kubectl" sudo install ./kubectl /usr/local/bin/kubectl diff --git a/hack/jenkins/linux_integration_tests_none.sh b/hack/jenkins/linux_integration_tests_none.sh index 4c36e7faa871..c7baca1551a2 100755 --- a/hack/jenkins/linux_integration_tests_none.sh +++ b/hack/jenkins/linux_integration_tests_none.sh @@ -36,7 +36,7 @@ export KUBECONFIG="/root/.kube/config" if ! kubeadm &>/dev/null; then echo "WARNING: kubeadm is not installed. will try to install." - curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubeadm" + curl -LO "https://dl.k8s.io/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubeadm" sudo install kubeadm /usr/local/bin/kubeadm fi # "none" driver specific cleanup from previous runs. diff --git a/hack/update/kubeadm_constants/update_kubeadm_constants.go b/hack/update/kubeadm_constants/update_kubeadm_constants.go index cadb7fdba0bb..5a34e4af44ac 100644 --- a/hack/update/kubeadm_constants/update_kubeadm_constants.go +++ b/hack/update/kubeadm_constants/update_kubeadm_constants.go @@ -38,7 +38,7 @@ import ( const ( // default context timeout cxTimeout = 5 * time.Minute - kubeadmReleaseURL = "https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/amd64/kubeadm" + kubeadmReleaseURL = "https://dl.k8s.io/%s/bin/linux/amd64/kubeadm" kubeadmBinaryName = "kubeadm-linux-amd64-%s" minikubeConstantsFilePath = "pkg/minikube/constants/constants_kubeadm_images.go" kubeadmImagesTemplate = ` diff --git a/pkg/minikube/download/binary.go b/pkg/minikube/download/binary.go index 95f13816f1ea..367ac4d16370 100644 --- a/pkg/minikube/download/binary.go +++ b/pkg/minikube/download/binary.go @@ -32,7 +32,7 @@ import ( // DefaultKubeBinariesURL returns a URL to kube binaries func DefaultKubeBinariesURL() string { - return fmt.Sprintf("https://%s/kubernetes-release/release", downloadHost) + return fmt.Sprintf("https://%s%s", releaseHost, releasePath) } // binaryWithChecksumURL gets the location of a Kubernetes binary diff --git a/pkg/minikube/download/download.go b/pkg/minikube/download/download.go index c72690538318..aae2ab7b6801 100644 --- a/pkg/minikube/download/download.go +++ b/pkg/minikube/download/download.go @@ -41,11 +41,17 @@ var ( aliyunMirror = "kubernetes.oss-cn-hangzhou.aliyuncs.com" downloadHost = "storage.googleapis.com" + + releaseHost = "dl.k8s.io" + releasePath = "" ) // SetAliyunMirror set the download host for Aliyun mirror func SetAliyunMirror() { downloadHost = aliyunMirror + + releaseHost = downloadHost + releasePath = "/kubernetes-release/release" } // CreateDstDownloadMock is the default mock implementation of download. diff --git a/pkg/minikube/reason/match_test.go b/pkg/minikube/reason/match_test.go index 72c19dd984e3..f92ab066fc3c 100644 --- a/pkg/minikube/reason/match_test.go +++ b/pkg/minikube/reason/match_test.go @@ -41,7 +41,7 @@ VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, * Temporary download error: Get https://storage.googleapis.com/minikube/iso/minikube-v0.35.0.iso: dial tcp 216.58.207.144:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.`}, {4107, "darwin", "PR_VBOX_BLOCKED", "Result Code: NS_ERROR (0x80004005)"}, {4302, "", "K8S_APISERVER_TIMEOUT", "apiserver: timed out waiting for the condition"}, - {4252, "", "INET_TLS_OVERSIZED", "Failed to update cluster: downloading binaries: downloading kubeadm: Error downloading kubeadm v1.14.1: failed to download: failed to download to temp file: download failed: 5 error(s) occurred:\n\nTemporary download error: Get https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubeadm: proxyconnect tcp: tls: oversized record received with length 20527"}, + {4252, "", "INET_TLS_OVERSIZED", "Failed to update cluster: downloading binaries: downloading kubeadm: Error downloading kubeadm v1.14.1: failed to download: failed to download to temp file: download failed: 5 error(s) occurred:\n\nTemporary download error: Get https://dl.k8s.io/v1.14.1/bin/linux/amd64/kubeadm: proxyconnect tcp: tls: oversized record received with length 20527"}, {4222, "", "IF_VBOX_NOT_VISIBLE", "Unable to start VM: create: creating: Error setting up host only network on machine start: The host-only adapter we just created is not visible. This is a well known VirtualBox bug. You might want to uninstall it and reinstall at least version 5.0.12 that is supposed to fix this issue"}, {6014, "linux", "K8S_APISERVER_MISSING", "Error restarting cluster: waiting for apiserver: apiserver process never appeared"}, {5836, "", "SVC_OPEN_NOT_FOUND", `Error opening service: Service newservice was not found in "unknown" namespace. You may select another namespace by using 'minikube service newservice -n : Temporary Error: Error getting service newservice: services "newservice" not found`}, diff --git a/site/content/en/docs/tutorials/continuous_integration.md b/site/content/en/docs/tutorials/continuous_integration.md index 9b3498466dfa..6076da022526 100644 --- a/site/content/en/docs/tutorials/continuous_integration.md +++ b/site/content/en/docs/tutorials/continuous_integration.md @@ -43,7 +43,7 @@ curl -LO \ kv=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) curl -LO \ - https://storage.googleapis.com/kubernetes-release/release/$kv/bin/linux/amd64/kubectl \ + https://dl.k8s.io/$kv/bin/linux/amd64/kubectl \ && install kubectl /tmp/ /tmp/minikube-linux-amd64 config set WantUpdateNotification false