Closed leyvReyn closed 3 years ago
the problem solved by replacing login/password with OauthToken. in terminal:
$ oc whoami
kube:admin
$ oc whoami -t
sha256~my-secret-token
and in code:
Config config = new ConfigBuilder()
.withMasterUrl(clusterURL)
.withOauthToken("sha256~my-secret-token")
.build();
OpenShiftClient client = new DefaultOpenShiftClient(config);
Hello. I am trying to access istio Gateway but getting permission exception. The code I use to access it:
The error I am getting:
As you may see,
OpenShiftClient
works well (I am successfully gettingService name = nginx-service
). I use the sameconfig
forOpenShiftClient
andIstioClient
. ButIstioClient
does not work as I expect. I am able to get gateway throughoc
:I am using openshift Code Ready Containers. I did not change any permissions for resources. Gateway and Virtual Service works as expected:
my dependencies are:
I see simillar issue with system:anonymous in client - https://github.com/fabric8io/kubernetes-client/issues/1625. But he disable security for system:anonymous, I don't think it is a safe solution. What can I do to fix this problem?