You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Customer intent: As an Azure Kubernetes user, I want to take basic troubleshooting measures so that I can avoid cluster connectivity issues with the API server.
8
-
ms.custom: sap:Connectivity
8
+
ms.custom: sap:Connectivity,innovation-engine
9
9
---
10
+
10
11
# Basic troubleshooting of cluster connection issues with the API server
11
12
12
13
This article discusses connection issues to an Azure Kubernetes Service (AKS) cluster when you can't reach the cluster's API server through the Kubernetes cluster command-line tool ([kubectl](https://kubernetes.io/docs/reference/kubectl/overview/)) or any other tool, such as using REST API through a programming language.
@@ -27,44 +28,63 @@ You can take these common troubleshooting steps to check the connectivity to the
27
28
28
29
1. Enter the following [az aks show](/cli/azure/aks#az-aks-show) command in Azure CLI. This command gets the fully qualified domain name (FQDN) of your AKS cluster.
29
30
31
+
First, export your resource names to environment variables and add a random suffix to the resource group and cluster names for unique testing.
32
+
30
33
```azurecli
31
-
az aks show --resource-group <cluster-resource-group> --name <cluster-name> --query fqdn
az aks show --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER --query fqdn
38
+
```
39
+
40
+
Results:
41
+
42
+
<!-- expected_similarity=0.3 -->
43
+
44
+
```output
45
+
"xxxxxx-xxxxxxxx.hcp.eastus2.azmk8s.io"
32
46
```
33
47
34
-
1. With the FQDN, check whether the API server is reachable from the client machine by using the name server lookup ([nslookup](/windows-server/administration/windows-commands/nslookup)), client URL ([curl](https://curl.se/docs/manpage.html)), and [telnet](/windows-server/administration/windows-commands/telnet) commands:
48
+
2. With the FQDN, check whether the API server is reachable from the client machine by using the name server lookup ([nslookup](/windows-server/administration/windows-commands/nslookup)), client URL ([curl](https://curl.se/docs/manpage.html)), and [telnet](/windows-server/administration/windows-commands/telnet) commands:
49
+
50
+
Replace `<cluster-fqdn>` with the actual FQDN returned from the previous step. For demonstration, we use a variable.
35
51
36
52
```bash
53
+
export CLUSTER_FQDN=$(az aks show --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER --query fqdn -o tsv)
54
+
37
55
# Check if the DNS Resolution is working:
38
-
$ nslookup <cluster-fqdn>
56
+
nslookup $CLUSTER_FQDN
39
57
40
58
# Then check if the API Server is reachable:
41
-
$ curl -Iv https://<cluster-fqdn>
42
-
$ telnet <cluster-fqdn> 443
59
+
curl -k -Iv https://$CLUSTER_FQDN
60
+
61
+
# Test raw TCP connectivity (output will vary depending on environment)
62
+
timeout 5 telnet $CLUSTER_FQDN 443 || echo "Connection test completed"
43
63
```
44
64
45
-
1. If the AKS cluster is private, make sure you run the command from a virtual machine (VM) that can access the AKS cluster's Azure Virtual Network. See [Options for connecting to the private cluster](/azure/aks/private-clusters#options-for-connecting-to-the-private-cluster).
65
+
3. If the AKS cluster is private, make sure you run the command from a virtual machine (VM) that can access the AKS cluster's Azure Virtual Network. See [Options for connecting to the private cluster](/azure/aks/private-clusters#options-for-connecting-to-the-private-cluster).
46
66
47
-
1. If necessary, follow the steps in the troubleshooting article [Client IP address can't access the API server](client-ip-address-cannot-access-api-server.md), so the API server adds your client IP address to the IP ranges it authorizes.
67
+
4. If necessary, follow the steps in the troubleshooting article [Client IP address can't access the API server](client-ip-address-cannot-access-api-server.md), so the API server adds your client IP address to the IP ranges it authorizes.
48
68
49
-
1. Make sure the version of kubectl on your client machine isn't two or more minor versions behind the AKS cluster's version of that tool. To install the latest version of kubectl, run the [az aks install-cli](/cli/azure/aks#az-aks-install-cli) command in Azure CLI. You can then run [kubectl version](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#version) command to check the version number of the new installation.
69
+
5. Make sure the version of kubectl on your client machine isn't two or more minor versions behind the AKS cluster's version of that tool. To install the latest version of kubectl, run the [az aks install-cli](/cli/azure/aks#az-aks-install-cli) command in Azure CLI. You can then run [kubectl version](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#version) command to check the version number of the new installation.
50
70
51
71
For example, on Linux you would run these commands:
52
72
53
-
```bash
73
+
```shell
54
74
sudo az aks install-cli
55
75
kubectl version --client
56
76
```
57
77
58
78
For other client operating systems, use these [kubectl installation instructions](https://kubernetes.io/docs/tasks/tools/).
59
79
60
-
1. If necessary, follow the steps in the troubleshooting article [Config file isn't available when connecting](config-file-is-not-available-when-connecting.md), so your Kubernetes configuration file (*config*) is valid and can be found at connection time.
80
+
6. If necessary, follow the steps in the troubleshooting article [Config file isn't available when connecting](config-file-is-not-available-when-connecting.md), so your Kubernetes configuration file (*config*) is valid and can be found at connection time.
61
81
62
-
1. If necessary, follow the steps in the troubleshooting article [User can't get cluster resources](user-cannot-get-cluster-resources.md), so you can list the details of your cluster nodes.
82
+
7. If necessary, follow the steps in the troubleshooting article [User can't get cluster resources](user-cannot-get-cluster-resources.md), so you can list the details of your cluster nodes.
63
83
64
-
1. If you're using a firewall to control egress traffic from AKS worker nodes, make sure the firewall allows the [minimum required egress rules for AKS](/azure/aks/limit-egress-traffic).
84
+
8. If you're using a firewall to control egress traffic from AKS worker nodes, make sure the firewall allows the [minimum required egress rules for AKS](/azure/aks/limit-egress-traffic).
65
85
66
-
1. Make sure the [network security group that's associated with AKS nodes](/azure/aks/concepts-security#azure-network-security-groups) allows communication on TCP port 10250 within the AKS nodes.
86
+
9. Make sure the [network security group that's associated with AKS nodes](/azure/aks/concepts-security#azure-network-security-groups) allows communication on TCP port 10250 within the AKS nodes.
67
87
68
88
For other common troubleshooting steps, see [TCP time-outs when kubectl or other third-party tools connect to the API server](tcp-timeouts-kubetctl-third-party-tools-connect-api-server.md).
69
89
70
-
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
90
+
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
0 commit comments