Skip to content

Commit 96f2588

Browse files
committed
cni: Update CNI download URLs to use new GCS bucket (k8s-artifacts-cni)
Signed-off-by: Stephen Augustus <[email protected]>
1 parent f5a0087 commit 96f2588

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

build/debian-hyperkube-base/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.4.1
2828
CNI_VERSION=v0.7.5
2929

3030
TEMP_DIR:=$(shell mktemp -d)
31+
# TODO(justaugustus): Post-0.7.5 CNI needs a "cni-plugins-linux-" prefix
3132
CNI_TARBALL=cni-plugins-$(ARCH)-$(CNI_VERSION).tgz
3233

3334
# This option is for running docker manifest command
@@ -58,7 +59,7 @@ push-manifest:
5859

5960
cni-tars/$(CNI_TARBALL):
6061
mkdir -p cni-tars/
61-
cd cni-tars/ && curl -sSLO --retry 5 https://storage.googleapis.com/kubernetes-release/network-plugins/${CNI_TARBALL}
62+
cd cni-tars/ && curl -sSLO --retry 5 https://storage.googleapis.com/k8s-artifacts-cni/release/${CNI_VERSION}/${CNI_TARBALL}
6263

6364
clean:
6465
rm -rf cni-tars/

build/workspace.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@ def release_dependencies():
5353
debian_image_dependencies()
5454
etcd_tarballs()
5555

56+
# TODO(justaugustus): Post-0.7.5 CNI needs a "cni-plugins-linux-" prefix
5657
def cni_tarballs():
5758
for arch, sha in _CNI_TARBALL_ARCH_SHA256.items():
5859
http_file(
5960
name = "kubernetes_cni_%s" % arch,
6061
downloaded_file_path = "kubernetes_cni.tgz",
6162
sha256 = sha,
62-
urls = mirror("https://storage.googleapis.com/kubernetes-release/network-plugins/cni-plugins-%s-v%s.tgz" % (arch, CNI_VERSION)),
63+
urls = mirror("https://storage.googleapis.com/k8s-artifacts-cni/release/v%s/cni-plugins-%s-v%s.tgz" % (CNI_VERSION, arch, CNI_VERSION)),
6364
)
6465

6566
def cri_tarballs():

cluster/gce/config-default.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ NODE_PROBLEM_DETECTOR_TAR_HASH="${NODE_PROBLEM_DETECTOR_TAR_HASH:-}"
290290
NODE_PROBLEM_DETECTOR_RELEASE_PATH="${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-}"
291291
NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS="${NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS:-}"
292292

293-
CNI_STORAGE_PATH="${CNI_STORAGE_PATH:-https://storage.googleapis.com/kubernetes-release/network-plugins}"
294-
CNI_TAR_PREFIX="${CNI_TAR_PREFIX:-cni-plugins-amd64-}"
295-
CNI_VERSION="${CNI_VERSION:-}"
296293
CNI_SHA1="${CNI_SHA1:-}"
294+
# TODO(justaugustus): Post-0.7.5 CNI needs a "cni-plugins-linux-" prefix
295+
CNI_TAR_PREFIX="${CNI_TAR_PREFIX:-cni-plugins-amd64-}"
296+
CNI_STORAGE_URL_BASE="${CNI_STORAGE_URL_BASE:-https://storage.googleapis.com/k8s-artifacts-cni/release}"
297297

298298
# Optional: Create autoscaler for cluster's nodes.
299299
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"

cluster/gce/config-test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,10 @@ NODE_PROBLEM_DETECTOR_TAR_HASH="${NODE_PROBLEM_DETECTOR_TAR_HASH:-}"
321321
NODE_PROBLEM_DETECTOR_RELEASE_PATH="${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-}"
322322
NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS="${NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS:-}"
323323

324-
CNI_STORAGE_PATH="${CNI_STORAGE_PATH:-https://storage.googleapis.com/kubernetes-release/network-plugins}"
325-
CNI_TAR_PREFIX="${CNI_TAR_PREFIX:-cni-plugins-amd64-}"
326-
CNI_VERSION="${CNI_VERSION:-}"
327324
CNI_SHA1="${CNI_SHA1:-}"
325+
# TODO(justaugustus): Post-0.7.5 CNI needs a "cni-plugins-linux-" prefix
326+
CNI_TAR_PREFIX="${CNI_TAR_PREFIX:-cni-plugins-amd64-}"
327+
CNI_STORAGE_URL_BASE="${CNI_STORAGE_URL_BASE:-https://storage.googleapis.com/k8s-artifacts-cni/release}"
328328

329329
# Optional: Create autoscaler for cluster's nodes.
330330
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"

cluster/gce/gci/configure.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,19 +236,23 @@ function install-node-problem-detector {
236236

237237
function install-cni-binaries {
238238
if [[ -n "${CNI_VERSION:-}" ]]; then
239-
local -r cni_tar="${CNI_TAR_PREFIX}${CNI_VERSION}.tgz"
239+
local -r cni_version="${CNI_VERSION}"
240240
local -r cni_sha1="${CNI_SHA1}"
241241
else
242-
local -r cni_tar="${CNI_TAR_PREFIX}${DEFAULT_CNI_VERSION}.tgz"
242+
local -r cni_version="${DEFAULT_CNI_VERSION}"
243243
local -r cni_sha1="${DEFAULT_CNI_SHA1}"
244244
fi
245+
246+
local -r cni_tar="${CNI_TAR_PREFIX}${cni_version}.tgz"
247+
local -r cni_url="${CNI_STORAGE_URL_BASE}/${cni_version}/${cni_tar}"
248+
245249
if is-preloaded "${cni_tar}" "${cni_sha1}"; then
246250
echo "${cni_tar} is preloaded."
247251
return
248252
fi
249253

250254
echo "Downloading cni binaries"
251-
download-or-bust "${cni_sha1}" "${CNI_STORAGE_PATH}/${cni_tar}"
255+
download-or-bust "${cni_sha1}" "${cni_url}"
252256
local -r cni_dir="${KUBE_HOME}/cni"
253257
mkdir -p "${cni_dir}/bin"
254258
tar xzf "${KUBE_HOME}/${cni_tar}" -C "${cni_dir}/bin" --overwrite

cluster/gce/util.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ NODE_PROBLEM_DETECTOR_VERSION: $(yaml-quote ${NODE_PROBLEM_DETECTOR_VERSION:-})
11421142
NODE_PROBLEM_DETECTOR_TAR_HASH: $(yaml-quote ${NODE_PROBLEM_DETECTOR_TAR_HASH:-})
11431143
NODE_PROBLEM_DETECTOR_RELEASE_PATH: $(yaml-quote ${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-})
11441144
NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS: $(yaml-quote ${NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS:-})
1145-
CNI_STORAGE_PATH: $(yaml-quote ${CNI_STORAGE_PATH:-})
1145+
CNI_STORAGE_URL_BASE: $(yaml-quote ${CNI_STORAGE_URL_BASE:-})
11461146
CNI_TAR_PREFIX: $(yaml-quote ${CNI_TAR_PREFIX:-})
11471147
CNI_VERSION: $(yaml-quote ${CNI_VERSION:-})
11481148
CNI_SHA1: $(yaml-quote ${CNI_SHA1:-})

cluster/gce/windows/k8s-node-setup.psm1

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -953,18 +953,17 @@ function Configure-CniNetworking {
953953
# CLUSTER_IP_RANGE
954954
# SERVICE_CLUSTER_IP_RANGE
955955
function Configure_Dockerd_CniNetworking {
956-
$CNI_RELEASE_VERSION = 'v0.8.2-gke.0'
956+
$CNI_RELEASE_VERSION = 'v0.8.2'
957957
if ((ShouldWrite-File ${env:CNI_DIR}\win-bridge.exe) -or
958958
(ShouldWrite-File ${env:CNI_DIR}\host-local.exe)) {
959959
$tmp_dir = 'C:\cni_tmp'
960960
New-Item $tmp_dir -ItemType 'directory' -Force | Out-Null
961961

962-
$release_url = ('https://www.googleapis.com/storage/v1/b/gke-release/o/cni-plugins%2f' +
962+
$release_url = ('https://storage.googleapis.com/k8s-artifacts-cni/release%2f' +
963963
$CNI_RELEASE_VERSION + '%2f')
964-
$sha_url = ($release_url +
965-
"cni-plugins-windows-amd64-$CNI_RELEASE_VERSION.tgz.sha1?alt=media")
966964
$tgz_url = ($release_url +
967-
"cni-plugins-windows-amd64-$CNI_RELEASE_VERSION.tgz?alt=media")
965+
"cni-plugins-windows-amd64-$CNI_RELEASE_VERSION.tgz")
966+
$sha_url = ($tgz_url + ".sha1")
968967
MustDownload-File -URLs $sha_url -OutFile $tmp_dir\cni-plugins.sha1
969968
$sha1_val = ($(Get-Content $tmp_dir\cni-plugins.sha1) -split ' ',2)[0]
970969
MustDownload-File `

test/e2e_node/remote/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const (
3131
cniArch = "amd64"
3232
cniDirectory = "cni/bin" // The CNI tarball places binaries under directory under "cni/bin".
3333
cniConfDirectory = "cni/net.d"
34-
cniURL = "https://dl.k8s.io/network-plugins/cni-plugins-" + cniArch + "-" + cniVersion + ".tgz"
34+
// TODO(justaugustus): Post-0.7.5 CNI needs a "cni-plugins-linux-" prefix
35+
cniURL = "https://storage.googleapis.com/k8s-artifacts-cni/release/" + cniVersion + "/" + "cni-plugins-" + cniArch + "-" + cniVersion + ".tgz"
3536
)
3637

3738
const cniConfig = `{

0 commit comments

Comments
 (0)