Skip to content

Commit f62cf39

Browse files
committed
Revert "build: Adds Windows kube-proxy image"
This reverts commit 3b0cec3.
1 parent f386b4c commit f62cf39

File tree

6 files changed

+30
-105
lines changed

6 files changed

+30
-105
lines changed

build/common.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,35 +107,28 @@ readonly KUBE_APISERVER_BASE_IMAGE="${KUBE_APISERVER_BASE_IMAGE:-$KUBE_GORUNNER_
107107
readonly KUBE_CONTROLLER_MANAGER_BASE_IMAGE="${KUBE_CONTROLLER_MANAGER_BASE_IMAGE:-$KUBE_GORUNNER_IMAGE}"
108108
readonly KUBE_SCHEDULER_BASE_IMAGE="${KUBE_SCHEDULER_BASE_IMAGE:-$KUBE_GORUNNER_IMAGE}"
109109
readonly KUBE_PROXY_BASE_IMAGE="${KUBE_PROXY_BASE_IMAGE:-$KUBE_BASE_IMAGE_REGISTRY/distroless-iptables:$__default_distroless_iptables_version}"
110-
readonly KUBE_PROXY_WINDOWS_BASE_IMAGE="${KUBE_PROXY_WINDOWS_BASE_IMAGE:-mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0}"
111110
readonly KUBECTL_BASE_IMAGE="${KUBECTL_BASE_IMAGE:-$KUBE_GORUNNER_IMAGE}"
112111

113112
# This is the image used in a multi-stage build to apply capabilities to Docker-wrapped binaries.
114113
readonly KUBE_BUILD_SETCAP_IMAGE="${KUBE_BUILD_SETCAP_IMAGE:-$KUBE_BASE_IMAGE_REGISTRY/setcap:$__default_setcap_version}"
115114

116-
# Get the set of master binaries that run in Docker (on Linux), or as Host Process Containers (on Windows).
115+
# Get the set of master binaries that run in Docker (on Linux)
117116
# Entry format is "<binary-name>,<base-image>".
118-
# Binaries are placed in /usr/local/bin inside the image (Linux), or C:\hpc (Windows).
117+
# Binaries are placed in /usr/local/bin inside the image.
119118
# `make` users can override any or all of the base images using the associated
120119
# environment variables.
121120
#
122-
# $1 - OS name - the targets returned will be based on the OS name given.
121+
# $1 - server architecture
123122
kube::build::get_docker_wrapped_binaries() {
124123
### If you change any of these lists, please also update DOCKERIZED_BINARIES
125124
### in build/BUILD. And kube::golang::server_image_targets
126-
local os_name="${1:-}"
127125
local targets=(
128126
"kube-apiserver,${KUBE_APISERVER_BASE_IMAGE}"
129127
"kube-controller-manager,${KUBE_CONTROLLER_MANAGER_BASE_IMAGE}"
130128
"kube-scheduler,${KUBE_SCHEDULER_BASE_IMAGE}"
131129
"kube-proxy,${KUBE_PROXY_BASE_IMAGE}"
132130
"kubectl,${KUBECTL_BASE_IMAGE}"
133131
)
134-
if [[ "${os_name}" = "windows" ]]; then
135-
targets=(
136-
"kube-proxy.exe,${KUBE_PROXY_WINDOWS_BASE_IMAGE}"
137-
)
138-
fi
139132

140133
echo "${targets[@]}"
141134
}

build/lib/release.sh

Lines changed: 26 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ readonly RELEASE_TARS="${LOCAL_OUTPUT_ROOT}/release-tars"
2929
readonly RELEASE_IMAGES="${LOCAL_OUTPUT_ROOT}/release-images"
3030

3131
KUBE_BUILD_CONFORMANCE=${KUBE_BUILD_CONFORMANCE:-n}
32-
KUBE_BUILD_WINDOWS=${KUBE_BUILD_WINDOWS:-n}
3332
KUBE_BUILD_PULL_LATEST_IMAGES=${KUBE_BUILD_PULL_LATEST_IMAGES:-y}
3433

3534
# ---------------------------------------------------------------------------
@@ -147,7 +146,7 @@ function kube::release::package_node_tarballs() {
147146
"${release_stage}/node/bin/"
148147

149148
# TODO: Docker images here
150-
# kube::release::create_docker_images_for_server "${release_stage}/server/bin" "${arch}" "${os}"
149+
# kube::release::create_docker_images_for_server "${release_stage}/server/bin" "${arch}"
151150

152151
# Include the client binaries here too as they are useful debugging tools.
153152
local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
@@ -175,24 +174,14 @@ function kube::release::package_node_tarballs() {
175174
# Package up all of the server binaries in docker images
176175
function kube::release::build_server_images() {
177176
kube::util::ensure-docker-buildx
178-
docker buildx create --name img-builder --use || true
179-
docker buildx inspect --bootstrap
180-
kube::util::trap_add 'docker buildx rm' EXIT
181-
182-
platforms=("${KUBE_SERVER_PLATFORMS[@]}")
183-
if [[ "${KUBE_BUILD_WINDOWS}" =~ [yY] ]]; then
184-
platforms=("${KUBE_SERVER_PLATFORMS[@]}" "windows/amd64")
185-
fi
186177

187178
# Clean out any old images
188179
rm -rf "${RELEASE_IMAGES}"
189180
local platform
190-
for platform in "${platforms[@]}"; do
181+
for platform in "${KUBE_SERVER_PLATFORMS[@]}"; do
191182
local platform_tag
192-
local os
193183
local arch
194184
platform_tag=${platform/\//-} # Replace a "/" for a "-"
195-
os=$(dirname "${platform}")
196185
arch=$(basename "${platform}")
197186
kube::log::status "Building images: $platform_tag"
198187

@@ -203,16 +192,11 @@ function kube::release::build_server_images() {
203192

204193
# This fancy expression will expand to prepend a path
205194
# (${LOCAL_OUTPUT_BINPATH}/${platform}/) to every item in the
206-
# KUBE_SERVER_LINUX_IMAGE_BINARIES / KUBE_SERVER_WINDOWS_IMAGE_BINARIES array.
207-
if [[ "${os}" = "windows" ]]; then
208-
cp "${KUBE_SERVER_WINDOWS_IMAGE_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
209-
"${release_stage}/server/bin/"
210-
else
211-
cp "${KUBE_SERVER_LINUX_IMAGE_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
212-
"${release_stage}/server/bin/"
213-
fi
195+
# KUBE_SERVER_IMAGE_BINARIES array.
196+
cp "${KUBE_SERVER_IMAGE_BINARIES[@]/#/${LOCAL_OUTPUT_BINPATH}/${platform}/}" \
197+
"${release_stage}/server/bin/"
214198

215-
kube::release::create_docker_images_for_server "${release_stage}/server/bin" "${arch}" "${os}"
199+
kube::release::create_docker_images_for_server "${release_stage}/server/bin" "${arch}"
216200
done
217201
}
218202

@@ -301,19 +285,16 @@ function kube::release::build_conformance_image() {
301285
# Args:
302286
# $1 - binary_dir, the directory to save the tared images to.
303287
# $2 - arch, architecture for which we are building docker images.
304-
# $3 - os, the OS for which we are building docker images.
305288
function kube::release::create_docker_images_for_server() {
306289
# Create a sub-shell so that we don't pollute the outer environment
307290
(
308291
local binary_dir
309-
local os
310292
local arch
311293
local binaries
312294
local images_dir
313295
binary_dir="$1"
314296
arch="$2"
315-
os="${3:-linux}"
316-
binaries=$(kube::build::get_docker_wrapped_binaries "${os}")
297+
binaries=$(kube::build::get_docker_wrapped_binaries)
317298
images_dir="${RELEASE_IMAGES}/${arch}"
318299
mkdir -p "${images_dir}"
319300

@@ -339,65 +320,51 @@ function kube::release::create_docker_images_for_server() {
339320

340321
for wrappable in $binaries; do
341322

342-
# The full binary name might have a file extension (.exe).
343-
local full_binary_name=${wrappable%%,*}
344-
local binary_name=${full_binary_name%%.*}
323+
local binary_name=${wrappable%%,*}
345324
local base_image=${wrappable##*,}
346-
local binary_file_path="${binary_dir}/${full_binary_name}"
347-
local tar_path="${binary_dir}/${full_binary_name}.tar"
325+
local binary_file_path="${binary_dir}/${binary_name}"
348326
local docker_build_path="${binary_file_path}.dockerbuild"
349327
local docker_image_tag="${docker_registry}/${binary_name}-${arch}:${docker_tag}"
350328

351329
local docker_file_path="${KUBE_ROOT}/build/server-image/Dockerfile"
352330
# If this binary has its own Dockerfile use that else use the generic Dockerfile.
353-
if [[ "${os}" = "windows" && -f "${KUBE_ROOT}/build/server-image/${binary_name}/Dockerfile_windows" ]]; then
354-
docker_file_path="${KUBE_ROOT}/build/server-image/${binary_name}/Dockerfile_windows"
355-
elif [[ -f "${KUBE_ROOT}/build/server-image/${binary_name}/Dockerfile" ]]; then
331+
if [[ -f "${KUBE_ROOT}/build/server-image/${binary_name}/Dockerfile" ]]; then
356332
docker_file_path="${KUBE_ROOT}/build/server-image/${binary_name}/Dockerfile"
357333
fi
358334

359-
kube::log::status "Starting docker build for image: ${binary_name}-${os}-${arch}"
335+
kube::log::status "Starting docker build for image: ${binary_name}-${arch}"
360336
(
361337
rm -rf "${docker_build_path}"
362338
mkdir -p "${docker_build_path}"
363-
ln "${binary_file_path}" "${docker_build_path}/${full_binary_name}"
364-
365-
# If we are building an official/alpha/beta release we want to keep
366-
# docker images and tag them appropriately.
367-
local additional_tag=()
368-
local release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}"
369-
370-
# append the OS name only for Windows images into the image name.
371-
if [[ "${os}" = "windows" ]]; then
372-
docker_image_tag="${docker_registry}/${binary_name}-${os}-${arch}:${docker_tag}"
373-
release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${os}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}"
374-
fi
375-
376-
if [[ "${release_docker_image_tag}" != "${docker_image_tag}" ]]; then
377-
kube::log::status "Adding additional tag ${release_docker_image_tag} for docker image ${docker_image_tag}"
378-
"${DOCKER[@]}" rmi "${release_docker_image_tag}" 2>/dev/null || true
379-
additional_tag=("-t" "${release_docker_image_tag}")
380-
fi
339+
ln "${binary_file_path}" "${docker_build_path}/${binary_name}"
381340

382341
local build_log="${docker_build_path}/build.log"
383342
if ! DOCKER_CLI_EXPERIMENTAL=enabled "${DOCKER[@]}" buildx build \
384343
-f "${docker_file_path}" \
385-
--platform "${os}/${arch}" \
386-
--output type=docker,dest="${tar_path}" \
387-
${docker_build_opts:+"${docker_build_opts}"} \
388-
-t "${docker_image_tag}" "${additional_tag[@]}" \
344+
--platform linux/"${arch}" \
345+
--load ${docker_build_opts:+"${docker_build_opts}"} \
346+
-t "${docker_image_tag}" \
389347
--build-arg BASEIMAGE="${base_image}" \
390348
--build-arg SETCAP_IMAGE="${KUBE_BUILD_SETCAP_IMAGE}" \
391-
--build-arg BINARY="${full_binary_name}" \
349+
--build-arg BINARY="${binary_name}" \
392350
"${docker_build_path}" >"${build_log}" 2>&1; then
393351
cat "${build_log}"
394352
exit 1
395353
fi
396354
rm "${build_log}"
397355

356+
# If we are building an official/alpha/beta release we want to keep
357+
# docker images and tag them appropriately.
358+
local -r release_docker_image_tag="${KUBE_DOCKER_REGISTRY-$docker_registry}/${binary_name}-${arch}:${KUBE_DOCKER_IMAGE_TAG-$docker_tag}"
359+
if [[ "${release_docker_image_tag}" != "${docker_image_tag}" ]]; then
360+
kube::log::status "Tagging docker image ${docker_image_tag} as ${release_docker_image_tag}"
361+
"${DOCKER[@]}" rmi "${release_docker_image_tag}" 2>/dev/null || true
362+
"${DOCKER[@]}" tag "${docker_image_tag}" "${release_docker_image_tag}" 2>/dev/null
363+
fi
364+
"${DOCKER[@]}" save -o "${binary_file_path}.tar" "${docker_image_tag}" "${release_docker_image_tag}"
398365
echo "${docker_tag}" > "${binary_file_path}.docker_tag"
399366
rm -rf "${docker_build_path}"
400-
ln "${tar_path}" "${images_dir}/"
367+
ln "${binary_file_path}.tar" "${images_dir}/"
401368

402369
kube::log::status "Deleting docker image ${docker_image_tag}"
403370
"${DOCKER[@]}" rmi "${docker_image_tag}" &>/dev/null || true

build/release-images.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ kube::build::verify_prereqs
3939
kube::build::build_image
4040
kube::build::run_build_command make all WHAT="${CMD_TARGETS}" KUBE_BUILD_PLATFORMS="${KUBE_SERVER_PLATFORMS[*]}" DBG="${DBG:-}"
4141

42-
if [[ "${KUBE_BUILD_WINDOWS}" =~ [yY] ]]; then
43-
kube::build::run_build_command make all WHAT="cmd/kube-proxy" KUBE_BUILD_PLATFORMS="windows/amd64"
44-
fi
45-
4642
kube::build::copy_output
4743

4844
kube::release::build_server_images

build/root/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ define RELEASE_IMAGES_HELP_INFO
389389
# Args:
390390
# KUBE_BUILD_CONFORMANCE: Whether to build conformance testing image as well. Set to 'n' to skip.
391391
# DBG: If set to "1", build with optimizations disabled for easier debugging. Any other value is ignored.
392-
# KUBE_BUILD_WINDOWS: Whether to build images for Windows as well. Set to 'y' to enable.
393392
#
394393
# Example:
395394
# make release-images
@@ -439,7 +438,6 @@ define QUICK_RELEASE_IMAGES_HELP_INFO
439438
# KUBE_FASTBUILD: Whether to cross-compile for other architectures. Set to 'false' to do so.
440439
# KUBE_BUILD_CONFORMANCE: Whether to build conformance testing image as well. Set to 'y' to do so.
441440
# DBG: If set to "1", build with optimizations disabled for easier debugging. Any other value is ignored.
442-
# KUBE_BUILD_WINDOWS: Whether to build images for Windows as well. Set to 'y' to enable.
443441
#
444442
# Example:
445443
# make quick-release-images

build/server-image/kube-proxy/Dockerfile_windows

Lines changed: 0 additions & 28 deletions
This file was deleted.

hack/lib/golang.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ kube::golang::server_image_targets() {
101101

102102
IFS=" " read -ra KUBE_SERVER_IMAGE_TARGETS <<< "$(kube::golang::server_image_targets)"
103103
readonly KUBE_SERVER_IMAGE_TARGETS
104-
readonly KUBE_SERVER_LINUX_IMAGE_BINARIES=("${KUBE_SERVER_IMAGE_TARGETS[@]##*/}")
105-
readonly KUBE_SERVER_WINDOWS_IMAGE_BINARIES=("kube-proxy.exe")
104+
readonly KUBE_SERVER_IMAGE_BINARIES=("${KUBE_SERVER_IMAGE_TARGETS[@]##*/}")
106105

107106
# The set of conformance targets we build docker image for
108107
kube::golang::conformance_image_targets() {

0 commit comments

Comments
 (0)