mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	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:
		@@ -12,8 +12,13 @@
 | 
				
			|||||||
# See the License for the specific language governing permissions and
 | 
					# See the License for the specific language governing permissions and
 | 
				
			||||||
# limitations under the License.
 | 
					# limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The line below points to distroless/base as of 2021-06-29. The SHA should be
 | 
					# The line below points to the latest go-runner image, a wrapper around
 | 
				
			||||||
# kept in sycn with distroless_base definition in the WORKSPACE file.
 | 
					# gcr.io/distroless/static which adds the go-runner command that we need
 | 
				
			||||||
FROM gcr.io/distroless/base@sha256:5e3fac1733c75e0e879a9770724e3960610a5cfbbfb5366559fbc334fe86c249
 | 
					# 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
 | 
					COPY kubemark /kubemark
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -336,6 +336,7 @@ readonly KUBE_STATIC_LIBRARIES=(
 | 
				
			|||||||
  kube-proxy
 | 
					  kube-proxy
 | 
				
			||||||
  kubeadm
 | 
					  kubeadm
 | 
				
			||||||
  kubectl
 | 
					  kubectl
 | 
				
			||||||
 | 
					  kubemark
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Fully-qualified package names that we want to instrument for coverage information.
 | 
					# Fully-qualified package names that we want to instrument for coverage information.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,12 +49,12 @@ spec:
 | 
				
			|||||||
            fieldRef:
 | 
					            fieldRef:
 | 
				
			||||||
              fieldPath: metadata.name
 | 
					              fieldPath: metadata.name
 | 
				
			||||||
        command: [
 | 
					        command: [
 | 
				
			||||||
 | 
					          "/go-runner",
 | 
				
			||||||
 | 
					          "-log-file=/var/log/kubelet-$(NODE_NAME).log",
 | 
				
			||||||
          "/kubemark",
 | 
					          "/kubemark",
 | 
				
			||||||
          "--morph=kubelet",
 | 
					          "--morph=kubelet",
 | 
				
			||||||
          "--name=$(NODE_NAME)",
 | 
					          "--name=$(NODE_NAME)",
 | 
				
			||||||
          "--kubeconfig=/kubeconfig/kubelet.kubeconfig",
 | 
					          "--kubeconfig=/kubeconfig/kubelet.kubeconfig",
 | 
				
			||||||
          "--log-file=/var/log/kubelet-$(NODE_NAME).log",
 | 
					 | 
				
			||||||
          "--logtostderr=false",
 | 
					 | 
				
			||||||
          "--node-labels={{hollow_node_labels}}",
 | 
					          "--node-labels={{hollow_node_labels}}",
 | 
				
			||||||
          {{hollow_kubelet_params}}
 | 
					          {{hollow_kubelet_params}}
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
@@ -80,12 +80,12 @@ spec:
 | 
				
			|||||||
            fieldRef:
 | 
					            fieldRef:
 | 
				
			||||||
              fieldPath: metadata.name
 | 
					              fieldPath: metadata.name
 | 
				
			||||||
        command: [
 | 
					        command: [
 | 
				
			||||||
 | 
					          "/go-runner",
 | 
				
			||||||
 | 
					          "-log-file=/var/log/kubeproxy-$(NODE_NAME).log",
 | 
				
			||||||
          "/kubemark",
 | 
					          "/kubemark",
 | 
				
			||||||
          "--morph=proxy",
 | 
					          "--morph=proxy",
 | 
				
			||||||
          "--name=$(NODE_NAME)",
 | 
					          "--name=$(NODE_NAME)",
 | 
				
			||||||
          "--kubeconfig=/kubeconfig/kubeproxy.kubeconfig",
 | 
					          "--kubeconfig=/kubeconfig/kubeproxy.kubeconfig",
 | 
				
			||||||
          "--log-file=/var/log/kubeproxy-$(NODE_NAME).log",
 | 
					 | 
				
			||||||
          "--logtostderr=false",
 | 
					 | 
				
			||||||
          {{hollow_proxy_params}}
 | 
					          {{hollow_proxy_params}}
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
        volumeMounts:
 | 
					        volumeMounts:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user