|
1 | 1 | ---
|
2 |
| -title: Configure Azure CNI networking for dynamic allocation of IPs and enhanced subnet support in Azure Kubernetes Service (AKS) |
| 2 | +title: Configure Azure CNI networking for dynamic allocation of IPs and enhanced subnet support |
| 3 | +titleSuffix: Azure Kubernetes Service |
3 | 4 | description: Learn how to configure Azure CNI (advanced) networking for dynamic allocation of IPs and enhanced subnet support in Azure Kubernetes Service (AKS)
|
| 5 | +author: asudbring |
| 6 | +ms.author: allensu |
| 7 | +ms.service: azure-kubernetes-service |
| 8 | +ms.subservice: aks-networking |
4 | 9 | ms.topic: article
|
5 |
| -ms.date: 01/09/2023 |
| 10 | +ms.date: 04/20/2023 |
6 | 11 | ms.custom: references_regions, devx-track-azurecli
|
7 | 12 | ---
|
8 | 13 |
|
@@ -106,6 +111,48 @@ az aks nodepool add --cluster-name $clusterName -g $resourceGroup -n newnodepoo
|
106 | 111 | --no-wait
|
107 | 112 | ```
|
108 | 113 |
|
| 114 | +## Monitor IP subnet usage |
| 115 | + |
| 116 | +Azure CNI provides the capability to monitor IP subnet usage. To enable IP subnet usage monitoring, follow the steps below: |
| 117 | + |
| 118 | +### Get the YAML file |
| 119 | + |
| 120 | +1. Download or grep the file named container-azm-ms-agentconfig.yaml from [GitHub][github]. |
| 121 | + |
| 122 | +2. Find **`azure_subnet_ip_usage`** in integrations. Set `enabled` to `true`. |
| 123 | + |
| 124 | +3. Save the file. |
| 125 | + |
| 126 | +### Get the AKS credentials |
| 127 | + |
| 128 | +Set the variables for subscription, resource group and cluster. Consider the following as examples: |
| 129 | + |
| 130 | +```azurecli |
| 131 | +
|
| 132 | + $s="subscriptionId" |
| 133 | +
|
| 134 | + $rg="resourceGroup" |
| 135 | +
|
| 136 | + $c="ClusterName" |
| 137 | +
|
| 138 | + az account set -s $s |
| 139 | +
|
| 140 | + az aks get-credentials -n $c -g $rg |
| 141 | +
|
| 142 | +``` |
| 143 | + |
| 144 | +### Apply the config |
| 145 | + |
| 146 | +1. Open terminal in the folder the downloaded **container-azm-ms-agentconfig.yaml** file is saved. |
| 147 | + |
| 148 | +2. First, apply the config using the command: `kubectl apply -f container-azm-ms-agentconfig.yaml` |
| 149 | + |
| 150 | +3. This will restart the pod and after 5-10 minutes, the metrics will be visible. |
| 151 | + |
| 152 | +4. To view the metrics on the cluster, go to Workbooks on the cluster page in the Azure portal, and find the workbook named "Subnet IP Usage". Your view will look similar to the following: |
| 153 | + |
| 154 | + :::image type="content" source="media/configure-azure-cni-dynamic-ip-allocation/ip-subnet-usage.png" alt-text="A diagram of the Azure portal's workbook blade is shown, and metrics for an AKS cluster's subnet IP usage are displayed."::: |
| 155 | + |
109 | 156 | ## Dynamic allocation of IP addresses and enhanced subnet support FAQs
|
110 | 157 |
|
111 | 158 | * **Can I assign multiple pod subnets to a cluster/node pool?**
|
@@ -133,6 +180,9 @@ Learn more about networking in AKS in the following articles:
|
133 | 180 | * [Create an ingress controller with a dynamic public IP and configure Let's Encrypt to automatically generate TLS certificates][aks-ingress-tls]
|
134 | 181 | * [Create an ingress controller with a static public IP and configure Let's Encrypt to automatically generate TLS certificates][aks-ingress-static-tls]
|
135 | 182 |
|
| 183 | +<!-- LINKS - External --> |
| 184 | +[github]: https://raw.githubusercontent.com/microsoft/Docker-Provider/ci_prod/kubernetes/container-azm-ms-agentconfig.yaml |
| 185 | + |
136 | 186 | <!-- LINKS - Internal -->
|
137 | 187 | [aks-ingress-basic]: ingress-basic.md
|
138 | 188 | [aks-ingress-tls]: ingress-tls.md
|
|
0 commit comments