You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/tutorial-kubernetes-deploy-application.md
+28-27Lines changed: 28 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,36 @@
1
1
---
2
-
title: Kubernetes on Azure tutorial - Deploy an application
2
+
title: Kubernetes on Azure tutorial - Deploy an application
3
3
description: In this Azure Kubernetes Service (AKS) tutorial, you deploy a multi-container application to your cluster using a custom image stored in Azure Container Registry.
4
4
services: container-service
5
5
ms.topic: tutorial
6
-
ms.date: 05/24/2021
7
-
6
+
ms.date: 01/04/2023
8
7
ms.custom: mvc, devx-track-azurepowershell
9
8
10
9
#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.
11
10
---
12
11
13
12
# Tutorial: Run applications in Azure Kubernetes Service (AKS)
14
13
15
-
Kubernetes provides a distributed platform for containerized applications. You build and deploy your own applications and services into a Kubernetes cluster, and let the cluster manage the availability and connectivity. In this tutorial, part four of seven, a sample application is deployed into a Kubernetes cluster. You learn how to:
14
+
Kubernetes provides a distributed platform for containerized applications. You build and deploy your own applications and services into a Kubernetes cluster and let the cluster manage the availability and connectivity. In this tutorial, part four of seven, you deploy a sample application into a Kubernetes cluster. You learn how to:
16
15
17
16
> [!div class="checklist"]
18
-
> * Update a Kubernetes manifest file
19
-
> * Run an application in Kubernetes
20
-
> * Test the application
17
+
>
18
+
> * Update a Kubernetes manifest file.
19
+
> * Run an application in Kubernetes.
20
+
> * Test the application.
21
21
22
-
In later tutorials, this application is scaled out and updated.
22
+
In later tutorials, you'll scale out and update your application.
23
23
24
-
This quickstart assumes a basic understanding of Kubernetes concepts. For more information, see [Kubernetes core concepts for Azure Kubernetes Service (AKS)][kubernetes-concepts].
24
+
This quickstart assumes you have a basic understanding of Kubernetes concepts. For more information, see [Kubernetes core concepts for Azure Kubernetes Service (AKS)][kubernetes-concepts].
25
25
26
26
> [!TIP]
27
-
> AKS clusters can use GitOps for configuration management. This enables declarations of your cluster's state, which are pushed to source control, to be applied to the cluster automatically. To learn how to use GitOps to deploy an application with an AKS cluster, see the tutorial [Use GitOps with Flux v2][gitops-flux-tutorial] and follow the [prerequisites for Azure Kubernetes Service clusters][gitops-flux-tutorial-aks].
27
+
> AKS clusters can use GitOps for configuration management. GitOp enables declarations of your cluster's state, which are pushed to source control, to be applied to the cluster automatically. To learn how to use GitOps to deploy an application with an AKS cluster, see the [prerequisites for Azure Kubernetes Service clusters][gitops-flux-tutorial-aks] in the [GitOps with Flux v2][gitops-flux-tutorial] tutorial.
28
28
29
29
## Before you begin
30
30
31
-
In previous tutorials, an application was packaged into a container image, this image was uploaded to Azure Container Registry, and a Kubernetes cluster was created.
31
+
In previous tutorials, you packaged an application into a container image, uploaded the image to Azure Container Registry, and created a Kubernetes cluster.
32
32
33
-
To complete this tutorial, you need the pre-created `azure-vote-all-in-one-redis.yaml` Kubernetes manifest file. This file was downloaded with the application source code in a previous tutorial. Verify that you've cloned the repo, and that you have changed directories into the cloned repo. If you haven't done these steps, and would like to follow along, start with [Tutorial 1 – Create container images][aks-tutorial-prepare-app].
33
+
To complete this tutorial, you need the pre-created `azure-vote-all-in-one-redis.yaml` Kubernetes manifest file. This file download was included with the application source code in a previous tutorial. Verify that you've cloned the repo and that you've changed directories into the cloned repo. If you haven't done these steps and would like to follow along, start with [Tutorial 1: Prepare an application for AKS][aks-tutorial-prepare-app].
34
34
35
35
### [Azure CLI](#tab/azure-cli)
36
36
@@ -48,37 +48,37 @@ In these tutorials, an Azure Container Registry (ACR) instance stores the contai
48
48
49
49
### [Azure CLI](#tab/azure-cli)
50
50
51
-
Get the ACR login server name using the [az acr list][az-acr-list] command as follows:
51
+
Get the ACR login server name using the [az acr list][az-acr-list] command.
52
52
53
53
```azurecli
54
54
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
55
55
```
56
56
57
57
### [Azure PowerShell](#tab/azure-powershell)
58
58
59
-
Get the ACR login server name using the [Get-AzContainerRegistry][get-azcontainerregistry] cmdlet as follows:
59
+
Get the ACR login server name using the [Get-AzContainerRegistry][get-azcontainerregistry] cmdlet.
The sample manifest file from the git repo cloned in the first tutorial uses the images from Microsoft Container Registry (*mcr.microsoft.com*). Make sure that you're in the cloned *azure-voting-app-redis* directory, then open the manifest file with a text editor, such as `vi`:
67
+
The sample manifest file from the git repo you cloned in the first tutorial uses the images from Microsoft Container Registry (*mcr.microsoft.com*). Make sure you're in the cloned *azure-voting-app-redis* directory, and then open the manifest file with a text editor, such as `vi`:
68
68
69
69
```console
70
70
vi azure-vote-all-in-one-redis.yaml
71
71
```
72
72
73
-
Replace *mcr.microsoft.com* with your ACR login server name. The image name is found on line 60 of the manifest file. The following example shows the default image name:
73
+
Replace *mcr.microsoft.com* with your ACR login server name. You can find the image name on line 60 of the manifest file. The following example shows the default image name:
Provide your own ACR login server name so that your manifest file looks like the following example:
81
+
Provide your own ACR login server name so your manifest file looks similar to the following example:
82
82
83
83
```yaml
84
84
containers:
@@ -90,7 +90,7 @@ Save and close the file. In `vi`, use `:wq`.
90
90
91
91
## Deploy the application
92
92
93
-
To deploy your application, use the [kubectl apply][kubectl-apply] command. This command parses the manifest file and creates the defined Kubernetes objects. Specify the sample manifest file, as shown in the following example:
93
+
To deploy your application, use the [`kubectl apply`][kubectl-apply] command, specifying the sample manifest file. This command parses the manifest file and creates the defined Kubernetes objects.
94
94
95
95
```console
96
96
kubectl apply -f azure-vote-all-in-one-redis.yaml
@@ -111,13 +111,13 @@ service "azure-vote-front" created
111
111
112
112
When the application runs, a Kubernetes service exposes the application front end to the internet. This process can take a few minutes to complete.
113
113
114
-
To monitor progress, use the [kubectl get service][kubectl-get] command with the `--watch` argument.
114
+
To monitor progress, use the [`kubectl get service`][kubectl-get] command with the `--watch` argument.
115
115
116
116
```console
117
117
kubectl get service azure-vote-front --watch
118
118
```
119
119
120
-
Initially the *EXTERNAL-IP* for the *azure-vote-front* service is shown as *pending*:
120
+
Initially the *EXTERNAL-IP* for the *azure-vote-front* service shows as *pending*.
To see the application in action, open a web browser to the external IP address of your service:
132
+
To see the application in action, open a web browser to the external IP address of your service.
133
133
134
134
:::image type="content" source="./media/container-service-kubernetes-tutorials/azure-vote.png" alt-text="Screenshot showing the container image Azure Voting App running in an AKS cluster opened in a local web browser" lightbox="./media/container-service-kubernetes-tutorials/azure-vote.png":::
135
135
136
-
If the application didn't load, it might be due to an authorization problem with your image registry. To view the status of your containers, use the `kubectl get pods` command. If the container images can't be pulled, see [Authenticate with Azure Container Registry from Azure Kubernetes Service](cluster-container-registry-integration.md).
136
+
If the application doesn't load, it might be an authorization problem with your image registry. To view the status of your containers, use the `kubectl get pods` command. If you can't pull the container images, see [Authenticate with Azure Container Registry from Azure Kubernetes Service](cluster-container-registry-integration.md).
137
137
138
138
## Next steps
139
139
140
-
In this tutorial, a sample Azure vote application was deployed to a Kubernetes cluster in AKS. You learned how to:
140
+
In this tutorial, you deployed a sample Azure vote application to a Kubernetes cluster in AKS. You learned how to:
141
141
142
142
> [!div class="checklist"]
143
-
> * Update a Kubernetes manifest files
144
-
> * Run an application in Kubernetes
145
-
> * Test the application
143
+
>
144
+
> * Update a Kubernetes manifest file.
145
+
> * Run an application in Kubernetes.
146
+
> * Test the application.
146
147
147
-
Advance to the next tutorial to learn how to scale a Kubernetes application and the underlying Kubernetes infrastructure.
148
+
In the next tutorial, you'll learn how to scale a Kubernetes application and the underlying Kubernetes infrastructure.
148
149
149
150
> [!div class="nextstepaction"]
150
151
> [Scale Kubernetes application and infrastructure][aks-tutorial-scale]
0 commit comments