client-go: Azure authentication fails on acquiring consequent tokens

We use kubectl with Azure authentication provider, and our devs are facing issue when access-token expired.

$ kubectl get pods
E1226 11:52:13.723835   16281 azure.go:126] Failed to acquire a token: refreshing the expired token: refreshing token: adal: Refresh request failed. Status Code = '400'
Unable to connect to the server: acquiring a token for authorization header: refreshing the expired token: refreshing token: adal: Refresh request failed. Status Code = '400'

Deleting all tokens from ~/.kube/config and authentication solves the issue until next expiring period.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 10
  • Comments: 21 (5 by maintainers)

Most upvoted comments

I keep having this 3-5 times every day with Azure’s k8s. Any hints how to get rid of this (or on why this ticket was closed?)

@ericchiang Perhaps this could be re-opened? It continues to be an issue and was not triaged prior to being closed.

Modifying this ~/.kube/config file by deleting accessToken and refreshToken worked. Would like to know if there is a way to solve this better.

I have this too on different clusters on the same tenant, which all worked flawless for months. I have to to az aks get-credentials to solve this for a short while.

You can get the credentials again by the following command: az aks get-credentials --name yourNameSpace --resource-group yourResourceGroup

Overwritten Y