Skip to content

Commit 64517af

Browse files
Fixed the warnings
1 parent aa62e68 commit 64517af

File tree

1 file changed

+117
-117
lines changed

1 file changed

+117
-117
lines changed

articles/aks/advanced-network-observability-cli.md

Lines changed: 117 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -34,62 +34,62 @@ Advanced Network Observability is one of the features of Advanced Container Netw
3434

3535
Install or update the Azure CLI preview extension using the [`az extension add`](/cli/azure/extension#az_extension_add) or [`az extension update`](/cli/azure/extension#az_extension_update) command.
3636

37-
```azurecli-interactive
38-
# Install the aks-preview extension
39-
az extension add --name aks-preview
40-
41-
# Update the extension to make sure you have the latest version installed
42-
az extension update --name aks-preview
43-
```
37+
```azurecli-interactive
38+
# Install the aks-preview extension
39+
az extension add --name aks-preview
40+
41+
# Update the extension to make sure you have the latest version installed
42+
az extension update --name aks-preview
43+
```
4444

4545
### Register the `AdvancedNetworkingPreview` feature flag
4646

4747
Register the `az feature register --namespace "Microsoft.ContainerService" --name "AdvancedNetworkingPreview"
4848
` feature flag using the [`az feature register`](/cli/azure/feature#az_feature_register) command.
4949

50-
```azurecli-interactive
51-
az feature register --namespace "Microsoft.ContainerService" --name "AdvancedNetworkingPreview"
52-
```
50+
```azurecli-interactive
51+
az feature register --namespace "Microsoft.ContainerService" --name "AdvancedNetworkingPreview"
52+
```
5353
Verify successful registration using the [`az feature show`](/cli/azure/feature#az_feature_show) command. It takes a few minutes for the registration to complete.
5454

55-
```azurecli-interactive
56-
az feature show --namespace "Microsoft.ContainerService" --name "AdvancedNetworkingPreview"
57-
```
55+
```azurecli-interactive
56+
az feature show --namespace "Microsoft.ContainerService" --name "AdvancedNetworkingPreview"
57+
```
5858

5959
Once the feature shows `Registered`, refresh the registration of the `Microsoft.ContainerService` resource provider using the [`az provider register`](/cli/azure/provider#az_provider_register) command.
6060

6161
## Create a resource group
6262

6363
A resource group is a logical container into which Azure resources are deployed and managed. Create a resource group using the [`az group create`](/cli/azure/group#az_group_create) command.
6464

65-
```azurecli-interactive
66-
# Set environment variables for the resource group name and location. Make sure to replace the placeholders with your own values.
67-
export RESOURCE_GROUP="<resource-group-name>"
68-
export LOCATION="<azure-region>"
69-
70-
# Create a resource group
71-
az group create --name $RESOURCE_GROUP --location $LOCATION
72-
```
65+
```azurecli-interactive
66+
# Set environment variables for the resource group name and location. Make sure to replace the placeholders with your own values.
67+
export RESOURCE_GROUP="<resource-group-name>"
68+
export LOCATION="<azure-region>"
69+
70+
# Create a resource group
71+
az group create --name $RESOURCE_GROUP --location $LOCATION
72+
```
7373

7474
## Create an AKS cluster with Advanced Network Observability
7575

7676
### [**Non-Cilium**](#tab/non-cilium)
7777
Create an AKS cluster with Advanced Network Observability with a non-Cilium data plane using the [`az aks create`](/cli/azure/aks#az_aks_create) command and the `--enable-advanced-networking-observability` flag.
7878

79-
```azurecli-interactive
80-
# Set an environment variable for the AKS cluster name. Make sure to replace the placeholder with your own value.
81-
export CLUSTER_NAME="<aks-cluster-name>"
82-
83-
# Create an AKS cluster
84-
az aks create \
85-
--name $CLUSTER_NAME \
86-
--resource-group $RESOURCE_GROUP \
87-
--generate-ssh-keys \
88-
--network-plugin azure \
89-
--network-plugin-mode overlay \
90-
--pod-cidr 192.168.0.0/16 \
91-
--enable-advanced-network-observability
92-
```
79+
```azurecli-interactive
80+
# Set an environment variable for the AKS cluster name. Make sure to replace the placeholder with your own value.
81+
export CLUSTER_NAME="<aks-cluster-name>"
82+
83+
# Create an AKS cluster
84+
az aks create \
85+
--name $CLUSTER_NAME \
86+
--resource-group $RESOURCE_GROUP \
87+
--generate-ssh-keys \
88+
--network-plugin azure \
89+
--network-plugin-mode overlay \
90+
--pod-cidr 192.168.0.0/16 \
91+
--enable-advanced-network-observability
92+
```
9393

9494
### [**Cilium**](#tab/cilium)
9595

@@ -99,25 +99,25 @@ Create an AKS cluster with Advanced Network Observability with a Cilium data pla
9999
> Clusters with the Cilium data plane support Advanced Network Observability starting with Kubernetes version 1.29.
100100
101101

102-
```azurecli-interactive
103-
# Set an environment variable for the AKS cluster name. Make sure to replace the placeholder with your own value.
104-
export CLUSTER_NAME="<aks-cluster-name>"
105-
106-
# Create an AKS cluster
107-
az aks create \
108-
--name $CLUSTER_NAME \
109-
--resource-group $RESOURCE_GROUP \
110-
--generate-ssh-keys \
111-
--location eastus \
112-
--max-pods 250 \
113-
--network-plugin azure \
114-
--network-plugin-mode overlay \
115-
--network-dataplane cilium \
116-
--node-count 2 \
117-
--pod-cidr 192.168.0.0/16 \
118-
--kubernetes-version 1.29 \
119-
--enable-advanced-network-observability
120-
```
102+
```azurecli-interactive
103+
# Set an environment variable for the AKS cluster name. Make sure to replace the placeholder with your own value.
104+
export CLUSTER_NAME="<aks-cluster-name>"
105+
106+
# Create an AKS cluster
107+
az aks create \
108+
--name $CLUSTER_NAME \
109+
--resource-group $RESOURCE_GROUP \
110+
--generate-ssh-keys \
111+
--location eastus \
112+
--max-pods 250 \
113+
--network-plugin azure \
114+
--network-plugin-mode overlay \
115+
--network-dataplane cilium \
116+
--node-count 2 \
117+
--pod-cidr 192.168.0.0/16 \
118+
--kubernetes-version 1.29 \
119+
--enable-advanced-network-observability
120+
```
121121

122122
---
123123

@@ -128,85 +128,85 @@ Enable Advanced Network Observability on an existing cluster using the [`az aks
128128
> [!NOTE]
129129
> Clusters with the Cilium data plane support Advanced Network Observability starting with Kubernetes version 1.29.
130130
131-
```azurecli-interactive
132-
az aks update \
133-
--resource-group $RESOURCE_GROUP \
134-
--name $CLUSTER_NAME \
135-
--enable-advanced-network-observability
136-
```
131+
```azurecli-interactive
132+
az aks update \
133+
--resource-group $RESOURCE_GROUP \
134+
--name $CLUSTER_NAME \
135+
--enable-advanced-network-observability
136+
```
137137

138138
## Get cluster credentials
139139

140140
Get your cluster credentials using the [`az aks get-credentials`](/cli/azure/aks#az_aks_get_credentials) command.
141141

142-
```azurecli-interactive
143-
az aks get-credentials --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP
144-
```
142+
```azurecli-interactive
143+
az aks get-credentials --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP
144+
```
145145

146146
## Azure managed Prometheus and Grafana
147147

148148
Use the following example to install and enable Prometheus and Grafana for your AKS cluster.
149149

150150
### Create Azure Monitor resource
151151

152-
```azurecli-interactive
153-
#Set an environment variable for the Grafana name. Make sure to replace the placeholder with your own value.
154-
export AZURE_MONITOR_NAME="<azure-monitor-name>"
155-
156-
# Create Azure monitor resource
157-
az resource create \
158-
--resource-group $RESOURCE_GROUP \
159-
--namespace microsoft.monitor \
160-
--resource-type accounts \
161-
--name $AZURE_MONITOR_NAME \
162-
--location eastus \
163-
--properties '{}'
164-
```
152+
```azurecli-interactive
153+
#Set an environment variable for the Grafana name. Make sure to replace the placeholder with your own value.
154+
export AZURE_MONITOR_NAME="<azure-monitor-name>"
155+
156+
# Create Azure monitor resource
157+
az resource create \
158+
--resource-group $RESOURCE_GROUP \
159+
--namespace microsoft.monitor \
160+
--resource-type accounts \
161+
--name $AZURE_MONITOR_NAME \
162+
--location eastus \
163+
--properties '{}'
164+
```
165165

166166
### Create Grafana instance
167167

168168
Use [az grafana create](/cli/azure/grafana#az-grafana-create) to create a Grafana instance. The name of the Grafana instance must be unique.
169169

170-
```azurecli-interactive
171-
# Set an environment variable for the Grafana name. Make sure to replace the placeholder with your own value.
172-
export GRAFANA_NAME="<grafana-name>"
173-
174-
# Create Grafana instance
175-
az grafana create \
176-
--name $GRAFANA_NAME \
177-
--resource-group $RESOURCE_GROUP
178-
```
170+
```azurecli-interactive
171+
# Set an environment variable for the Grafana name. Make sure to replace the placeholder with your own value.
172+
export GRAFANA_NAME="<grafana-name>"
173+
174+
# Create Grafana instance
175+
az grafana create \
176+
--name $GRAFANA_NAME \
177+
--resource-group $RESOURCE_GROUP
178+
```
179179

180180
### Place the Grafana and Azure Monitor resource IDs in variables
181181

182182
Use [az grafana show](/cli/azure/grafana#az-grafana-show) to place the Grafana resource ID in a variable. Use [az resource show](/cli/azure/resource#az-resource-show) to place the Azure Monitor resource ID in a variable. Replace **myGrafana** with the name of your Grafana instance.
183183

184-
```azurecli-interactive
185-
grafanaId=$(az grafana show \
186-
--name $GRAFANA_NAME \
184+
```azurecli-interactive
185+
grafanaId=$(az grafana show \
186+
--name $GRAFANA_NAME \
187+
--resource-group $RESOURCE_GROUP \
188+
--query id \
189+
--output tsv)
190+
azuremonitorId=$(az resource show \
187191
--resource-group $RESOURCE_GROUP \
192+
--name $AZURE_MONITOR_NAME \
193+
--resource-type "Microsoft.Monitor/accounts" \
188194
--query id \
189195
--output tsv)
190-
azuremonitorId=$(az resource show \
191-
--resource-group $RESOURCE_GROUP \
192-
--name $AZURE_MONITOR_NAME \
193-
--resource-type "Microsoft.Monitor/accounts" \
194-
--query id \
195-
--output tsv)
196-
```
196+
```
197197

198198
### Link Azure Monitor and Grafana to the AKS cluster
199199

200200
Use [az aks update](/cli/azure/aks#az-aks-update) to link the Azure Monitor and Grafana resources to your AKS cluster.
201201

202-
```azurecli-interactive
203-
az aks update \
204-
--name $CLUSTER_NAME \
205-
--resource-group $RESOURCE_GROUP \
206-
--enable-azure-monitor-metrics \
207-
--azure-monitor-workspace-resource-id $azuremonitorId \
208-
--grafana-resource-id $grafanaId
209-
```
202+
```azurecli-interactive
203+
az aks update \
204+
--name $CLUSTER_NAME \
205+
--resource-group $RESOURCE_GROUP \
206+
--enable-azure-monitor-metrics \
207+
--azure-monitor-workspace-resource-id $azuremonitorId \
208+
--grafana-resource-id $grafanaId
209+
```
210210

211211
## Visualization using Grafana
212212

@@ -217,20 +217,20 @@ Use [az aks update](/cli/azure/aks#az-aks-update) to link the Azure Monitor and
217217
218218
1. Make sure the Azure Monitor pods are running using the `kubectl get pods` command.
219219

220-
```azurecli-interactive
221-
kubectl get pods -o wide -n kube-system | grep ama-
222-
```
223-
224-
Your output should look similar to the following example output:
225-
226-
```output
227-
ama-metrics-5bc6c6d948-zkgc9 2/2 Running 0 (21h ago) 26h
228-
ama-metrics-ksm-556d86b5dc-2ndkv 1/1 Running 0 (26h ago) 26h
229-
ama-metrics-node-lbwcj 2/2 Running 0 (21h ago) 26h
230-
ama-metrics-node-rzkzn 2/2 Running 0 (21h ago) 26h
231-
ama-metrics-win-node-gqnkw 2/2 Running 0 (26h ago) 26h
232-
ama-metrics-win-node-tkrm8 2/2 Running 0 (26h ago) 26h
233-
```
220+
```azurecli-interactive
221+
kubectl get pods -o wide -n kube-system | grep ama-
222+
```
223+
224+
Your output should look similar to the following example output:
225+
226+
```output
227+
ama-metrics-5bc6c6d948-zkgc9 2/2 Running 0 (21h ago) 26h
228+
ama-metrics-ksm-556d86b5dc-2ndkv 1/1 Running 0 (26h ago) 26h
229+
ama-metrics-node-lbwcj 2/2 Running 0 (21h ago) 26h
230+
ama-metrics-node-rzkzn 2/2 Running 0 (21h ago) 26h
231+
ama-metrics-win-node-gqnkw 2/2 Running 0 (26h ago) 26h
232+
ama-metrics-win-node-tkrm8 2/2 Running 0 (26h ago) 26h
233+
```
234234
235235
1. We have created sample dashboards. They can be found under the **Dashboards > Azure Managed Prometheus** folder. They have names like **"Kubernetes / Networking / `<name>`"**. The suite of dashboards includes:
236236
* **Clusters:** shows Node-level metrics for your clusters.

0 commit comments

Comments
 (0)