Unable to reach the api server.

Fernando Gutierrez 220 Reputation points
2023-09-06T12:43:38.6633333+00:00

Hello

Who could help me with a problem that I am having when trying to visualize the Pods within the AKS cluster.

I clarify that I am logging within the corresponding VPN, that my Azure user is Owner of the Tenant and that he has all the roles to be able to view and edit within the cluster.

The problem is that very often I get the following error:

Unable to reach the api server...... -priv.portal.hcp.eastus.azmk8s.io' or api server is too busy to respond. Check your network settings and refresh to try again.

Thank you!

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,145 questions
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 37,416 Reputation points Microsoft Employee
    2023-09-13T18:07:24.9933333+00:00

    @Fernando Gutierrez

    This error can occur when you are trying to access the API server of a private AKS cluster from the Azure portal or other tools that are not within the same virtual network as the cluster. The error means that the API server is not reachable or is too busy to handle the request. Some possible causes and solutions are:

    Check your network settings and make sure you are connected to a VPN that can access the AKS cluster’s virtual network. See Options for connecting to the private cluster for more details.

    Check if the DNS resolution is working by using the nslookup command with the FQDN of your AKS cluster. You can get the FQDN by using the az aks show command with your resource group and cluster name. See Troubleshoot cluster connection issues with the API server for more details.

    Check if the API server is reachable by using the curl or telnet commands with the FQDN and port 443 of your AKS cluster. See Troubleshoot cluster connection issues with the API server for more details.

    Check if your client IP address is allowed by the API server by using the az aks update command with the --api-server-authorized-ip-ranges parameter. See Client IP address can’t access the API server for more details.

    Check if your kubectl version is compatible with your AKS cluster version by using the kubectl version command. You can install the latest version of kubectl by using the az aks install-cli command. See Troubleshoot cluster connection issues with the API server for more details.

    Check if your Kubernetes configuration file (config) is valid and available by using the kubectl config view command. You can get a new config file by using the az aks get-credentials command with your resource group and cluster name. See Config file isn’t available when connecting for more details.

    Check if you have sufficient permissions to access the cluster resources by using the kubectl auth can-i command with your desired action and resource. You can grant or revoke permissions by using the kubectl create rolebinding or kubectl delete rolebinding commands. See User can’t get cluster resources for more details.

    Check if your firewall or network security group allows egress traffic from AKS worker nodes to the API server on TCP port 10250. You can view or modify your firewall or network security group rules by using the Azure portal or CLI. See Minimum required egress rules for AKS and Network security groups for more details.

    I hope this helps you resolve your issue. If you have any further questions, please let me know.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A!

    User's image

    2 people found this answer helpful.
    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.