Kubernetes-client: Error while connecting to OCP 4.2

Created on 7 Feb 2020  路  17Comments  路  Source: fabric8io/kubernetes-client

Hi,

Does openshift-client library has OCP 4.2 support?

Thanks.

Most helpful comment

@rohanKanojia I solved issue.

I added .withDisableHostnameVerification(true) parameter in defining kubernetes client.

Thanks for your support.

All 17 comments

Hi, I think you should be able to use our client on Openshift 4.2 without any problems. I remember I tested something on OCP 4.2 few months ago and it worked fine. Could you please try it out and share feedback about your experience with our client on OCP 4.2? We generate openshift model from https://github.com/openshift/origin + https://github.com/openshift/api and right now model is generated at this state: https://github.com/openshift/origin/commit/0cbc58b117403b9d9169dbafdfac59ef104bb997

We used to update model with newer releases but I'm not sure why openshift folks have stopped publishing releases since 4.1 . But I think we should upgrade our model to latest master revisions.
Screenshot from 2020-02-08 09-37-36

Hi,

I had set up successful connection for our old OCP 3 environment before. I have only changed Openshift master URL and credential for OCP 4.2.

So I have already tried your Openshift client for our OCP 4.2 environment. But I got adaptation error like below.

image

That's why asked your Openshift client has support for OCP 4.2.

Do you have other comment for this issue?

Thanks in advance.

@umutcann : Could you please share code which reproduces this error?

Hi,

I added below.

try (DefaultKubernetesClient kubernetesClient = new DefaultKubernetesClient(new ConfigBuilder()
.withMasterUrl(masterUrl)
.withOauthToken(authToken)
.build())) {
this.openShiftClient = kubernetesClient.adapt(OpenShiftClient.class);
}

@umutcann : Thanks, will reproduce and fix this

@umutcann : Hi, Which version of Kubernetes client are you using?

@rohanKanojia 4.6.4

@umutcann : Could you please try on 4.7.1?

I got same error.

image

ah, okay. Will fix this as soon as possible.

Strange, I am not able to reproduce this error. I tried on crc:

~/go/src/github.com/fabric8io/kubernetes-client : $ crc version
crc version: 1.5.0+e1c8fb8
OpenShift version: 4.2.14 (embedded in binary)

let me also try on Openshift Online and see if I'm able to reproduce

@umutcann : I tried v4.7.1 with Openshift Online too but still could not reproduce this issue :confused: . Could you please check if you're missing something on your side?

@rohanKanojia : Strange.

I checked that.

When I access to API URL from my browser, I could get API message like below.

image

But when I tried to access via your client library, I got same error message(OpenShift is not available. Root paths at:).

@rohanKanojia

It may be related witk api version of Openshift or Kubernetes.

Can we set kubernetes.oapi.version of our Openshift instance in library?

I'm not sure. Could you please elaborate what kubernetes.oapi.version property does?

It explicitly specifies the location of the OAPI endpoints

@rohanKanojia I solved issue.

I added .withDisableHostnameVerification(true) parameter in defining kubernetes client.

Thanks for your support.

Was this page helpful?
0 / 5 - 0 ratings