Skip to Main Content

API, CLI, SDK & Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create kubectl user token with the .NET SDK?

Artium NJun 2 2025

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 execis 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

Comments
Post Details
Added on Jun 2 2025
0 comments
113 views