Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec auth support #761

Closed
LeiYangGH opened this issue Jan 11, 2022 · 5 comments
Closed

exec auth support #761

LeiYangGH opened this issue Jan 11, 2022 · 5 comments

Comments

@LeiYangGH
Copy link

LeiYangGH commented Jan 11, 2022

My k8s cluster is in azure aks. I generate kube config using:

az login
az account set -s xxx
az aks get-credentials -g ggg -n nnn

It'll generate kube config like this:

  • name: clusterUser_oc-k8s-app-1-dev-use2-aks_oc-k8s-app-1-dev-use2-aks
    user:
    auth-provider:
    config:
    access-token: sometoken
    apiserver-id: someguid
    client-id: someguid
    config-mode: "1"
    environment: AzurePublicCloud
    expires-in: "3907"
    expires-on: "1641893838"
    refresh-token: sometoken
    tenant-id: someguid
    name: azure

Then I can successfully use kubectl command.

But there is some very strange and annoying problem that asking me to login after a few minutes or hours randomly. similiar question

So I used kubelogin to solve this issue and works well.
The kube config is like this:

  • name: clusterUser_oc-k8s-app-1-dev-use2-aks_oc-k8s-app-1-dev-use2-aks
    user:
    exec:
    apiVersion: client.authentication.k8s.io/v1beta1
    args:
    - get-token
    - --environment
    - AzurePublicCloud
    - --server-id
    - someguid
    - --client-id
    - someguid
    - --tenant-id
    - someguid
    command: kubelogin
    env: null
    provideClusterInfo: false

But kubernetes-client/csharp doesn't support this, apparently.

Is there any option in kubernetes-client/csharp that can achive the same purpose? i.e. get token before each request using the parameters in config and then use that token?

@brendandburns brendandburns changed the title kubelogin support exec auth support Jan 11, 2022
@brendandburns
Copy link
Contributor

This is a definite gap in this library. I will work on the fix.

@LeiYangGH
Copy link
Author

thanks! it's great!

@tg123
Copy link
Member

tg123 commented Feb 24, 2022

close #774

@tg123 tg123 closed this as completed Feb 24, 2022
@ImYourBoss0808
Copy link

Is this issue already solve?Because when I try to use the kubelogin, the kubernetes-client/csharp still doesn't work with it

@tg123
Copy link
Member

tg123 commented Sep 20, 2023

this is resolved, @Ariahs0110 feel free to post new issue if you think something is not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants