From 243f4faa6d18a8caf239ff85ae68bdd557ee42f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Tyczy=C5=84ski?= Date: Tue, 30 Nov 2021 11:38:08 +0100 Subject: [PATCH] Update kubemark to use EndpointSlices and proper user-agents --- cmd/kubemark/hollow-node.go | 13 ++++++++----- pkg/kubemark/hollow_proxy.go | 21 +++++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/cmd/kubemark/hollow-node.go b/cmd/kubemark/hollow-node.go index 54258bfa32699..c48ec1e7ce935 100644 --- a/cmd/kubemark/hollow-node.go +++ b/cmd/kubemark/hollow-node.go @@ -180,12 +180,13 @@ func run(cmd *cobra.Command, config *hollowNodeConfig) error { return fmt.Errorf("Failed to create a ClientConfig, error: %w. Exiting", err) } - client, err := clientset.NewForConfig(clientConfig) - if err != nil { - return fmt.Errorf("Failed to create a ClientSet, error: %w. Exiting", err) - } - if config.Morph == "kubelet" { + clientConfig.UserAgent = "hollow-kubelet" + client, err := clientset.NewForConfig(clientConfig) + if err != nil { + return fmt.Errorf("Failed to create a ClientSet, error: %w. Exiting", err) + } + f, c := kubemark.GetHollowKubeletConfig(config.createHollowKubeletOptions()) heartbeatClientConfig := *clientConfig @@ -253,6 +254,8 @@ func run(cmd *cobra.Command, config *hollowNodeConfig) error { } if config.Morph == "proxy" { + clientConfig.UserAgent = "hollow-proxy" + client, err := clientset.NewForConfig(clientConfig) if err != nil { return fmt.Errorf("Failed to create API Server client, error: %w", err) diff --git a/pkg/kubemark/hollow_proxy.go b/pkg/kubemark/hollow_proxy.go index 8adcbc5f03943..205c5fe132adb 100644 --- a/pkg/kubemark/hollow_proxy.go +++ b/pkg/kubemark/hollow_proxy.go @@ -118,16 +118,17 @@ func NewHollowProxyOrDie( } return &HollowProxy{ ProxyServer: &proxyapp.ProxyServer{ - Client: client, - EventClient: eventClient, - IptInterface: iptInterface, - Proxier: proxier, - Broadcaster: broadcaster, - Recorder: recorder, - ProxyMode: "fake", - NodeRef: nodeRef, - OOMScoreAdj: utilpointer.Int32Ptr(0), - ConfigSyncPeriod: 30 * time.Second, + Client: client, + EventClient: eventClient, + IptInterface: iptInterface, + Proxier: proxier, + Broadcaster: broadcaster, + Recorder: recorder, + ProxyMode: "fake", + NodeRef: nodeRef, + UseEndpointSlices: true, + OOMScoreAdj: utilpointer.Int32Ptr(0), + ConfigSyncPeriod: 30 * time.Second, }, }, nil }