400 bad request while using Kubernetes Client #5203
Unanswered
abhinavsingh1196
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Do you mean to use the old v1beta1 deployments endpoint: apis/extensions/v1beta1/namespaces client.extensions().deployments() is deprecated. Based upon your error message, I'm not sure aware of what older clients may have been doing in this circumstance. The BackwardsCompatibilityInterceptor is no longer enabled by default, but I don't see that it would handle this case. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, we recently upgraded our fabric8 version from 5.12.1 -> 6.5.1. Since we were earlier using DefaultKubernetesClient, we changed the usage to use KubernetesClientBuilder.
Before:
DefaultKubernetesClient client = new DefaultKubernetesClient(simpleClientContext).inNamespace(namespace)
After:
KubernetesClient client = new KubernetesClientBuilder() .withConfig(config) .withHttpClientFactory(fabric8HttpClientFactory) .build() .adapt(NamespacedKubernetesClient.class) .inNamespace(namespace);
The okhttpclient which we pass to this kubernetes client is still constructed using the exact same logic.
But after making this change, ONLY a small portion of our customers have reported an issue where we're seeing 400 bad request when trying to execute this DSL
client.extensions().deployments().inNamespace(namespace).withLabels(labels).list()
The error message we get is:
KubernetesClientException: Failure executing: GET at: https://<K8s_CLUSTER_URL>/apis/extensions/v1beta1/namespaces/<NAMESPACE>/deployments?labelSelector=labelkey%3Dlabelvalue. Message: Bad Request.
Do you know what could be the issue here? Do you see something wrong in the way we are now creating these kubernetes clients?
How could we debug this further?
Beta Was this translation helpful? Give feedback.
All reactions