An app is using OCI .NET SDK, API key for authentication and OKE to manage Kubernetes clusters. I would like to generate a user token using the SDK so that the app could connect to the Kubernetes cluster and perform operation like listing pods.
When working with CLI, I can run oci ce cluster create-kubeconfig
, it updates the config file of kubectl with a user for which an exec
is defined to run the CLI with generate-token
I see that the SDK does not provide generate-token
.
What other options or workarounds are available?
I assume that I can construct the token string myself, but I am not sure how to sign it using the SDK correctly. The python SDK (which the CLI is using) is patching the signer, and this is not clear to me. Ideally I'd be happy of there was an official, supported way in the .NET SDK itself.
https://github.com/oracle/oci-python-sdk/blob/ba91eb1a51b0c1a38603dec0373a33f9b9962f8a/src/oci/signer.py#L145