Skip to content

Commit 6e32272

Browse files
authored
Merge pull request #278000 from pjlewisuk/main
Review of Kubernetes on Azure Tutorial with relevant updates
2 parents b5ee945 + 0a67979 commit 6e32272

8 files changed

+158
-115
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
> [!NOTE]
22
>
3-
> If no patch is specified, the cluster automatically upgrades to the specified minor version's latest GA patch. For example, setting `--kubernetes-version` to `1.21` results in the cluster upgrading to `1.21.9`.
3+
> If no patch is specified, the cluster automatically upgrades to the specified minor version's latest GA patch. For example, setting `--kubernetes-version` to `1.28` results in the cluster upgrading to `1.28.9`.
44
>
55
> For more information, see [Supported Kubernetes minor version upgrades in AKS](../../supported-kubernetes-versions.md#alias-minor-version).

articles/aks/tutorial-kubernetes-deploy-application.md

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Kubernetes on Azure tutorial - Deploy an application to Azure Kubernetes Service (AKS)
33
description: In this Azure Kubernetes Service (AKS) tutorial, you deploy a multi-container application to your cluster using images stored in Azure Container Registry.
44
ms.topic: tutorial
5-
ms.date: 02/20/2023
5+
ms.date: 06/10/2024
66
ms.custom: mvc, devx-track-extended-azdevcli
77
#Customer intent: As a developer, I want to learn how to deploy apps to an Azure Kubernetes Service (AKS) cluster so that I can deploy and run my own applications.
88
---
@@ -57,11 +57,7 @@ In these tutorials, your Azure Container Registry (ACR) instance stores the cont
5757
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
5858
```
5959
60-
2. Make sure you're in the cloned *aks-store-demo* directory, and then open the manifest file with a text editor, such as `vi`.
61-
62-
```azurecli-interactive
63-
vi aks-store-quickstart.yaml
64-
```
60+
2. Make sure you're in the cloned *aks-store-demo* directory, and then open the `aks-store-quickstart.yaml` manifest file with a text editor.
6561
6662
3. Update the `image` property for the containers by replacing *ghcr.io/azure-samples* with your ACR login server name.
6763
@@ -79,21 +75,17 @@ In these tutorials, your Azure Container Registry (ACR) instance stores the cont
7975
...
8076
```
8177
82-
4. Save and close the file. In `vi`, use `:wq`.
78+
4. Save and close the file.
8379
8480
### [Azure PowerShell](#tab/azure-powershell)
8581
8682
1. Get your login server address using the [`Get-AzContainerRegistry`][get-azcontainerregistry] cmdlet and query for your login server. Make sure you replace `<acrName>` with the name of your ACR instance.
8783
8884
```azurepowershell-interactive
89-
(Get-AzContainerRegistry -ResourceGroupName myResourceGroup -Name <acrName>).LoginServer
85+
(Get-AzContainerRegistry -ResourceGroupName myResourceGroup -Name $ACRNAME).LoginServer
9086
```
9187
92-
2. Make sure you're in the cloned *aks-store-demo* directory, and then open the manifest file with a text editor, such as `vi`.
93-
94-
```azurepowershell-interactive
95-
vi aks-store-quickstart.yaml
96-
```
88+
2. Make sure you're in the cloned *aks-store-demo* directory, and then open the `aks-store-quickstart.yaml` manifest file with a text editor.
9789
9890
3. Update the `image` property for the containers by replacing *ghcr.io/azure-samples* with your ACR login server name.
9991
@@ -111,7 +103,7 @@ In these tutorials, your Azure Container Registry (ACR) instance stores the cont
111103
...
112104
```
113105
114-
4. Save and close the file. In `vi`, use `:wq`.
106+
4. Save and close the file.
115107
116108
### [Azure Developer CLI](#tab/azure-azd)
117109
@@ -132,7 +124,8 @@ In these tutorials, your Azure Container Registry (ACR) instance stores the cont
132124
The following example output shows the resources successfully created in the AKS cluster:
133125
134126
```output
135-
deployment.apps/rabbitmq created
127+
statefulset.apps/rabbitmq created
128+
configmap/rabbitmq-enabled-plugins created
136129
service/rabbitmq created
137130
deployment.apps/order-service created
138131
service/order-service created
@@ -159,7 +152,8 @@ In these tutorials, your Azure Container Registry (ACR) instance stores the cont
159152
The following example output shows the resources successfully created in the AKS cluster:
160153
161154
```output
162-
deployment.apps/rabbitmq created
155+
statefulset.apps/rabbitmq created
156+
configmap/rabbitmq-enabled-plugins created
163157
service/rabbitmq created
164158
deployment.apps/order-service created
165159
service/order-service created
@@ -210,21 +204,21 @@ When the application runs, a Kubernetes service exposes the application front en
210204
kubectl get service store-front --watch
211205
```
212206
213-
Initially, the `EXTERNAL-IP` for the *store-front* service shows as *pending*:
207+
Initially, the `EXTERNAL-IP` for the `store-front` service shows as `<pending>`:
214208
215209
```output
216210
store-front LoadBalancer 10.0.34.242 <pending> 80:30676/TCP 5s
217211
```
218212
219-
2. When the `EXTERNAL-IP` address changes from *pending* to an actual public IP address, use `CTRL-C` to stop the `kubectl` watch process.
213+
2. When the `EXTERNAL-IP` address changes from `<pending>` to a public IP address, use `CTRL-C` to stop the `kubectl` watch process.
220214
221215
The following example output shows a valid public IP address assigned to the service:
222216
223217
```output
224218
store-front LoadBalancer 10.0.34.242 52.179.23.131 80:30676/TCP 67s
225219
```
226220
227-
3. View the application in action by opening a web browser to the external IP address of your service.
221+
3. View the application in action by opening a web browser and navigating to the external IP address of your service: `http://<external-ip>`.
228222
229223
:::image type="content" source="./learn/media/quick-kubernetes-deploy-cli/aks-store-application.png" alt-text="Screenshot of AKS Store sample application." lightbox="./learn/media/quick-kubernetes-deploy-cli/aks-store-application.png":::
230224
@@ -237,11 +231,27 @@ Navigate to your Azure portal to find your deployment information.
237231
1. Open your [Resource Group][azure-rg] on the Azure portal
238232
1. Navigate to the Kubernetes service for your cluster
239233
1. Select `Services and Ingress` under `Kubernetes Resources`
240-
1. Copy the External IP shown in the column for store-front
234+
1. Copy the External IP shown in the column for the `store-front` service
241235
1. Paste the IP into your browser and visit your store page
242236
243237
:::image type="content" source="./learn/media/quick-kubernetes-deploy-cli/aks-store-application.png" alt-text="Screenshot of AKS Store sample application." lightbox="./learn/media/quick-kubernetes-deploy-cli/aks-store-application.png":::
244238
239+
## Clean up resources
240+
241+
Since you validated the application's functionality, you can now remove the cluster from the application. We will deploy the application again in the next tutorial.
242+
243+
1. Stop and remove the container instances and resources using the [`docker-compose down`][docker-compose-down] command.
244+
245+
```console
246+
kubectl delete -f aks-store-quickstart.yaml
247+
```
248+
249+
1. Check that all the application pods have been removed:
250+
251+
```console
252+
kubectl get pods
253+
```
254+
245255
## Next steps
246256
247257
In this tutorial, you deployed a sample Azure application to a Kubernetes cluster in AKS. You learned how to:

articles/aks/tutorial-kubernetes-deploy-cluster.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Kubernetes on Azure tutorial - Create an Azure Kubernetes Service (AKS) cluster
33
description: In this Azure Kubernetes Service (AKS) tutorial, you learn how to create an AKS cluster and use kubectl to connect to the Kubernetes main node.
44
ms.topic: tutorial
5-
ms.date: 02/14/2024
5+
ms.date: 06/10/2024
66
author: schaffererin
77
ms.author: schaffererin
88

@@ -18,7 +18,7 @@ Kubernetes provides a distributed platform for containerized applications. With
1818
In this tutorial, part three of seven, you deploy a Kubernetes cluster in AKS. You learn how to:
1919

2020
> [!div class="checklist"]
21-
21+
>
2222
> * Deploy an AKS cluster that can authenticate to an Azure Container Registry (ACR).
2323
> * Install the Kubernetes CLI, `kubectl`.
2424
> * Configure `kubectl` to connect to your AKS cluster.
@@ -98,15 +98,15 @@ For information about AKS resource limits and region availability, see [Quotas,
9898
9999
To allow an AKS cluster to interact with other Azure resources, the Azure platform automatically creates a cluster identity. In this example, the cluster identity is [granted the right to pull images][container-registry-integration] from the ACR instance you created in the previous tutorial. To execute the command successfully, you need to have an **Owner** or **Azure account administrator** role in your Azure subscription.
100100
101-
* Create an AKS cluster using the [`az aks create`][az aks create] command. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr] in the *eastus* region.
101+
* Create an AKS cluster using the [`az aks create`][az aks create] command. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr] in the *eastus* region. We will continue to use the environment variable, `$ACRNAME`, that we set in the [previous tutorial][aks-tutorial-prepare-acr]. If you do not have this environment variable set, set it now to the same value you used previously.
102102
103103
```azurecli-interactive
104104
az aks create \
105105
--resource-group myResourceGroup \
106106
--name myAKSCluster \
107107
--node-count 2 \
108108
--generate-ssh-keys \
109-
--attach-acr <acrName>
109+
--attach-acr $ACRNAME
110110
```
111111
112112
> [!NOTE]
@@ -121,7 +121,7 @@ To allow an AKS cluster to interact with other Azure resources, the Azure platfo
121121
* Create an AKS cluster using the [`New-AzAksCluster`][new-azakscluster] cmdlet. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr] in the *eastus* region.
122122
123123
```azurepowershell-interactive
124-
New-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCount 2 -GenerateSshKey -AcrNameToAttach <acrName>
124+
New-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCount 2 -GenerateSshKey -AcrNameToAttach $ACRNAME
125125
```
126126
127127
> [!NOTE]
@@ -155,8 +155,8 @@ To avoid needing an **Owner** or **Azure account administrator** role, you can a
155155
156156
```output
157157
NAME STATUS ROLES AGE VERSION
158-
aks-nodepool1-19366578-vmss000002 Ready agent 47h v1.25.6
159-
aks-nodepool1-19366578-vmss000003 Ready agent 47h v1.25.6
158+
aks-nodepool1-19366578-vmss000000 Ready agent 47h v1.28.9
159+
aks-nodepool1-19366578-vmss000001 Ready agent 47h v1.28.9
160160
```
161161
162162
### [Azure PowerShell](#tab/azure-powershell)
@@ -177,8 +177,8 @@ To avoid needing an **Owner** or **Azure account administrator** role, you can a
177177
178178
```output
179179
NAME STATUS ROLES AGE VERSION
180-
aks-nodepool1-19366578-vmss000002 Ready agent 47h v1.25.6
181-
aks-nodepool1-19366578-vmss000003 Ready agent 47h v1.25.6
180+
aks-nodepool1-19366578-vmss000000 Ready agent 47h v1.28.9
181+
aks-nodepool1-19366578-vmss000001 Ready agent 47h v1.28.9
182182
```
183183
184184
### [Azure Developer CLI](#tab/azure-azd)
@@ -201,8 +201,8 @@ To avoid needing an **Owner** or **Azure account administrator** role, you can a
201201
202202
```output
203203
NAME STATUS ROLES AGE VERSION
204-
aks-nodepool1-19366578-vmss000002 Ready agent 47h v1.25.6
205-
aks-nodepool1-19366578-vmss000003 Ready agent 47h v1.25.6
204+
aks-nodepool1-19366578-vmss000000 Ready agent 47h v1.28.9
205+
aks-nodepool1-19366578-vmss000001 Ready agent 47h v1.28.9
206206
```
207207
208208
[!INCLUDE [azd-login-ts](./includes/azd/azd-login-ts.md)]

articles/aks/tutorial-kubernetes-paas-services.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Kubernetes on Azure tutorial - Use PaaS services with an Azure Kubernetes Service (AKS) cluster
33
description: In this Azure Kubernetes Service (AKS) tutorial, you learn how to use the Azure Service Bus service with your AKS cluster.
44
ms.topic: tutorial
5-
ms.date: 10/23/2023
5+
ms.date: 06/10/2024
66
ms.custom: mvc, devx-track-azurecli, devx-track-azurepowershell
77
#Customer intent: As a developer, I want to learn how to use PaaS services with an Azure Kubernetes Service (AKS) cluster so that I can deploy and manage my applications.
88
---
@@ -289,7 +289,7 @@ In previous tutorials, you used a RabbitMQ container to store orders submitted b
289289
kubectl get service store-front
290290
```
291291
292-
2. Navigate to the external IP address of the `store-front` service in your browser.
292+
2. Navigate to the external IP address of the `store-front` service in your browser using `http://<external-ip>`.
293293
3. Place an order by choosing a product and selecting **Add to cart**.
294294
4. Select **Cart** to view your order, and then select **Checkout**.
295295

articles/aks/tutorial-kubernetes-prepare-acr.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Kubernetes on Azure tutorial - Create an Azure Container Registry and build images
33
description: In this Azure Kubernetes Service (AKS) tutorial, you create an Azure Container Registry instance and upload sample application container images.
44
ms.topic: tutorial
5-
ms.date: 11/28/2023
5+
ms.date: 06/10/2024
66
author: schaffererin
77
ms.author: schaffererin
88

@@ -69,6 +69,9 @@ Before creating an ACR instance, you need a resource group. An Azure resource gr
6969
2. Create an ACR instance using the [`New-AzContainerRegistry`][new-azcontainerregistry] cmdlet and provide your own unique registry name. The registry name must be unique within Azure and contain 5-50 alphanumeric characters. The rest of this tutorial uses an environment variable, `$ACRNAME`, as a placeholder for the container registry name. You can set this environment variable to your unique ACR name to use in future commands. The *Basic* SKU is a cost-optimized entry point for development purposes that provides a balance of storage and throughput.
7070
7171
```azurepowershell-interactive
72+
$rand=New-Object System.Random
73+
$RAND=$rand.Next()
74+
$ACRNAME="myregistry$RAND" # Or replace with your own name
7275
New-AzContainerRegistry -ResourceGroupName myResourceGroup -Name $ACRNAME -Location eastus -Sku Basic
7376
```
7477

articles/aks/tutorial-kubernetes-prepare-app.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Kubernetes on Azure tutorial - Prepare an application for Azure Kubernetes Service (AKS)
33
description: In this Azure Kubernetes Service (AKS) tutorial, you learn how to prepare and build a multi-container app with Docker Compose that you can then deploy to AKS.
44
ms.topic: tutorial
5-
ms.date: 02/15/2023
5+
ms.date: 06/10/2024
66
author: schaffererin
77
ms.author: schaffererin
88

@@ -294,9 +294,9 @@ In the next tutorial, you learn how to create a cluster using the `azd` template
294294

295295
<!-- LINKS - external -->
296296
[docker-compose]: https://docs.docker.com/compose/
297-
[docker-for-linux]: https://docs.docker.com/engine/installation/#supported-platforms
298-
[docker-for-mac]: https://docs.docker.com/docker-for-mac/
299-
[docker-for-windows]: https://docs.docker.com/docker-for-windows/
297+
[docker-for-linux]: https://docs.docker.com/desktop/install/linux-install/
298+
[docker-for-mac]: https://docs.docker.com/desktop/install/mac-install/
299+
[docker-for-windows]: https://docs.docker.com/desktop/install/windows-install/
300300
[docker-get-started]: https://docs.docker.com/get-started/
301301
[docker-images]: https://docs.docker.com/engine/reference/commandline/images/
302302
[docker-ps]: https://docs.docker.com/engine/reference/commandline/ps/

articles/aks/tutorial-kubernetes-scale.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Kubernetes on Azure tutorial - Scale applications in Azure Kubernetes Service (AKS)
33
description: In this Azure Kubernetes Service (AKS) tutorial, you learn how to scale nodes and pods and implement horizontal pod autoscaling.
44
ms.topic: tutorial
5-
ms.date: 03/05/2023
5+
ms.date: 06/10/2024
66
author: schaffererin
77
ms.author: schaffererin
88

@@ -160,18 +160,24 @@ The following example increases the number of nodes to three in the Kubernetes c
160160
Once the cluster successfully scales, your output will be similar to following example output:
161161

162162
```output
163+
"aadProfile": null,
164+
"addonProfiles": null,
163165
"agentPoolProfiles": [
164166
{
167+
...
165168
"count": 3,
166-
"dnsPrefix": null,
167-
"fqdn": null,
168-
"name": "myAKSCluster",
169-
"osDiskSizeGb": null,
169+
"mode": "System",
170+
"name": "nodepool1",
171+
"osDiskSizeGb": 128,
172+
"osDiskType": "Managed",
170173
"osType": "Linux",
171174
"ports": null,
172-
"vmSize": "Standard_D2_v2",
175+
"vmSize": "Standard_DS2_v2",
173176
"vnetSubnetId": null
177+
...
174178
}
179+
...
180+
]
175181
```
176182

177183
### [Azure PowerShell](#tab/azure-powershell)
@@ -185,30 +191,24 @@ The following example increases the number of nodes to three in the Kubernetes c
185191
Once the cluster successfully scales, your output will be similar to following example output:
186192

187193
```output
188-
ProvisioningState : Succeeded
189-
MaxAgentPools : 100
190-
KubernetesVersion : 1.19.9
191-
DnsPrefix : myAKSCluster
192-
Fqdn : myakscluster-000a0aa0.hcp.eastus.azmk8s.io
193-
PrivateFQDN :
194-
AgentPoolProfiles : {default}
195-
WindowsProfile : Microsoft.Azure.Commands.Aks.Models.PSManagedClusterWindowsProfile
196-
AddonProfiles : {}
197-
NodeResourceGroup : MC_myresourcegroup_myAKSCluster_eastus
198-
EnableRBAC : True
199-
EnablePodSecurityPolicy :
200-
NetworkProfile : Microsoft.Azure.Commands.Aks.Models.PSContainerServiceNetworkProfile
201-
AadProfile :
202-
ApiServerAccessProfile :
203-
Identity :
204-
LinuxProfile : Microsoft.Azure.Commands.Aks.Models.PSContainerServiceLinuxProfile
205-
ServicePrincipalProfile : Microsoft.Azure.Commands.Aks.Models.PSContainerServiceServicePrincipalProfile
206-
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myresourcegroup/providers/Micros
207-
oft.ContainerService/managedClusters/myAKSCluster
208-
Name : myAKSCluster
209-
Type : Microsoft.ContainerService/ManagedClusters
210-
Location : eastus
211-
Tags : {}
194+
...
195+
ProvisioningState : Succeeded
196+
MaxAgentPools : 100
197+
KubernetesVersion : 1.28
198+
CurrentKubernetesVersion : 1.28.9
199+
DnsPrefix : myAKSCluster
200+
Fqdn : myakscluster-000a0aa0.hcp.eastus.azmk8s.io
201+
PrivateFQDN :
202+
AzurePortalFQDN : myakscluster-000a0aa0.portal.hcp.eastus.azmk8s.io
203+
AgentPoolProfiles : {default}
204+
...
205+
ResourceGroupName : myResourceGroup
206+
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Mic
207+
rosoft.ContainerService/managedClusters/myAKSCluster
208+
Name : myAKSCluster
209+
Type : Microsoft.ContainerService/ManagedClusters
210+
Location : eastus
211+
Tags :
212212
```
213213

214214
---

0 commit comments

Comments
 (0)