Skip to content

Commit

Permalink
Update kubemark to use EndpointSlices and proper user-agents
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-t committed Nov 30, 2021
1 parent aff056d commit 243f4fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
13 changes: 8 additions & 5 deletions cmd/kubemark/hollow-node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
21 changes: 11 additions & 10 deletions pkg/kubemark/hollow_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 243f4fa

Please sign in to comment.