mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Merge pull request #116672 from dims/add-an-image-for-kubectl
Add an image for kubectl
This commit is contained in:
commit
3c076e4b7d
@ -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_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_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 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.
|
# 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}"
|
readonly KUBE_BUILD_SETCAP_IMAGE="${KUBE_BUILD_SETCAP_IMAGE:-$KUBE_BASE_IMAGE_REGISTRY/setcap:$__default_setcap_version}"
|
||||||
@ -124,6 +125,7 @@ kube::build::get_docker_wrapped_binaries() {
|
|||||||
"kube-controller-manager,${KUBE_CONTROLLER_MANAGER_BASE_IMAGE}"
|
"kube-controller-manager,${KUBE_CONTROLLER_MANAGER_BASE_IMAGE}"
|
||||||
"kube-scheduler,${KUBE_SCHEDULER_BASE_IMAGE}"
|
"kube-scheduler,${KUBE_SCHEDULER_BASE_IMAGE}"
|
||||||
"kube-proxy,${KUBE_PROXY_BASE_IMAGE}"
|
"kube-proxy,${KUBE_PROXY_BASE_IMAGE}"
|
||||||
|
"kubectl,${KUBECTL_BASE_IMAGE}"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "${targets[@]}"
|
echo "${targets[@]}"
|
||||||
|
23
build/server-image/kubectl/Dockerfile
Normal file
23
build/server-image/kubectl/Dockerfile
Normal file
@ -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"]
|
@ -95,6 +95,7 @@ kube::golang::server_image_targets() {
|
|||||||
cmd/kube-controller-manager
|
cmd/kube-controller-manager
|
||||||
cmd/kube-scheduler
|
cmd/kube-scheduler
|
||||||
cmd/kube-proxy
|
cmd/kube-proxy
|
||||||
|
cmd/kubectl
|
||||||
)
|
)
|
||||||
echo "${targets[@]}"
|
echo "${targets[@]}"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user