It seems the Azure VM from the private AKS cluster was being accessed was set to automatic restart which caused some issue with kubectl
or kubelogin
.
I followed below steps for both -- root as well as non-root user and after kubectl
worked successfully.
root@jump-vm# cd ~ && cd .kube/
root@jump-vm# rm -r cache && rm config
root@jump-vm# az login --tenant <tenant-id>
root@jump-vm# az account set --subscription <subscription-id>
root@jump-vm# az aks get-credentials --resource-group <resource-group-name> --name <aks-clutser-name>
root@jump-vm# kubelogin convert-kubeconfig -l azurecli
someuser@jump-vm$ cd ~ && cd .kube/
someuser@jump-vm$ rm -r cache && rm config
someuser@jump-vm$ az login --tenant <tenant-id>
someuser@jump-vm$ az account set --subscription <subscription-id>
someuser@jump-vm$ az aks get-credentials --resource-group <resource-group-name> --name <aks-clutser-name>
someuser@jump-vm$ kubelogin convert-kubeconfig -l azurecli
kubelogin
to/usr/bin
. Did not made anykubeconfig
. – Hoardingaz login
andkubelogin convert
steps for the user – Binauralconfig
andcache
from the$HOME/.kube/*
and later re-initialized the config afteraz login
. And it worked. – Hoarding