-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Kubernetes client giving connect timeout error #5282
Comments
@nikban95 : Is it possible to try increasing the timeout using |
Used 20 seconds timeout still same error. Also observing below warning coming sometimes: |
Hi team |
You'd have to think that the url is unreachable. Are you able to use oc login?
That has already been addressed with later versions. |
@shawkins |
If oc is working, then try letting the fabric8 client use the kubeconfig via autoconfiguration: KubernetesClient k8sClient = new KubernetesClientBuilder().build(); If that works, then you'll need to inspect what is different about what is being picked up in the autoconfig vs your manual config. |
@shawkins Sorry for the delayed response. |
On the client you can do client.getConfiguration() - at least check what the value is for the master url via getMasterUrl() |
We are facing the same issue as well. Tried the steps mentioned in the thread via oc cli. But via fabric client still no luck. |
@shawkins Logged the client.getConfiguration() for both the scenarios. |
It could be an issue with the older version. I'm not sure it would cause the timeout, but 6.5+ addressed that the openshift client was treating the username/password initially as a basic auth request #4698 |
@shawkins Logs: |
The only guess is that whatever you are seeing as the initial autoOAuthToken in the Config is already invalid. The refresh logic is then attempting to obtain a token and is failing, but rather than seeing that underlying exception, you are seeing a timeout from your request. With the latest version if you are able to debug, can you see what the OpenShiftOAuthInterceptor.authorize call is doing - or you can enable trace logging (at least the io.fabric8.kubernetes.client.http context) and produce a log of the requests being sent? |
@shawkins Thanks for the help. Buy enabling the trace logging was able to figure out the issue. Thanks for the help although. |
Close |
Describe the bug
I'm getting client timeout error when trying to use fabric8 library to fetch pvc's.
There is no network related issue as curl to fetch the pvc is working fine:
Curl:
curl --location 'host/api/v1/namespaces/channels-applications/persistentvolumeclaims/channels-test-logs' --header 'Authorization: Bearer sha256~token' -k
Code used:
KubernetesClient k8sClient = new KubernetesClientBuilder()
.withConfig(new ConfigBuilder()
.withMasterUrl(masterUrl)
.withUsername(username)
.withPassword(password)
.withTrustCerts(true)
.build()
).build();
OpenShiftClient ocpClient = k8sClient.adapt(OpenShiftClient.class);
PersistentVolumeClaim pvc = ocpClient.persistentVolumeClaims().inNamespace(namespace).withName(name).get();
Fabric8 Kubernetes Client version
6.1.1
Steps to reproduce
Integrate the library in code
Run the code
Expected behavior
The pvc should be fetched without any error
Runtime
OpenShift
Kubernetes API Server version
1.23
Environment
Linux
Fabric8 Kubernetes Client Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: