Skip to content

Commit e0982c3

Browse files
authored
Merge pull request #9231 from naman-msft/docs-editor/client-ip-address-cannot-acces-1751313775
AB#6459: Update client-ip-address-cannot-access-api-server.md
2 parents a0f90df + b96d84b commit e0982c3

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

support/azure/azure-kubernetes/connectivity/client-ip-address-cannot-access-api-server.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ ms.date: 10/08/2024
55
ms.reviewer: rissing, chiragpa, jaewonpark, v-leedennis, v-weizhu
66
ms.service: azure-kubernetes-service
77
#Customer intent: As an Azure Kubernetes user, I want the AKS API server to allow access to my client IP address so that I can successfully connect to my AKS cluster.
8-
ms.custom: sap:Connectivity
8+
ms.custom: sap:Connectivity, innovation-engine
99
---
10+
1011
# Client IP address can't access the API server
1112

1213
This article describes how to fix issues that occur when you can't connect to an Azure Kubernetes Service (AKS) cluster because your client IP address can't access the AKS API server.
@@ -47,8 +48,8 @@ Unable to connect to the server: dial tcp <API-SERVER-IP>:443: connectex: A conn
4748
[API server-authorized IP ranges](/azure/aks/api-server-authorized-ip-ranges) may have been enabled on the cluster's API server, but the client's IP address wasn't included in the IP ranges. To check whether this feature has been enabled, see if the following [az aks show](/cli/azure/aks#az-aks-show) command in Azure CLI produces a list of IP ranges:
4849

4950
```azurecli
50-
az aks show --resource-group <cluster-resource-group> \
51-
--name <cluster-name> \
51+
az aks show --resource-group ${RG_NAME} \
52+
--name ${CLUSTER_NAME} \
5253
--query apiServerAccessProfile.authorizedIpRanges
5354
```
5455

@@ -76,18 +77,46 @@ Look at the cluster's API server-authorized ranges, and add your client's IP add
7677

7778
1. Get your client IP address by running this [curl](https://curl.se/docs/manpage.html) command:
7879

80+
```azurecli
81+
export CLIENT_IP=$(curl --silent https://ipinfo.io/ip | tr -d '\n')
82+
echo $CLIENT_IP
83+
```
84+
85+
Results:
86+
87+
<!-- expected_similarity=0.3 -->
88+
7989
```output
80-
$ curl --silent checkip.dyndns.org
81-
<html><head><title>Current IP Check</title></head><body>Current IP Address: 0.255.127.63</body></html>
90+
0.255.127.63
8291
```
8392
8493
2. Update the API server-authorized range with the [az aks update](/cli/azure/aks#az-aks-update) command in Azure CLI, using your client IP address:
8594
8695
```azurecli
87-
az aks update --resource-group <cluster-resource-group> \
88-
--name <cluster-name> \
89-
--api-server-authorized-ip-ranges <ip-ranges-that-include-your-client-ip-address>
96+
az aks update --resource-group $RG_NAME \
97+
--name $CLUSTER_NAME \
98+
--api-server-authorized-ip-ranges $CLIENT_IP
9099
```
100+
101+
Results:
102+
103+
<!-- expected_similarity=0.3 -->
104+
105+
```output
106+
{
107+
"apiServerAccessProfile": {
108+
"authorizedIpRanges": [
109+
"0.255.127.63/32"
110+
],
111+
...
112+
},
113+
...
114+
"name": "aks-cluster-xxx",
115+
"resourceGroup": "aks-rg-xxx",
116+
...
117+
}
118+
```
119+
91120
---
92121
93122
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]

0 commit comments

Comments
 (0)