Merge pull request #106740 from wojtek-t/update_kubemark_clients

Update kubemark to use EndpointSlices and proper user-agents
This commit is contained in:
Kubernetes Prow Robot 2021-12-07 19:27:59 -08:00 committed by GitHub
commit 022d49dcbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 15 deletions

View File

@ -180,12 +180,13 @@ func run(cmd *cobra.Command, config *hollowNodeConfig) error {
return fmt.Errorf("Failed to create a ClientConfig, error: %w. Exiting", err) 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" { 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()) f, c := kubemark.GetHollowKubeletConfig(config.createHollowKubeletOptions())
heartbeatClientConfig := *clientConfig heartbeatClientConfig := *clientConfig
@ -253,6 +254,8 @@ func run(cmd *cobra.Command, config *hollowNodeConfig) error {
} }
if config.Morph == "proxy" { if config.Morph == "proxy" {
clientConfig.UserAgent = "hollow-proxy"
client, err := clientset.NewForConfig(clientConfig) client, err := clientset.NewForConfig(clientConfig)
if err != nil { if err != nil {
return fmt.Errorf("Failed to create API Server client, error: %w", err) return fmt.Errorf("Failed to create API Server client, error: %w", err)

View File

@ -118,16 +118,17 @@ func NewHollowProxyOrDie(
} }
return &HollowProxy{ return &HollowProxy{
ProxyServer: &proxyapp.ProxyServer{ ProxyServer: &proxyapp.ProxyServer{
Client: client, Client: client,
EventClient: eventClient, EventClient: eventClient,
IptInterface: iptInterface, IptInterface: iptInterface,
Proxier: proxier, Proxier: proxier,
Broadcaster: broadcaster, Broadcaster: broadcaster,
Recorder: recorder, Recorder: recorder,
ProxyMode: "fake", ProxyMode: "fake",
NodeRef: nodeRef, NodeRef: nodeRef,
OOMScoreAdj: utilpointer.Int32Ptr(0), UseEndpointSlices: true,
ConfigSyncPeriod: 30 * time.Second, OOMScoreAdj: utilpointer.Int32Ptr(0),
ConfigSyncPeriod: 30 * time.Second,
}, },
}, nil }, nil
} }