Skip to content

Commit f17ffc2

Browse files
[Doc-a-thon] Code block updated
1 parent 34f8e2c commit f17ffc2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

articles/aks/availability-zones.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
9494

9595
Next, use the [kubectl describe][kubectl-describe] command to list the nodes in the cluster and filter on the `topology.kubernetes.io/zone` value. The following example is for a Bash shell.
9696

97-
```bash
97+
```azurecli-interactive
9898
kubectl describe nodes | grep -e "Name:" -e "topology.kubernetes.io/zone"
9999
```
100100

101101
The following example output shows the three nodes distributed across the specified region and availability zones, such as *eastus2-1* for the first availability zone and *eastus2-2* for the second availability zone:
102102

103-
```console
103+
```output
104104
Name: aks-nodepool1-28993262-vmss000000
105105
topology.kubernetes.io/zone=eastus2-1
106106
Name: aks-nodepool1-28993262-vmss000001
@@ -113,13 +113,13 @@ As you add more nodes to an agent pool, the Azure platform automatically distrib
113113

114114
With Kubernetes versions 1.17.0 and later, AKS uses the newer label `topology.kubernetes.io/zone` and the deprecated `failure-domain.beta.kubernetes.io/zone`. You can get the same result from running the `kubelet describe nodes` command in the previous step, by running the following script:
115115

116-
```console
116+
```azurecli-interactive
117117
kubectl get nodes -o custom-columns=NAME:'{.metadata.name}',REGION:'{.metadata.labels.topology\.kubernetes\.io/region}',ZONE:'{metadata.labels.topology\.kubernetes\.io/zone}'
118118
```
119119

120120
The following example resembles the output with more verbose details:
121121

122-
```console
122+
```output
123123
NAME REGION ZONE
124124
aks-nodepool1-34917322-vmss000000 eastus eastus-1
125125
aks-nodepool1-34917322-vmss000001 eastus eastus-2
@@ -139,7 +139,7 @@ az aks scale \
139139

140140
When the scale operation completes after a few minutes, run the command `kubectl describe nodes | grep -e "Name:" -e "topology.kubernetes.io/zone"` in a Bash shell. The following output resembles the results:
141141

142-
```console
142+
```output
143143
Name: aks-nodepool1-28993262-vmss000000
144144
topology.kubernetes.io/zone=eastus2-1
145145
Name: aks-nodepool1-28993262-vmss000001
@@ -154,14 +154,14 @@ Name: aks-nodepool1-28993262-vmss000004
154154

155155
You now have two more nodes in zones 1 and 2. You can deploy an application consisting of three replicas. The following example uses NGINX:
156156

157-
```bash
157+
```azurecli-interactive
158158
kubectl create deployment nginx --image=mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine
159159
kubectl scale deployment nginx --replicas=3
160160
```
161161

162162
By viewing nodes where your pods are running, you see pods are running on the nodes corresponding to three different availability zones. For example, with the command `kubectl describe pod | grep -e "^Name:" -e "^Node:"` in a Bash shell, you see the following example output:
163163

164-
```console
164+
```output
165165
Name: nginx-6db489d4b7-ktdwg
166166
Node: aks-nodepool1-28993262-vmss000000/10.240.0.4
167167
Name: nginx-6db489d4b7-v7zvj

0 commit comments

Comments
 (0)