From 60c9fa7f188464c9866b7f8170eada6ae7cf2a02 Mon Sep 17 00:00:00 2001 From: Rokibul Hasan Date: Fri, 13 Dec 2024 18:49:34 +0600 Subject: [PATCH] Use `CreateSingleUseGrpcTunnelWithContext` and set keepAlive.time to 20 seconds Signed-off-by: Rokibul Hasan --- pkg/apis/cluster/v1alpha1/transport.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/apis/cluster/v1alpha1/transport.go b/pkg/apis/cluster/v1alpha1/transport.go index 3a1f399a..ac920d92 100644 --- a/pkg/apis/cluster/v1alpha1/transport.go +++ b/pkg/apis/cluster/v1alpha1/transport.go @@ -30,12 +30,13 @@ var DialerGetter = func(ctx context.Context) (k8snet.DialFunc, error) { if err != nil { return nil, err } - dialerTunnel, err := konnectivity.CreateSingleUseGrpcTunnel( + dialerTunnel, err := konnectivity.CreateSingleUseGrpcTunnelWithContext( ctx, + context.Background(), net.JoinHostPort(config.ClusterProxyHost, strconv.Itoa(config.ClusterProxyPort)), grpc.WithTransportCredentials(grpccredentials.NewTLS(tlsCfg)), grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: time.Second * 5, + Time: 20 * time.Second, }), ) if err != nil {