Skip to content

Commit 1811497

Browse files
authored
Merge pull request #9238 from naman-msft/docs-editor/troubleshoot-cluster-connectio-1751317106
AB#6467: Update troubleshoot-cluster-connection-issues-api-server.md
2 parents b1dcf95 + e69b5e8 commit 1811497

File tree

1 file changed

+35
-15
lines changed

1 file changed

+35
-15
lines changed

support/azure/azure-kubernetes/connectivity/troubleshoot-cluster-connection-issues-api-server.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ ms.date: 08/30/2024
55
ms.reviewer: rissing chiragpa, beleite, v-leedennis, v-weizhu
66
ms.service: azure-kubernetes-service
77
#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
99
---
10+
1011
# Basic troubleshooting of cluster connection issues with the API server
1112

1213
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
2728

2829
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.
2930

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+
3033
```azurecli
31-
az aks show --resource-group <cluster-resource-group> --name <cluster-name> --query fqdn
34+
export RANDOM_SUFFIX=$(head -c 3 /dev/urandom | xxd -p)
35+
export RESOURCE_GROUP="my-aks-rg$RANDOM_SUFFIX"
36+
export AKS_CLUSTER="myakscluster$RANDOM_SUFFIX"
37+
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"
3246
```
3347
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.
3551
3652
```bash
53+
export CLUSTER_FQDN=$(az aks show --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER --query fqdn -o tsv)
54+
3755
# Check if the DNS Resolution is working:
38-
$ nslookup <cluster-fqdn>
56+
nslookup $CLUSTER_FQDN
3957
4058
# 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"
4363
```
4464
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).
4666
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.
4868
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.
5070
5171
For example, on Linux you would run these commands:
5272
53-
```bash
73+
```shell
5474
sudo az aks install-cli
5575
kubectl version --client
5676
```
5777
5878
For other client operating systems, use these [kubectl installation instructions](https://kubernetes.io/docs/tasks/tools/).
5979
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.
6181
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.
6383
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).
6585
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.
6787
6888
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).
6989
70-
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
90+
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)