How do I fix : couldn't get current server API group list dail tcp lookup 443 timeout

KHALSA, GURLEEN KAUR 10 Reputation points
2023-08-04T19:57:33.17+00:00

I am not able to connect to the AKS Cluster. I am trying to connect to private AKS Cluster. It gives me error as : couldn't get current server API group list: Get ":443/api?timeout=32s": dial tcp: lookup

Unable to connect to the server: dial tcp: lookup no such host

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,100 questions
{count} votes

2 answers

Sort by: Most helpful
  1. shiva patpi 13,251 Reputation points Microsoft Employee
    2023-08-05T22:40:16.16+00:00

    @KHALSA, GURLEEN KAUR,

    A private cluster cannot be accessed outside of that VNET were AKS cluster was created.

    Can you try accessing the private AKS cluster by creating a test VM in the same VNET as that of AKS cluster ?

    Or you can have a VM in different VNET but that VNET needs to be paired with VNET of AKS cluster.

    See different ways of connecting to private AKS cluster:

    https://learn.microsoft.com/en-us/azure/aks/private-clusters?tabs=azure-portal#options-for-connecting-to-the-private-cluster

    To quickly test it out you can use the command-invoke (Example below)

    https://learn.microsoft.com/en-us/azure/aks/command-invoke

    az aks command invoke \
      --resource-group myResourceGroup \
      --name myPrivateCluster \
      --command "kubectl get pods -n kube-system"
    
    
    

    Let us know if that helps !

    Regards,

    Shiva.

    1 person found this answer helpful.

  2. Manohar V 20 Reputation points
    2024-03-26T13:38:46.0066667+00:00

    @shiva patpi

    when i perform this command i get all the list of pods (-A) az aks command invoke \

    --resource-group myResourceGroup \

    --name myPrivateCluster \

    --command "kubectl get pods -n kube-system"

    but same when i perform kubectl get pods -A , i get below error.

    E0326 19:07:09.731652 16053 memcache.go:265] couldn't get current server API group list: Get "https://bdkd***** * * * * * * * * * * * * * * * * */api?timeout=32s": tls: failed to verify certificate: x509: certificate signed by unknown authority

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.