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

Allow customize base image and released image registry #80525

Merged
merged 1 commit into from Jul 26, 2019
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
13 changes: 8 additions & 5 deletions build/common.sh
Expand Up @@ -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.
Expand Down Expand Up @@ -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[@]}"
Expand Down
2 changes: 1 addition & 1 deletion build/lib/release.sh
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions build/root/Makefile
Expand Up @@ -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
Expand Down