Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [POC] High watch timeout #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controllers/remote/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

const (
defaultClientTimeout = 10 * time.Second
defaultClientTimeout = 5 * time.Second
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for debug purposes

)

// ClusterClientGetter returns a new remote client.
Expand Down
13 changes: 10 additions & 3 deletions controllers/remote/cluster_cache_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,21 @@ func (t *ClusterCacheTracker) createClient(ctx context.Context, config *rest.Con
// Verify if we can get a rest mapping from the workload cluster apiserver.
// Note: This also checks if the apiserver is up in general. We do this already here
// to avoid further effort creating a cache and a client and to produce a clearer error message.
_, err = mapper.RESTMapping(corev1.SchemeGroupVersion.WithKind("Node").GroupKind(), corev1.SchemeGroupVersion.Version)
//_, err = mapper.RESTMapping(corev1.SchemeGroupVersion.WithKind("Node").GroupKind(), corev1.SchemeGroupVersion.Version)
//if err != nil {
// return nil, nil, nil, errors.Wrapf(err, "error creating client for remote cluster %q: error getting rest mapping", cluster.String())
//}
Comment on lines +376 to +379
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for debug purposes


highTimeoutConfig := rest.CopyConfig(config)
highTimeoutConfig.Timeout = 5 * time.Minute
highTimeoutHttpClient, err := rest.HTTPClientFor(highTimeoutConfig)
if err != nil {
return nil, nil, nil, errors.Wrapf(err, "error creating client for remote cluster %q: error getting rest mapping", cluster.String())
return nil, nil, nil, errors.Wrapf(err, "error creating client for remote cluster %q: error creating http client", cluster.String())
}

// Create the cache for the remote cluster
cacheOptions := cache.Options{
HTTPClient: httpClient,
HTTPClient: highTimeoutHttpClient,
Scheme: t.scheme,
Mapper: mapper,
}
Expand Down
1 change: 1 addition & 0 deletions controlplane/kubeadm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func setupReconcilers(ctx context.Context, mgr ctrl.Manager) {
&appsv1.Deployment{},
&appsv1.DaemonSet{},
},
Indexes: []remote.Index{remote.NodeProviderIDIndex},
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for debug purposes

})
if err != nil {
setupLog.Error(err, "unable to create cluster cache tracker")
Expand Down