diff --git a/build/debian-hyperkube-base/.gitignore b/build/debian-hyperkube-base/.gitignore deleted file mode 100644 index 827612c4ee9..00000000000 --- a/build/debian-hyperkube-base/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/cni-tars diff --git a/build/debian-hyperkube-base/Dockerfile b/build/debian-hyperkube-base/Dockerfile deleted file mode 100644 index bdb982c3cfb..00000000000 --- a/build/debian-hyperkube-base/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM BASEIMAGE - -# TODO(#69896): deprecate the shortened aliases in / -RUN ln -s /hyperkube /apiserver \ - && ln -s /hyperkube /cloud-controller-manager \ - && ln -s /hyperkube /controller-manager \ - && ln -s /hyperkube /kubectl \ - && ln -s /hyperkube /kubelet \ - && ln -s /hyperkube /proxy \ - && ln -s /hyperkube /scheduler \ - && ln -s /hyperkube /usr/local/bin/cloud-controller-manager \ - && ln -s /hyperkube /usr/local/bin/kube-apiserver \ - && ln -s /hyperkube /usr/local/bin/kube-controller-manager \ - && ln -s /hyperkube /usr/local/bin/kube-proxy \ - && ln -s /hyperkube /usr/local/bin/kube-scheduler \ - && ln -s /hyperkube /usr/local/bin/kubectl \ - && ln -s /hyperkube /usr/local/bin/kubelet - -RUN echo CACHEBUST>/dev/null && clean-install \ - bash - -# The samba-common, cifs-utils, and nfs-common packages depend on -# ucf, which itself depends on /bin/bash. -RUN echo "dash dash/sh boolean false" | debconf-set-selections -RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash - -RUN echo CACHEBUST>/dev/null && clean-install \ - ca-certificates \ - ceph-common \ - cifs-utils \ - conntrack \ - e2fsprogs \ - xfsprogs \ - ebtables \ - ethtool \ - git \ - glusterfs-client \ - iptables \ - ipset \ - jq \ - kmod \ - openssh-client \ - netbase \ - nfs-common \ - socat \ - udev \ - util-linux - -COPY cni-bin/bin /opt/cni/bin diff --git a/build/debian-hyperkube-base/Makefile b/build/debian-hyperkube-base/Makefile deleted file mode 100644 index b237b14535f..00000000000 --- a/build/debian-hyperkube-base/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 2017 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Build the hyperkube base image. This image is used to build the hyperkube image. -# -# Usage: -# [ARCH=amd64] [REGISTRY="staging-k8s.gcr.io"] make (build|push) - -REGISTRY?=staging-k8s.gcr.io -IMAGE?=$(REGISTRY)/debian-hyperkube-base -TAG=0.12.2 -ARCH?=amd64 -ALL_ARCH = amd64 arm arm64 ppc64le s390x -CACHEBUST?=1 - -BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.4.1 -CNI_VERSION=v0.8.5 - -TEMP_DIR:=$(shell mktemp -d) -CNI_TARBALL=cni-plugins-linux-$(ARCH)-$(CNI_VERSION).tgz - -# This option is for running docker manifest command -export DOCKER_CLI_EXPERIMENTAL := enabled - -SUDO=$(if $(filter 0,$(shell id -u)),,sudo) - -.PHONY: all build push clean all-build all-push-images all-push push-manifest - -all: all-push - -sub-build-%: - $(MAKE) ARCH=$* build - -all-build: $(addprefix sub-build-,$(ALL_ARCH)) - -sub-push-image-%: - $(MAKE) ARCH=$* push - -all-push-images: $(addprefix sub-push-image-,$(ALL_ARCH)) - -all-push: all-push-images push-manifest - -push-manifest: - docker manifest create --amend $(IMAGE):$(TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(IMAGE)\-&:$(TAG)~g") - @for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${IMAGE}:${TAG} ${IMAGE}-$${arch}:${TAG}; done - docker manifest push --purge ${IMAGE}:${TAG} - -cni-tars/$(CNI_TARBALL): - mkdir -p cni-tars/ - cd cni-tars/ && curl -sSLO --retry 5 https://storage.googleapis.com/k8s-artifacts-cni/release/${CNI_VERSION}/${CNI_TARBALL} - -clean: - rm -rf cni-tars/ - -build: cni-tars/$(CNI_TARBALL) - cp Dockerfile $(TEMP_DIR) - cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile - -ifeq ($(CACHEBUST),1) - cd ${TEMP_DIR} && sed -i.back "s|CACHEBUST|$(shell uuidgen)|g" Dockerfile -endif - - mkdir -p ${TEMP_DIR}/cni-bin/bin - tar -xz -C ${TEMP_DIR}/cni-bin/bin -f "cni-tars/${CNI_TARBALL}" - -ifneq ($(ARCH),amd64) - # Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel - $(SUDO) ../../third_party/multiarch/qemu-user-static/register/register.sh --reset -endif - docker build --pull -t $(IMAGE)-$(ARCH):$(TAG) $(TEMP_DIR) - rm -rf $(TEMP_DIR) - -push: build - docker push $(IMAGE)-$(ARCH):$(TAG) diff --git a/build/debian-hyperkube-base/OWNERS b/build/debian-hyperkube-base/OWNERS deleted file mode 100644 index de80d6debf7..00000000000 --- a/build/debian-hyperkube-base/OWNERS +++ /dev/null @@ -1,12 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - BenTheElder - - mkumatag - - tallclair -approvers: - - BenTheElder - - mkumatag - - tallclair -labels: -- sig/release diff --git a/build/debian-hyperkube-base/README.md b/build/debian-hyperkube-base/README.md deleted file mode 100644 index b37c04ddf23..00000000000 --- a/build/debian-hyperkube-base/README.md +++ /dev/null @@ -1,25 +0,0 @@ -### debian-hyperkube-base - -Serves as the base image for `k8s.gcr.io/hyperkube-${ARCH}` -images. - -This image is compiled for multiple architectures. - -#### How to release - -If you're editing the Dockerfile or some other thing, please bump the `TAG` in the Makefile. - -```console -# Build and push images for all the architectures -$ make all-push -# ---> staging-k8s.gcr.io/debian-hyperkube-base-amd64:TAG -# ---> staging-k8s.gcr.io/debian-hyperkube-base-arm:TAG -# ---> staging-k8s.gcr.io/debian-hyperkube-base-arm64:TAG -# ---> staging-k8s.gcr.io/debian-hyperkube-base-ppc64le:TAG -# ---> staging-k8s.gcr.io/debian-hyperkube-base-s390x:TAG -``` - -If you don't want to push the images, run `make all-build` instead - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build/debian-hyperkube-base/README.md?pixel)]() diff --git a/build/dependencies.yaml b/build/dependencies.yaml index dd38ad72059..c2e61514f9c 100644 --- a/build/dependencies.yaml +++ b/build/dependencies.yaml @@ -46,8 +46,6 @@ dependencies: - name: "cni" version: 0.8.5 refPaths: - - path: build/debian-hyperkube-base/Makefile - match: CNI_VERSION= - path: build/workspace.bzl match: CNI_VERSION = - path: cluster/gce/gci/configure.sh diff --git a/build/lib/release.sh b/build/lib/release.sh index 6d23dc20339..0c5bfbae569 100644 --- a/build/lib/release.sh +++ b/build/lib/release.sh @@ -299,24 +299,6 @@ function kube::release::sha1() { fi } -function kube::release::build_hyperkube_image() { - local -r arch="$1" - local -r registry="$2" - local -r version="$3" - local -r save_dir="${4-}" - kube::log::status "Building hyperkube image for arch: ${arch}" - ARCH="${arch}" REGISTRY="${registry}" VERSION="${version}" \ - make -C cluster/images/hyperkube/ build >/dev/null - - local hyperkube_tag - hyperkube_tag="${registry}/hyperkube-${arch}:${version}" - if [[ -n "${save_dir}" ]]; then - "${DOCKER[@]}" save "${hyperkube_tag}" > "${save_dir}/hyperkube-${arch}.tar" - fi - kube::log::status "Deleting hyperkube image ${hyperkube_tag}" - "${DOCKER[@]}" rmi "${hyperkube_tag}" &>/dev/null || true -} - function kube::release::build_conformance_image() { local -r arch="$1" local -r registry="$2" @@ -416,10 +398,6 @@ EOF ) & done - if [[ "${KUBE_BUILD_HYPERKUBE}" =~ [yY] ]]; then - kube::release::build_hyperkube_image "${arch}" "${docker_registry}" \ - "${docker_tag}" "${images_dir}" & - fi if [[ "${KUBE_BUILD_CONFORMANCE}" =~ [yY] ]]; then kube::release::build_conformance_image "${arch}" "${docker_registry}" \ "${docker_tag}" "${images_dir}" & diff --git a/build/release-images.sh b/build/release-images.sh index e2f0bdd2aff..6a5ea6b4972 100755 --- a/build/release-images.sh +++ b/build/release-images.sh @@ -30,11 +30,6 @@ if [[ "${KUBE_BUILD_CONFORMANCE}" =~ [yY] ]]; then CMD_TARGETS="${CMD_TARGETS} ${KUBE_CONFORMANCE_IMAGE_TARGETS[*]}" fi -# TODO(dims): Remove this when we get rid of hyperkube image -if [[ "${KUBE_BUILD_HYPERKUBE}" =~ [yY] ]]; then - CMD_TARGETS=$(echo "${CMD_TARGETS} cmd/kubelet cmd/kubectl" | tr ' ' '\n' | sort | uniq | tr '\n' ' ') -fi - kube::build::verify_prereqs kube::build::build_image kube::build::run_build_command make all WHAT="${CMD_TARGETS}" KUBE_BUILD_PLATFORMS="${KUBE_SERVER_PLATFORMS[*]}" diff --git a/build/workspace.bzl b/build/workspace.bzl index 2f73d71169c..6e91b94c73e 100644 --- a/build/workspace.bzl +++ b/build/workspace.bzl @@ -125,15 +125,6 @@ def debian_image_dependencies(): tag = "v12.0.1", # ignored, but kept here for documentation ) - container_pull( - name = "debian-hyperkube-base-" + arch, - architecture = arch, - digest = _digest(_DEBIAN_HYPERKUBE_BASE_DIGEST, arch), - registry = "k8s.gcr.io", - repository = "debian-hyperkube-base", - tag = "0.12.1", # ignored, but kept here for documentation - ) - def etcd_tarballs(): for arch, sha in _ETCD_TARBALL_ARCH_SHA256.items(): http_archive( diff --git a/cluster/BUILD b/cluster/BUILD index 9b2ba53952a..87433619a07 100644 --- a/cluster/BUILD +++ b/cluster/BUILD @@ -18,7 +18,6 @@ filegroup( "//cluster/images/conformance:all-srcs", "//cluster/images/etcd-version-monitor:all-srcs", "//cluster/images/etcd/migrate:all-srcs", - "//cluster/images/hyperkube:all-srcs", "//cluster/images/kubemark:all-srcs", ], tags = ["automanaged"], diff --git a/cluster/images/conformance/BUILD b/cluster/images/conformance/BUILD index b7b328f1abe..12a7fb40ceb 100644 --- a/cluster/images/conformance/BUILD +++ b/cluster/images/conformance/BUILD @@ -23,7 +23,7 @@ container_layer( multi_arch_container( name = "conformance", architectures = SERVER_PLATFORMS["linux"], - base = "@debian-hyperkube-base-{ARCH}//image", + base = "@debian-base-{ARCH}//image", cmd = [ "/bin/bash", "-c", diff --git a/cluster/images/hyperkube/BUILD b/cluster/images/hyperkube/BUILD deleted file mode 100644 index 59d3b7a4ed7..00000000000 --- a/cluster/images/hyperkube/BUILD +++ /dev/null @@ -1,58 +0,0 @@ -load("@io_bazel_rules_docker//container:container.bzl", "container_layer") -load("//build:container.bzl", "multi_arch_container") -load("//build:platforms.bzl", "SERVER_PLATFORMS") - -container_layer( - name = "scripts", - directory = "/", - files = [ - "hyperkube", - ], -) - -container_layer( - name = "bins", - directory = "/usr/local/bin", - files = [ - "//cmd/kube-apiserver", - "//cmd/kube-controller-manager", - "//cmd/kube-proxy", - "//cmd/kube-scheduler", - "//cmd/kubectl", - "//cmd/kubelet", - ], -) - -multi_arch_container( - name = "image", - architectures = SERVER_PLATFORMS["linux"], - base = "@debian-hyperkube-base-{ARCH}//image", - cmd = [ - "/hyperkube", - ], - # {ARCH} is replaced by the macro, but STABLE_ vars are replaced by the - # build stamping, so we need to escape them - docker_push_tags = ["{{STABLE_DOCKER_PUSH_REGISTRY}}/hyperkube-{ARCH}:{{STABLE_DOCKER_TAG}}"], - docker_tags = ["{{STABLE_DOCKER_REGISTRY}}/hyperkube-{ARCH}:{{STABLE_DOCKER_TAG}}"], - layers = [ - ":bins", - ":scripts", - ], - stamp = True, - tags = ["manual"], - visibility = ["//visibility:public"], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], - visibility = ["//visibility:public"], -) diff --git a/cluster/images/hyperkube/Dockerfile b/cluster/images/hyperkube/Dockerfile deleted file mode 100644 index 3347b9b4c26..00000000000 --- a/cluster/images/hyperkube/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM BASEIMAGE - -# Cleanup all the soft links -ADD binaries.tgz /usr/local/bin - -# Copy the shell script -COPY hyperkube /hyperkube - -ENTRYPOINT ["/hyperkube"] \ No newline at end of file diff --git a/cluster/images/hyperkube/Makefile b/cluster/images/hyperkube/Makefile deleted file mode 100644 index 06f3c95fdee..00000000000 --- a/cluster/images/hyperkube/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2016 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Build the hyperkube image. -# -# Usage: -# [ARCH=amd64] [REGISTRY="staging-k8s.gcr.io"] make (build|push) VERSION={some_released_version_of_kubernetes} - -REGISTRY?=staging-k8s.gcr.io -ARCH?=amd64 -OUT_DIR?=_output - -BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.12.1 - -LOCAL_OUTPUT_PATH=$(shell pwd)/../../../$(OUT_DIR)/local/bin/linux/$(ARCH) -DOCKERIZED_OUTPUT_PATH=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH) -OUTPUT_PATH?=$(shell test -d $(LOCAL_OUTPUT_PATH) && echo $(LOCAL_OUTPUT_PATH) || echo $(DOCKERIZED_OUTPUT_PATH)) - -TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX) - -all: build - -build: - -ifndef VERSION - $(error VERSION is undefined) -endif - cp -r ./* ${TEMP_DIR} - - tar -cvzf ${TEMP_DIR}/binaries.tgz -C ${OUTPUT_PATH} kube-apiserver kube-controller-manager \ - kube-proxy kube-scheduler kubectl kubelet - - chmod a+rx ${TEMP_DIR}/hyperkube - - cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile - - docker build --pull -t ${REGISTRY}/hyperkube-${ARCH}:${VERSION} ${TEMP_DIR} - rm -rf "${TEMP_DIR}" - -push: build - docker push ${REGISTRY}/hyperkube-${ARCH}:${VERSION} -ifeq ($(ARCH),amd64) - docker rmi ${REGISTRY}/hyperkube:${VERSION} 2>/dev/null || true - docker tag ${REGISTRY}/hyperkube-${ARCH}:${VERSION} ${REGISTRY}/hyperkube:${VERSION} - docker push ${REGISTRY}/hyperkube:${VERSION} -endif - -.PHONY: build push all diff --git a/cluster/images/hyperkube/OWNERS b/cluster/images/hyperkube/OWNERS deleted file mode 100644 index 75dacf650f9..00000000000 --- a/cluster/images/hyperkube/OWNERS +++ /dev/null @@ -1,12 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - ixdy - - luxas - - mikedanese -approvers: - - ixdy - - luxas - - mikedanese -labels: -- sig/release diff --git a/cluster/images/hyperkube/README.md b/cluster/images/hyperkube/README.md deleted file mode 100644 index 09bcc762290..00000000000 --- a/cluster/images/hyperkube/README.md +++ /dev/null @@ -1,50 +0,0 @@ -### hyperkube - -`hyperkube` is an all-in-one binary for the Kubernetes server components. - -`hyperkube` is built for multiple architectures and _the image is pushed automatically on every release._ - -#### Images for development scenarios - -During the development process, it's effective to just build only the required binaries for specific -architecture and generate single hyperkube image from it. The following shows how to generate -linux/amd64 hyperkube image: - -```console -# Run the following from the top level kubernetes directory, to build the binaries necessary for creating hyperkube image. -$ KUBE_BUILD_PLATFORMS=linux/amd64 make kube-apiserver kube-controller-manager kube-proxy kube-scheduler kubectl kubelet - -# Create and push the hyperkube image -$ REGISTRY= VERSION= ARCH=amd64 make -C cluster/images/hyperkube push -``` - -#### How to release by hand - -```console -# First, build the binaries -$ build/run.sh make cross - -# Build for linux/amd64 (default) -# export REGISTRY=$HOST/$ORG to switch from staging-k8s.gcr.io - -$ make push VERSION={target_version} ARCH=amd64 -# ---> staging-k8s.gcr.io/hyperkube-amd64:VERSION -# ---> staging-k8s.gcr.io/hyperkube:VERSION (image with backwards-compatible naming) - -$ make push VERSION={target_version} ARCH=arm -# ---> staging-k8s.gcr.io/hyperkube-arm:VERSION - -$ make push VERSION={target_version} ARCH=arm64 -# ---> staging-k8s.gcr.io/hyperkube-arm64:VERSION - -$ make push VERSION={target_version} ARCH=ppc64le -# ---> staging-k8s.gcr.io/hyperkube-ppc64le:VERSION - -$ make push VERSION={target_version} ARCH=s390x -# ---> staging-k8s.gcr.io/hyperkube-s390x:VERSION -``` - -If you don't want to push the images, run `make` or `make build` instead - - -[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cluster/images/hyperkube/README.md?pixel)]() diff --git a/cluster/images/hyperkube/hyperkube b/cluster/images/hyperkube/hyperkube deleted file mode 100755 index c353797c2c6..00000000000 --- a/cluster/images/hyperkube/hyperkube +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2019 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -BINS=( - kube-apiserver - kube-controller-manager - kube-proxy - kube-scheduler - kubectl - kubelet -) - -function array_contains() { - local search="$1" - local element - shift - for element; do - if [[ "${element}" == "${search}" ]]; then - return 0 - fi - done - return 1 -} - -function print_usage() { - cat </dev/null; then - echo "${command}: command not found" - exit 1 - fi - exec "${command}" "${@}" -} - -main "${@}"