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

Unable to connect to Azure Kubernetes Cluster - devicelogin is not supported if interactiveMode is 'never' #6586

Open
mgvinuesa opened this issue Nov 16, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@mgvinuesa
Copy link

mgvinuesa commented Nov 16, 2022

Describe the bug
It is not possible to connect from Lens to Azure Kubernetes Cluster

To Reproduce
From command line it is possible to do with the following commands

az login --use-device
az account set --subscription
az aks get-credentials --resource-group --name
kubectl ...

Expected behavior
Interact with the cluster

Screenshots
image

Environment (please complete the following information):

  • Lens Version:
    image

  • OS: [e.g. OSX] Windows 12

  • Installation method (e.g. snap or AppImage in Linux):

Logs:
When you run the application executable from command line you will see some logging output. Please paste them here:

info: [CLUSTER]: refresh {"accessible":false,"disconnected":false,"id":"3bf40ecd91d16eaaf6ddb05088190c3a","name":"<name>","online":false,"ready":false}
error: [CLUSTER]: Failed to connect to "<name>": StatusCodeError: 500 - "getting credentials: exec: executable kubelogin failed with exit code 1\n"```

Kubeconfig:
Quite often the problems are caused by malformed kubeconfig which the application tries to load. Please share your kubeconfig, remember to remove any secret and sensitive information.

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <DATA>
    server: <URL>
  name: <CLUSTER NAME>
contexts:
- context:
    cluster: <CLUSTER NAME>
    user: <CLUSTER USER>
  name: <CLUSTER NAME>
current-context: <CLUSTER NAME>
kind: Config
preferences: {}
users:
- name: <CLUSTER USER>
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - get-token
      - --environment
      - AzurePublicCloud
      - --server-id
      - <SERVER ID>
      - --client-id
      - <CLIENT ID>
      - --tenant-id
      - <TENANT ID>
      - --login
      - devicecode
      command: kubelogin
      env: null
      provideClusterInfo: false

Additional context
Add any other context about the problem here.

@mgvinuesa mgvinuesa added the bug Something isn't working label Nov 16, 2022
@olefritsch
Copy link

Same here after updating Lens to version 6.1.19

@anderslaub
Copy link

I am experiencing the same too - just updated to Lens v6.1.19 and now cannot connect to any clusters (all on AKS).

No issue connecting with kubectl / k9s and no changes made to kubeconfig since long before upgrade where everything worked smooth.

@stefan-oconnell
Copy link

I'm on 6.0.2 but having the same issue trying to log into an AKS with device login for the first time on this install.

@stefan-oconnell
Copy link

For anyone else having this issue, I had kubelogin v0.21, tried updating to v0.22 no dice. Co-working with v0.20 had no issues, so I downgraded and it works again.

Some interaction with lens and that kubelogin version is busted, use v0.20 if possible: https://github.com/Azure/kubelogin/releases/tag/v0.0.20

@ayelencasamassa
Copy link

Hey, same issue here but connecting AzDo with private AKS.
The solution for me was this:

task: AzureCLI@2
inputs:
azureSubscription: 'ARM MANUAL SERVICE CONNECTION'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az aks get-credentials -n CLUSTERNAME -g CLUSTERRESOURCEGROUP
kubelogin convert-kubeconfig -l azurecli
kubectl get nodes

I took the example from here: https://blog.baeke.info/2021/06/03/a-quick-look-at-azure-kubelogin/

I'm using kubelogin v0.22 and AKS 1.24.6

@ColinBe95
Copy link

For me this was resolved by updating my kubeconfig using:
kubelogin convert-kubeconfig -l azurecli

@hungtran84
Copy link

@mgvinuesa I faced the same issue and below is what I've done to fix it:

  1. Remove the installed kubelogin
brew uninstall kubelogin
  1. Install Azure kubelogin
kubelogin convert-kubeconfig
  1. Convert the existing kubeconfig
kubelogin convert-kubeconfig

Hope this helps

@christopherdufort
Copy link

Was able to resolve this in windows by bumping kubelogin to v0.0.24+
https://github.com/Azure/kubelogin/releases/tag/v0.0.24

as they rolled back the device login commits:
Azure/kubelogin#155
Azure/kubelogin#150

elim added a commit to elim/dotfiles that referenced this issue Aug 13, 2024
I need the kubelogin v0.0.24+, So I adopt the nixos-unstable version
of kubelogin.

> Was able to resolve this in windows by bumping kubelogin to v0.0.24+
> <https://github.com/Azure/kubelogin/releases/tag/v0.0.24>
>
> as they rolled back the device login commits:
> [Azure/kubelogin#155](Azure/kubelogin#155)
> [Azure/kubelogin#150](Azure/kubelogin#150)

<lensapp/lens#6586 (comment)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants