Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.17] Update CNI to v0.8.6 #91386

Merged
merged 4 commits into from May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion build/debian-hyperkube-base/.gitignore

This file was deleted.

63 changes: 0 additions & 63 deletions build/debian-hyperkube-base/Dockerfile

This file was deleted.

85 changes: 0 additions & 85 deletions build/debian-hyperkube-base/Makefile

This file was deleted.

12 changes: 0 additions & 12 deletions build/debian-hyperkube-base/OWNERS

This file was deleted.

25 changes: 0 additions & 25 deletions build/debian-hyperkube-base/README.md

This file was deleted.

12 changes: 9 additions & 3 deletions build/dependencies.yaml
@@ -1,9 +1,7 @@
dependencies:
- name: "cni"
version: 0.7.5
version: 0.8.6
refPaths:
- path: build/debian-hyperkube-base/Makefile
match: CNI_VERSION=
- path: build/rpms/kubeadm.spec
match: kubernetes-cni
- path: build/rpms/kubelet.spec
Expand Down Expand Up @@ -99,6 +97,14 @@ dependencies:
- path: cluster/images/etcd-empty-dir-cleanup/Dockerfile
match: us\.gcr\.io\/k8s-artifacts-prod\/build-image\/debian-base:v\d+\.\d+\.\d+

- name: "k8s.gcr.io/debian-hyperkube-base: dependents"
version: 1.0.0
refPaths:
- path: build/workspace.bzl
match: tag =
- path: cluster/images/hyperkube/Makefile
match: BASEIMAGE\?\=us\.gcr\.io\/k8s-artifacts-prod\/build-image\/debian-hyperkube-base-\$\(ARCH\):v\d+\.\d+\.\d+

- name: "k8s.gcr.io/debian-iptables: dependents"
version: 12.1.0
refPaths:
Expand Down
2 changes: 1 addition & 1 deletion build/rpms/kubeadm.spec
Expand Up @@ -5,7 +5,7 @@ License: ASL 2.0
Summary: Container Cluster Manager - Kubernetes Cluster Bootstrapping Tool
Requires: kubelet >= 1.8.0
Requires: kubectl >= 1.8.0
Requires: kubernetes-cni >= 0.7.5
Requires: kubernetes-cni >= 0.8.6
Requires: cri-tools >= 1.11.0

URL: https://kubernetes.io
Expand Down
2 changes: 1 addition & 1 deletion build/rpms/kubelet.spec
Expand Up @@ -11,7 +11,7 @@ Requires: ebtables
Requires: ethtool
Requires: iproute
Requires: iptables >= 1.4.21
Requires: kubernetes-cni >= 0.7.5
Requires: kubernetes-cni >= 0.8.6
Requires: socat
Requires: util-linux

Expand Down
36 changes: 21 additions & 15 deletions build/workspace.bzl
Expand Up @@ -17,13 +17,13 @@ load("//build:workspace_mirror.bzl", "mirror")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@io_bazel_rules_docker//container:container.bzl", "container_pull")

CNI_VERSION = "0.7.5"
CNI_VERSION = "0.8.6"
_CNI_TARBALL_ARCH_SHA256 = {
"amd64": "3ca15c0a18ee830520cf3a95408be826cbd255a1535a38e0be9608b25ad8bf64",
"arm": "0eb4a528b5b2e4ce23ebc96e41b2f5280d5a64d41eec8dd8b16c3d66aaa0f6b8",
"arm64": "7fec91af78e9548df306f0ec43bea527c8c10cc3a9682c33e971c8522a7fcded",
"ppc64le": "9164a26ed8dd398b2fe3b15d9d456271dfa59aa537528d10572ea9fa2cef7679",
"s390x": "415cdcf02c65c22f5b7e55b0ab61208a10f2b95a0c8310176c771d07a9f448cf",
"amd64": "994fbfcdbb2eedcfa87e48d8edb9bb365f4e2747a7e47658482556c12fd9b2f5",
"arm": "28e61b5847265135dc1ca397bf94322ecce4acab5c79cc7d360ca3f6a655bdb7",
"arm64": "43fbf750c5eccb10accffeeb092693c32b236fb25d919cf058c91a677822c999",
"ppc64le": "61d6c6c15d3e4fa3eb85d128c9c0ff2658f38e59047ae359be47d193c673e116",
"s390x": "ca126a3bd2cd8dff1c7bbfc3c69933b284c4e77614391c7e1f74b0851fc3b289",
}

CRI_TOOLS_VERSION = "1.16.1"
Expand Down Expand Up @@ -59,7 +59,7 @@ def cni_tarballs():
name = "kubernetes_cni_%s" % arch,
downloaded_file_path = "kubernetes_cni.tgz",
sha256 = sha,
urls = mirror("https://storage.googleapis.com/kubernetes-release/network-plugins/cni-plugins-%s-v%s.tgz" % (arch, CNI_VERSION)),
urls = ["https://storage.googleapis.com/k8s-artifacts-cni/release/v%s/cni-plugins-linux-%s-v%s.tgz" % (CNI_VERSION, arch, CNI_VERSION)],
)

def cri_tarballs():
Expand Down Expand Up @@ -99,13 +99,18 @@ _DEBIAN_IPTABLES_DIGEST = {
"s390x": "sha256:1b91a2788750552913377bf1bc99a095544dfb523d80a55674003c974c8e0905",
}

# Use skopeo to find these values: https://github.com/containers/skopeo
#
# Example
# Manifest: skopeo inspect docker://gcr.io/k8s-staging-build-image/debian-hyperkube-base:v1.0.0
# Arches: skopeo inspect --raw docker://gcr.io/k8s-staging-build-image/debian-hyperkube-base:v1.0.0
_DEBIAN_HYPERKUBE_BASE_DIGEST = {
"manifest": "sha256:8cabe02be6e86685d8860b7ace7c7addc9591a339728703027a4854677f1c772",
"amd64": "sha256:5d4ea2fb5fbe9a9a9da74f67cf2faefc881968bc39f2ac5d62d9167e575812a1",
"arm": "sha256:73260814af61522ff6aa48291df457d3bb0a91c4bf72e7cfa51fbaf03eb65fae",
"arm64": "sha256:78eeb1a31eef7c16f954444d64636d939d89307e752964ad6d9d06966c722da3",
"ppc64le": "sha256:92857d647abe8d9c7b4d7160cd5699112afc12fde369082a8ed00688b17928a9",
"s390x": "sha256:c11d74fa0538c67238576c247bfaddf95ebaa90cd03cb4d2f2ac3c6ebe0441e2",
"manifest": "sha256:8c8d854d868fb08352f73dda94f9e0b998c7318b48ddc587a355d0cbaf687f14",
"amd64": "sha256:73a8cb2bfd6707c8ed70c252e97bdccad8bc265a9a585db12b8e3dac50d6cd2a",
"arm": "sha256:aee7c2958c6e0de896995e8b04c8173fd0a7bbb16cddb1f4668e3ae010b8c786",
"arm64": "sha256:a74fc6d690e5c5e393fd509f50d7203fa5cd19bfbb127d4a3a996fd1ebcf35c4",
"ppc64le": "sha256:54afd9a85d6ecbe0792496f36012e7902601fb8084347cdc195c8b0561da39a3",
"s390x": "sha256:405a94e6b82f2eb89c773e0e9f6105eb73cde5605d4508ae36a150d922fe1c66",
}

def _digest(d, arch):
Expand Down Expand Up @@ -140,9 +145,10 @@ def debian_image_dependencies():
name = "debian-hyperkube-base-" + arch,
architecture = arch,
digest = _digest(_DEBIAN_HYPERKUBE_BASE_DIGEST, arch),
registry = "k8s.gcr.io",
registry = "us.gcr.io/k8s-artifacts-prod/build-image",
repository = "debian-hyperkube-base",
tag = "0.12.1", # ignored, but kept here for documentation
# Ensure the digests above are updated to match a new tag
tag = "v1.0.0", # ignored, but kept here for documentation
)

def etcd_tarballs():
Expand Down
6 changes: 3 additions & 3 deletions cluster/gce/config-default.sh
Expand Up @@ -301,9 +301,9 @@ NODE_PROBLEM_DETECTOR_TAR_HASH="${NODE_PROBLEM_DETECTOR_TAR_HASH:-}"
NODE_PROBLEM_DETECTOR_RELEASE_PATH="${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-}"
NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS="${NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS:-}"

CNI_STORAGE_PATH="${CNI_STORAGE_PATH:-https://storage.googleapis.com/kubernetes-release/network-plugins}"
CNI_VERSION="${CNI_VERSION:-}"
CNI_SHA1="${CNI_SHA1:-}"
CNI_SHA1=${CNI_SHA1:-}
CNI_TAR_PREFIX=${CNI_TAR_PREFIX:-cni-plugins-linux-amd64-}
CNI_STORAGE_URL_BASE=${CNI_STORAGE_URL_BASE:-https://storage.googleapis.com/k8s-artifacts-cni/release}
Comment on lines +304 to +306
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bowei to review


# Optional: Create autoscaler for cluster's nodes.
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"
Expand Down
6 changes: 3 additions & 3 deletions cluster/gce/config-test.sh
Expand Up @@ -332,9 +332,9 @@ NODE_PROBLEM_DETECTOR_TAR_HASH="${NODE_PROBLEM_DETECTOR_TAR_HASH:-}"
NODE_PROBLEM_DETECTOR_RELEASE_PATH="${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-}"
NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS="${NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS:-}"

CNI_STORAGE_PATH="${CNI_STORAGE_PATH:-https://storage.googleapis.com/kubernetes-release/network-plugins}"
CNI_VERSION="${CNI_VERSION:-}"
CNI_SHA1="${CNI_SHA1:-}"
CNI_SHA1=${CNI_SHA1:-}
CNI_TAR_PREFIX=${CNI_TAR_PREFIX:-cni-plugins-linux-amd64-}
CNI_STORAGE_URL_BASE=${CNI_STORAGE_URL_BASE:-https://storage.googleapis.com/k8s-artifacts-cni/release}

# Optional: Create autoscaler for cluster's nodes.
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"
Expand Down
14 changes: 9 additions & 5 deletions cluster/gce/gci/configure.sh
Expand Up @@ -24,8 +24,8 @@ set -o nounset
set -o pipefail

### Hardcoded constants
DEFAULT_CNI_VERSION="v0.7.5"
DEFAULT_CNI_SHA1="52e9d2de8a5f927307d9397308735658ee44ab8d"
DEFAULT_CNI_VERSION="v0.8.6"
DEFAULT_CNI_SHA1="a31251105250279fe57b4474d91d2db1d4d48b5a"
DEFAULT_NPD_VERSION="v0.8.0"
DEFAULT_NPD_SHA1="9406c975b1b035995a137029a004622b905b4e7f"
DEFAULT_CRICTL_VERSION="v1.16.1"
Expand Down Expand Up @@ -236,19 +236,23 @@ function install-node-problem-detector {

function install-cni-binaries {
if [[ -n "${CNI_VERSION:-}" ]]; then
local -r cni_tar="cni-plugins-amd64-${CNI_VERSION}.tgz"
local -r cni_version="${CNI_VERSION}"
local -r cni_sha1="${CNI_SHA1}"
else
local -r cni_tar="cni-plugins-amd64-${DEFAULT_CNI_VERSION}.tgz"
local -r cni_version="${DEFAULT_CNI_VERSION}"
local -r cni_sha1="${DEFAULT_CNI_SHA1}"
fi

local -r cni_tar="${CNI_TAR_PREFIX}${cni_version}.tgz"
local -r cni_url="${CNI_STORAGE_URL_BASE}/${cni_version}/${cni_tar}"

if is-preloaded "${cni_tar}" "${cni_sha1}"; then
echo "${cni_tar} is preloaded."
return
fi

echo "Downloading cni binaries"
download-or-bust "${cni_sha1}" "${CNI_STORAGE_PATH}/${cni_tar}"
download-or-bust "${cni_sha1}" "${cni_url}"
local -r cni_dir="${KUBE_HOME}/cni"
mkdir -p "${cni_dir}/bin"
tar xzf "${KUBE_HOME}/${cni_tar}" -C "${cni_dir}/bin" --overwrite
Expand Down
3 changes: 2 additions & 1 deletion cluster/gce/util.sh
Expand Up @@ -1136,7 +1136,8 @@ NODE_PROBLEM_DETECTOR_VERSION: $(yaml-quote ${NODE_PROBLEM_DETECTOR_VERSION:-})
NODE_PROBLEM_DETECTOR_TAR_HASH: $(yaml-quote ${NODE_PROBLEM_DETECTOR_TAR_HASH:-})
NODE_PROBLEM_DETECTOR_RELEASE_PATH: $(yaml-quote ${NODE_PROBLEM_DETECTOR_RELEASE_PATH:-})
NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS: $(yaml-quote ${NODE_PROBLEM_DETECTOR_CUSTOM_FLAGS:-})
CNI_STORAGE_PATH: $(yaml-quote ${CNI_STORAGE_PATH:-})
CNI_STORAGE_URL_BASE: $(yaml-quote ${CNI_STORAGE_URL_BASE:-})
CNI_TAR_PREFIX: $(yaml-quote ${CNI_TAR_PREFIX:-})
Comment on lines +1139 to +1140
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bowei to review cluster CNI changes

CNI_VERSION: $(yaml-quote ${CNI_VERSION:-})
CNI_SHA1: $(yaml-quote ${CNI_SHA1:-})
ENABLE_NODE_LOGGING: $(yaml-quote ${ENABLE_NODE_LOGGING:-false})
Expand Down
2 changes: 1 addition & 1 deletion cluster/images/hyperkube/Makefile
Expand Up @@ -21,7 +21,7 @@ REGISTRY?=staging-k8s.gcr.io
ARCH?=amd64
OUT_DIR?=_output

BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.12.1
BASEIMAGE?=us.gcr.io/k8s-artifacts-prod/build-image/debian-hyperkube-base-$(ARCH):v1.0.0

LOCAL_OUTPUT_PATH=$(shell pwd)/../../../$(OUT_DIR)/local/bin/linux/$(ARCH)
DOCKERIZED_OUTPUT_PATH=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH)
Expand Down
4 changes: 2 additions & 2 deletions test/e2e_node/remote/utils.go
Expand Up @@ -27,11 +27,11 @@ import (
// utils.go contains functions used across test suites.

const (
cniVersion = "v0.7.5"
cniVersion = "v0.8.6"
cniArch = "amd64"
cniDirectory = "cni/bin" // The CNI tarball places binaries under directory under "cni/bin".
cniConfDirectory = "cni/net.d"
cniURL = "https://dl.k8s.io/network-plugins/cni-plugins-" + cniArch + "-" + cniVersion + ".tgz"
cniURL = "https://storage.googleapis.com/k8s-artifacts-cni/release/" + cniVersion + "/" + "cni-plugins-linux-" + cniArch + "-" + cniVersion + ".tgz"
)

const cniConfig = `{
Expand Down