I have docker desktop and kubectl installed , I am trying to connect to cluster from my local pc and getting above error here is my kubeconfig file
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ****
name: AKS-CLUSTER
contexts:
- context:
cluster: AKS-CLUSTER
user: clusterUser_D-AKS_AKS-CLUSTER
name: AKS-CLUSTER
current-context: AKS-CLUSTER
kind: Config
preferences: {}
users:
- name: clusterUser_D-AKS_AKS-CLUSTER
user:
client-certificate-data: ****
client-key-data: ****
token: ****
This article details some common problems and troubleshooting steps: https://docs.microsoft.com/en-us/azure/aks/troubleshooting
One reason for this is the AKS cluster certificate getting rotated. See https://docs.microsoft.com/en-us/azure/aks/certificate-rotation.
As outlined there, run:
az aks get-credentials -g <RESOURCE_GROUP_NAME> -n <CLUSTER_NAME> --overwrite-existing
and see if it gives you an output like:
Merged "<CLUSTER_NAME>" as current context in /home/<USER>/.kube/config