lens icon indicating copy to clipboard operation
lens copied to clipboard

Failed Connect Oracle OCI OKE from Lens Desktop Windows

Open haddan-rocha opened this issue 1 year ago • 4 comments

Good afternoon, I'm trying to connect my Oracle OKE Kubernetes Cluster on Lens, but I get the following error message:

image

Note: My kubectl is working normally.

haddan-rocha avatar Jul 08 '22 15:07 haddan-rocha

If you fully quit lens from the tray icon and start lens from the powershell does that resolve this issue?

Nokel81 avatar Jul 08 '22 19:07 Nokel81

Hello, same error

image

haddan-rocha avatar Jul 08 '22 21:07 haddan-rocha

Hello @haddan-rocha,

The issue here is that .kube/config that is set by OCI CLI run oci command to obtain a short-lived token every time kubectl command is ran.

When you set up the kubeconfig file for a cluster, by default it contains an Oracle Cloud Infrastructure CLI command to generate a short-lived, cluster-scoped, user-specific authentication token. The authentication token generated by the CLI command is appropriate to authenticate individual users accessing the cluster using kubectl and the Kubernetes Dashboard. From OCI documentation.

Therefore, we must create a service account that will bind our defined user in .kube/config to use it.

You can simply follow the following documentation from OCI page. https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengaddingserviceaccttoken.htm#Adding_a_Service_Account_Authentication_Token_to_a_Kubeconfig_File

Good luck

HassanOumar avatar Jul 17 '22 08:07 HassanOumar

Hello @HassanOumar

I did what was asked and it solved my problem. Thanks.

haddan-rocha avatar Jul 26 '22 17:07 haddan-rocha