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

Use debian-base instead of busybox as base image for server images #70245

Merged
merged 1 commit into from
Oct 29, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions build/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,23 @@ filegroup(
tags = ["automanaged"],
)

# ensure /etc/nsswitch.conf exists so go's resolver respects /etc/hosts
container_image(
name = "busybox-with-nsswitch",
base = "@official_busybox//image",
Copy link
Member

Choose a reason for hiding this comment

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

are we using this image elsewhere? otherwise we can also remove from WORKSPACE

Copy link
Member Author

Choose a reason for hiding this comment

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

cluster/images/kubemark/BUILD uses it. I was planning to switch it to debian-base and then remove it here in a follow-up PR; I wanted to keep this one focused on the server images.

Copy link
Member

Choose a reason for hiding this comment

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

SGTM 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

I kinda forgot about this, but now updating the kubemark image in #73539.

directory = "/etc",
files = ["nsswitch.conf"],
mode = "0644",
)

# This list should roughly match kube::build::get_docker_wrapped_binaries()
# in build/common.sh.
DOCKERIZED_BINARIES = {
"cloud-controller-manager": {
"base": ":busybox-with-nsswitch",
"base": "@debian-base-amd64//image",
"target": "//cmd/cloud-controller-manager:cloud-controller-manager",
},
"kube-apiserver": {
"base": ":busybox-with-nsswitch",
"base": "@debian-base-amd64//image",
"target": "//cmd/kube-apiserver:kube-apiserver",
},
"kube-controller-manager": {
"base": ":busybox-with-nsswitch",
"base": "@debian-base-amd64//image",
"target": "//cmd/kube-controller-manager:kube-controller-manager",
},
"kube-scheduler": {
"base": ":busybox-with-nsswitch",
"base": "@debian-base-amd64//image",
"target": "//cmd/kube-scheduler:kube-scheduler",
},
"kube-proxy": {
Expand Down
53 changes: 10 additions & 43 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,51 +88,18 @@ readonly KUBE_CONTAINER_RSYNC_PORT=8730
#
# $1 - server architecture
kube::build::get_docker_wrapped_binaries() {
debian_iptables_version=v11.0
local arch=$1
local debian_base_version=0.4.0
local debian_iptables_version=v11.0
### If you change any of these lists, please also update DOCKERIZED_BINARIES
### in build/BUILD. And kube::golang::server_image_targets
case $1 in
"amd64")
local targets=(
cloud-controller-manager,busybox
kube-apiserver,busybox
kube-controller-manager,busybox
kube-scheduler,busybox
kube-proxy,k8s.gcr.io/debian-iptables-amd64:${debian_iptables_version}
);;
"arm")
local targets=(
cloud-controller-manager,arm32v7/busybox
kube-apiserver,arm32v7/busybox
kube-controller-manager,arm32v7/busybox
kube-scheduler,arm32v7/busybox
kube-proxy,k8s.gcr.io/debian-iptables-arm:${debian_iptables_version}
);;
"arm64")
local targets=(
cloud-controller-manager,arm64v8/busybox
kube-apiserver,arm64v8/busybox
kube-controller-manager,arm64v8/busybox
kube-scheduler,arm64v8/busybox
kube-proxy,k8s.gcr.io/debian-iptables-arm64:${debian_iptables_version}
);;
"ppc64le")
local targets=(
cloud-controller-manager,ppc64le/busybox
kube-apiserver,ppc64le/busybox
kube-controller-manager,ppc64le/busybox
kube-scheduler,ppc64le/busybox
kube-proxy,k8s.gcr.io/debian-iptables-ppc64le:${debian_iptables_version}
);;
"s390x")
local targets=(
cloud-controller-manager,s390x/busybox
kube-apiserver,s390x/busybox
kube-controller-manager,s390x/busybox
kube-scheduler,s390x/busybox
kube-proxy,k8s.gcr.io/debian-iptables-s390x:${debian_iptables_version}
);;
esac
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}"
)
Copy link
Member

Choose a reason for hiding this comment

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

this alone is wonderful, thanks :-)


echo "${targets[@]}"
}
Expand Down
8 changes: 8 additions & 0 deletions build/root/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ http_file(
urls = mirror("https://github.com/kubernetes-incubator/cri-tools/releases/download/v%s/crictl-v%s-linux-amd64.tar.gz" % (CRI_TOOLS_VERSION, CRI_TOOLS_VERSION)),
)

docker_pull(
name = "debian-base-amd64",
digest = "sha256:86176bc8ccdc4d8ea7fbf6ba4b57fcefc2cb61ff7413114630940474ff9bf751",
registry = "k8s.gcr.io",
repository = "debian-base-amd64",
tag = "0.4.0", # ignored, but kept here for documentation
)

docker_pull(
name = "debian-iptables-amd64",
digest = "sha256:d4ff8136b9037694a3165a7fff6a91e7fc828741b8ea1eda226d4d9ea5d23abb",
Expand Down