diff --git a/build/common.sh b/build/common.sh index 5bfb754671f..705cab4c0e6 100755 --- a/build/common.sh +++ b/build/common.sh @@ -40,6 +40,9 @@ source "${KUBE_ROOT}/hack/lib/init.sh" readonly KUBE_BUILD_IMAGE_REPO=kube-build readonly KUBE_BUILD_IMAGE_CROSS_TAG="$(cat "${KUBE_ROOT}/build/build-image/cross/VERSION")" +readonly KUBE_DOCKER_REGISTRY="${KUBE_DOCKER_REGISTRY:-k8s.gcr.io}" +readonly KUBE_BASE_IMAGE_REGISTRY="${KUBE_BASE_IMAGE_REGISTRY:-k8s.gcr.io}" + # This version number is used to cause everyone to rebuild their data containers # and build image. This is especially useful for automated build systems like # Jenkins. @@ -94,11 +97,11 @@ kube::build::get_docker_wrapped_binaries() { ### If you change any of these lists, please also update DOCKERIZED_BINARIES ### in build/BUILD. And kube::golang::server_image_targets local targets=( - cloud-controller-manager,"k8s.gcr.io/debian-base-${arch}:${debian_base_version}" - kube-apiserver,"k8s.gcr.io/debian-base-${arch}:${debian_base_version}" - kube-controller-manager,"k8s.gcr.io/debian-base-${arch}:${debian_base_version}" - kube-scheduler,"k8s.gcr.io/debian-base-${arch}:${debian_base_version}" - kube-proxy,"k8s.gcr.io/debian-iptables-${arch}:${debian_iptables_version}" + cloud-controller-manager,"${KUBE_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}" + kube-apiserver,"${KUBE_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}" + kube-controller-manager,"${KUBE_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}" + kube-scheduler,"${KUBE_BASE_IMAGE_REGISTRY}/debian-base-${arch}:${debian_base_version}" + kube-proxy,"${KUBE_BASE_IMAGE_REGISTRY}/debian-iptables-${arch}:${debian_iptables_version}" ) echo "${targets[@]}" diff --git a/build/lib/release.sh b/build/lib/release.sh index 13e9e3aea83..4c5e0962be3 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -337,7 +337,7 @@ function kube::release::create_docker_images_for_server() { local images_dir="${RELEASE_IMAGES}/${arch}" mkdir -p "${images_dir}" - local -r docker_registry="k8s.gcr.io" + local -r docker_registry="${KUBE_DOCKER_REGISTRY}" # Docker tags cannot contain '+' local docker_tag="${KUBE_GIT_VERSION/+/_}" if [[ -z "${docker_tag}" ]]; then diff --git a/build/root/Makefile b/build/root/Makefile index f40fec8abc9..969afb15523 100644 --- a/build/root/Makefile +++ b/build/root/Makefile @@ -445,6 +445,8 @@ define RELEASE_SKIP_TESTS_HELP_INFO # Args: # KUBE_RELEASE_RUN_TESTS: Whether to run tests. Set to 'y' to run tests anyways. # KUBE_FASTBUILD: Whether to cross-compile for other architectures. Set to 'false' to do so. +# KUBE_DOCKER_REGISTRY: Registry of released images, default to k8s.gcr.io +# KUBE_BASE_IMAGE_REGISTRY: Registry of base images for controlplane binaries, default to k8s.gcr.io # # Example: # make release-skip-tests