Skip to content

Commit

Permalink
Add an image for kubectl
Browse files Browse the repository at this point in the history
Signed-off-by: Davanum Srinivas <[email protected]>
  • Loading branch information
dims committed Mar 16, 2023
1 parent 742316e commit 41ed0e1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ readonly KUBE_APISERVER_BASE_IMAGE="${KUBE_APISERVER_BASE_IMAGE:-$KUBE_GORUNNER_
readonly KUBE_CONTROLLER_MANAGER_BASE_IMAGE="${KUBE_CONTROLLER_MANAGER_BASE_IMAGE:-$KUBE_GORUNNER_IMAGE}"
readonly KUBE_SCHEDULER_BASE_IMAGE="${KUBE_SCHEDULER_BASE_IMAGE:-$KUBE_GORUNNER_IMAGE}"
readonly KUBE_PROXY_BASE_IMAGE="${KUBE_PROXY_BASE_IMAGE:-$KUBE_BASE_IMAGE_REGISTRY/distroless-iptables:$__default_distroless_iptables_version}"
readonly KUBECTL_BASE_IMAGE="${KUBECTL_BASE_IMAGE:-$KUBE_GORUNNER_IMAGE}"

# This is the image used in a multi-stage build to apply capabilities to Docker-wrapped binaries.
readonly KUBE_BUILD_SETCAP_IMAGE="${KUBE_BUILD_SETCAP_IMAGE:-$KUBE_BASE_IMAGE_REGISTRY/setcap:$__default_setcap_version}"
Expand All @@ -124,6 +125,7 @@ kube::build::get_docker_wrapped_binaries() {
"kube-controller-manager,${KUBE_CONTROLLER_MANAGER_BASE_IMAGE}"
"kube-scheduler,${KUBE_SCHEDULER_BASE_IMAGE}"
"kube-proxy,${KUBE_PROXY_BASE_IMAGE}"
"kubectl,${KUBECTL_BASE_IMAGE}"
)

echo "${targets[@]}"
Expand Down
23 changes: 23 additions & 0 deletions build/server-image/kubectl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 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.

# Dockerfile used for the kubectl image.

ARG BASEIMAGE
ARG BINARY


FROM "${BASEIMAGE}"
COPY ${BINARY} /bin/
ENTRYPOINT ["/bin/kubectl"]
1 change: 1 addition & 0 deletions hack/lib/golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ kube::golang::server_image_targets() {
cmd/kube-controller-manager
cmd/kube-scheduler
cmd/kube-proxy
cmd/kubectl
)
echo "${targets[@]}"
}
Expand Down

0 comments on commit 41ed0e1

Please sign in to comment.