kubemark: static binary, replace deprecated --log-file parameter

The --log-file parameter will be deprecated as of Kubernetes 1.23 and should be
avoided. The replacement for distroless images is the image with go-runner, a
tool that handles output redirection.

For kubemark to run in that image it must be built as static binary.
This commit is contained in:
Patrick Ohly 2021-11-04 11:33:00 +01:00
parent 23df2b97f7
commit c3cd9a3902
3 changed files with 13 additions and 7 deletions

View File

@ -12,8 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# The line below points to distroless/base as of 2021-06-29. The SHA should be
# kept in sycn with distroless_base definition in the WORKSPACE file.
FROM gcr.io/distroless/base@sha256:5e3fac1733c75e0e879a9770724e3960610a5cfbbfb5366559fbc334fe86c249
# The line below points to the latest go-runner image, a wrapper around
# gcr.io/distroless/static which adds the go-runner command that we need
# for redirecting log output.
#
# See https://console.cloud.google.com/gcr/images/k8s-staging-build-image/global/go-runner
# for a list of available versions. This base image should be updated
# periodically.
FROM k8s.gcr.io/build-image/go-runner:v2.3.1-go1.17.2-bullseye.0
COPY kubemark /kubemark

View File

@ -336,6 +336,7 @@ readonly KUBE_STATIC_LIBRARIES=(
kube-proxy
kubeadm
kubectl
kubemark
)
# Fully-qualified package names that we want to instrument for coverage information.

View File

@ -49,12 +49,12 @@ spec:
fieldRef:
fieldPath: metadata.name
command: [
"/go-runner",
"-log-file=/var/log/kubelet-$(NODE_NAME).log",
"/kubemark",
"--morph=kubelet",
"--name=$(NODE_NAME)",
"--kubeconfig=/kubeconfig/kubelet.kubeconfig",
"--log-file=/var/log/kubelet-$(NODE_NAME).log",
"--logtostderr=false",
"--node-labels={{hollow_node_labels}}",
{{hollow_kubelet_params}}
]
@ -80,12 +80,12 @@ spec:
fieldRef:
fieldPath: metadata.name
command: [
"/go-runner",
"-log-file=/var/log/kubeproxy-$(NODE_NAME).log",
"/kubemark",
"--morph=proxy",
"--name=$(NODE_NAME)",
"--kubeconfig=/kubeconfig/kubeproxy.kubeconfig",
"--log-file=/var/log/kubeproxy-$(NODE_NAME).log",
"--logtostderr=false",
{{hollow_proxy_params}}
]
volumeMounts: