Package kube-log-runner as part of Kubernetes releases

kube-log-runner was formerly known as go-runner when it was originally introduced
in 393e0952e9
It was moved to kubernetes/release/images/build/go-runner later but is now
needed again in Kubernetes itself as replacement for the deprecated --log-file
klog feature: when bringing up a Windows node, kube-proxy.exe and kubelet.exe must be wrapped
with the helper binary to redirect output.

It got renamed to avoid a naming conflict with
test/conformance/image/go-runner and because the name was too vague.

Other downstream Kubernetes users may have a similar need, therefore it makes
sense to provide a prebuilt binary also in the release archives.
This commit is contained in:
Patrick Ohly
2021-11-03 15:39:26 +01:00
parent 23df2b97f7
commit d2a8a81639
5 changed files with 194 additions and 21 deletions

View File

@@ -885,15 +885,6 @@ function construct-windows-kubelet-flags {
# Configure kubelet to run as a windows service.
flags+=" --windows-service=true"
# TODO(mtaufen): Configure logging for kubelet running as a service. I haven't
# been able to figure out how to direct stdout/stderr into log files when
# configuring it to run via sc.exe, so we just manually override logging
# config here.
flags+=" --log-file=${WINDOWS_LOGS_DIR}\kubelet.log"
# klog sets this to true internally, so need to override to false so we
# actually log to the file
flags+=" --logtostderr=false"
# Configure the file path for host dns configuration
flags+=" --resolv-conf=${WINDOWS_CNI_DIR}\hostdns.conf"
@@ -931,16 +922,6 @@ function construct-windows-kubeproxy-flags {
# Configure kube-proxy to run as a windows service.
flags+=" --windows-service=true"
# TODO(mtaufen): Configure logging for kube-proxy running as a service.
# I haven't been able to figure out how to direct stdout/stderr into log
# files when configuring it to run via sc.exe, so we just manually
# override logging config here.
flags+=" --log-file=${WINDOWS_LOGS_DIR}\kube-proxy.log"
# klog sets this to true internally, so need to override to false
# so we actually log to the file
flags+=" --logtostderr=false"
# Enabling Windows DSR mode unlocks newer network features and reduces
# port usage for services.
# https://techcommunity.microsoft.com/t5/networking-blog/direct-server-return-dsr-in-a-nutshell/ba-p/693710

View File

@@ -1256,7 +1256,7 @@ function Start-WorkerServices {
"A kubelet process is already running, don't know what to do"
}
Log-Output "Creating kubelet service"
& sc.exe create kubelet binPath= "${env:NODE_DIR}\kubelet.exe ${kubelet_args}" start= demand
& sc.exe create kubelet binPath= "${env:NODE_DIR}\kube-log-runner.exe -log-file=${env:LOGS_DIR}\kubelet.log ${env:NODE_DIR}\kubelet.exe ${kubelet_args}" start= demand
& sc.exe failure kubelet reset= 0 actions= restart/10000
Log-Output "Starting kubelet service"
& sc.exe start kubelet
@@ -1270,7 +1270,7 @@ function Start-WorkerServices {
"A kube-proxy process is already running, don't know what to do"
}
Log-Output "Creating kube-proxy service"
& sc.exe create kube-proxy binPath= "${env:NODE_DIR}\kube-proxy.exe ${kubeproxy_args}" start= demand
& sc.exe create kube-proxy binPath= "${env:NODE_DIR}\kube-log-runner.exe -log-file=${env:LOGS_DIR}\kube-proxy.log ${env:NODE_DIR}\kube-proxy.exe ${kubeproxy_args}" start= demand
& sc.exe failure kube-proxy reset= 0 actions= restart/10000
Log-Output "Starting kube-proxy service"
& sc.exe start kube-proxy