Skip to content

Commit 57d441b

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into rolyon-rbac-roles-headings
2 parents 6ac35d2 + 6f790fb commit 57d441b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+409
-409
lines changed
Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
---
2-
title: Kubernetes on Azure tutorial - Update application
3-
description: AKS tutorial - Update Application
2+
title: Kubernetes on Azure tutorial - Update an application
3+
description: In this Azure Kubernetes Service (AKS) tutorial, you learn how to update an existing application deployment to AKS with a new version of the application code.
44
services: container-service
55
author: iainfoulds
66
manager: jeconnoc
77

88
ms.service: container-service
99
ms.topic: tutorial
10-
ms.date: 02/24/2018
10+
ms.date: 08/14/2018
1111
ms.author: iainfou
1212
ms.custom: mvc
13+
14+
#Customer intent: As a developer, I want to learn how to update an existing application deployment in an Azure Kubernetes Service (AKS) cluster so that I can maintain the application lifecycle.
1315
---
1416

1517
# Tutorial: Update an application in Azure Kubernetes Service (AKS)
1618

1719
After an application has been deployed in Kubernetes, it can be updated by specifying a new container image or image version. When doing so, the update is staged so that only a portion of the deployment is concurrently updated. This staged update enables the application to keep running during the update. It also provides a rollback mechanism if a deployment failure occurs.
1820

19-
In this tutorial, part six of seven, the sample Azure Vote app is updated. Tasks that you complete include:
21+
In this tutorial, part six of seven, the sample Azure Vote app is updated. You learn how to:
2022

2123
> [!div class="checklist"]
22-
> * Updating the front-end application code
23-
> * Creating an updated container image
24-
> * Pushing the container image to Azure Container Registry
25-
> * Deploying the updated container image
24+
> * Update the front-end application code
25+
> * Create an updated container image
26+
> * Push the container image to Azure Container Registry
27+
> * Deploy the updated container image
2628
2729
## Before you begin
2830

29-
In previous tutorials, an application was packaged into a container image, the image uploaded to Azure Container Registry, and a Kubernetes cluster created. The application was then run on the Kubernetes cluster.
30-
31-
An application repository was also cloned which includes the application source code, and a pre-created Docker Compose file used in this tutorial. Verify that you have created a clone of the repo, and that you have changed directories into the cloned directory. Inside is a directory named `azure-vote` and a file named `docker-compose.yaml`.
31+
In previous tutorials, an application was packaged into a container image, the image uploaded to Azure Container Registry (ACR), and a Kubernetes cluster created. The application was then run on the Kubernetes cluster.
3232

33-
If you haven't completed these steps, and want to follow along, return to [Tutorial 1 – Create container images][aks-tutorial-prepare-app].
33+
An application repository was also cloned that includes the application source code, and a pre-created Docker Compose file used in this tutorial. Verify that you have created a clone of the repo, and that you have changed directories into the cloned directory. If you haven't completed these steps, and want to follow along, return to [Tutorial 1 – Create container images][aks-tutorial-prepare-app].
3434

35-
## Update application
35+
This tutorial requires that you are running the Azure CLI version 2.0.44 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
3636

37-
For this tutorial, a change is made to the application, and the updated application deployed to the Kubernetes cluster.
37+
## Update an application
3838

39-
The application source code can be found inside of the `azure-vote` directory. Open the `config_file.cfg` file with any code or text editor. In this example `vi` is used.
39+
Let's make a change to the sample application, then update the version already deployed to your AKS cluster. The sample application source code can be found inside of the *azure-vote* directory. Open the *config_file.cfg* file with an editor, such as `vi`:
4040

4141
```console
4242
vi azure-vote/azure-vote/config_file.cfg
4343
```
4444

45-
Change the values for `VOTE1VALUE` and `VOTE2VALUE`, and then save the file.
45+
Change the values for *VOTE1VALUE* and *VOTE2VALUE* to different colors. The following example shows the updated color values:
4646

47-
```console
47+
```
4848
# UI Configurations
4949
TITLE = 'Azure Voting App'
5050
VOTE1VALUE = 'Blue'
@@ -54,112 +54,109 @@ SHOWHOST = 'false'
5454

5555
Save and close the file.
5656

57-
## Update container image
57+
## Update the container image
5858

59-
Use [docker-compose][docker-compose] to re-create the front-end image and run the updated application. The `--build` argument is used to instruct Docker Compose to re-create the application image.
59+
To re-create the front-end image and test the updated application, use [docker-compose][docker-compose]. The `--build` argument is used to instruct Docker Compose to re-create the application image:
6060

6161
```console
6262
docker-compose up --build -d
6363
```
6464

65-
## Test application locally
65+
## Test the application locally
6666

67-
Browse to http://localhost:8080 to see the updated application.
67+
To verify that the updated container image shows your changes, open a local web browser to http://localhost:8080.
6868

6969
![Image of Kubernetes cluster on Azure](media/container-service-kubernetes-tutorials/vote-app-updated.png)
7070

71-
## Tag and push images
71+
The updated color values provided in the *config_file.cfg* file are displayed on your running application.
7272

73-
Tag the `azure-vote-front` image with the loginServer of the container registry.
73+
## Tag and push the image
7474

75-
Get the login server name with the [az acr list](/cli/azure/acr#az-acr-list) command.
75+
To correctly use the updated image, tag the *azure-vote-front* image with the login server name of your ACR registry. Get the login server name with the [az acr list](/cli/azure/acr#az_acr_list) command:
7676

7777
```azurecli
7878
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
7979
```
8080

81-
Use [docker tag][docker-tag] to tag the image. Replace `<acrLoginServer>` with your Azure Container Registry login server name or public registry hostname. Also notice that the image version is updated to `v2`.
81+
Use [docker tag][docker-tag] to tag the image. Replace `<acrLoginServer>` with your ACR login server name or public registry hostname, and update the image version to *:v2* as follows:
8282

8383
```console
8484
docker tag azure-vote-front <acrLoginServer>/azure-vote-front:v2
8585
```
8686

87-
Use [docker push][docker-push] to upload the image to your registry. Replace `<acrLoginServer>` with your Azure Container Registry login server name. If you experience issues pushing to your ACR registry, ensure that you have run the [az acr login][az-acr-login] command.
87+
Now use [docker push][docker-push] to upload the image to your registry. Replace `<acrLoginServer>` with your ACR login server name. If you experience issues pushing to your ACR registry, ensure that you have run the [az acr login][az-acr-login] command.
8888

8989
```console
9090
docker push <acrLoginServer>/azure-vote-front:v2
9191
```
9292

93-
## Deploy update application
93+
## Deploy the updated application
9494

95-
To ensure maximum uptime, multiple instances of the application pod must be running. Verify this configuration with the [kubectl get pod][kubectl-get] command.
95+
To ensure maximum uptime, multiple instances of the application pod must be running. Verify the number of running front-end instances with the [kubectl get pods][kubectl-get] command:
9696

9797
```
98-
kubectl get pod
99-
```
98+
$ kubectl get pods
10099
101-
Output:
102-
103-
```
104100
NAME READY STATUS RESTARTS AGE
105101
azure-vote-back-217588096-5w632 1/1 Running 0 10m
106102
azure-vote-front-233282510-b5pkz 1/1 Running 0 10m
107103
azure-vote-front-233282510-dhrtr 1/1 Running 0 10m
108104
azure-vote-front-233282510-pqbfk 1/1 Running 0 10m
109105
```
110106

111-
If you do not have multiple pods running the azure-vote-front image, scale the `azure-vote-front` deployment.
107+
If you do not have multiple front-end pods, scale the *azure-vote-front* deployment as follows:
112108

113-
114-
```azurecli
109+
```console
115110
kubectl scale --replicas=3 deployment/azure-vote-front
116111
```
117112

118-
To update the application, use the [kubectl set][kubectl-set] command. Update `<acrLoginServer>` with the login server or host name of your container registry.
113+
To update the application, use the [kubectl set][kubectl-set] command. Update `<acrLoginServer>` with the login server or host name of your container registry, and specify the *v2* application version:
119114

120-
```azurecli
115+
```console
121116
kubectl set image deployment azure-vote-front azure-vote-front=<acrLoginServer>/azure-vote-front:v2
122117
```
123118

124119
To monitor the deployment, use the [kubectl get pod][kubectl-get] command. As the updated application is deployed, your pods are terminated and re-created with the new container image.
125120

126-
```azurecli
127-
kubectl get pod
121+
```console
122+
kubectl get pods
128123
```
129124

130-
Output:
125+
The following example output shows pods terminating and new instances running as the deployment progresses:
131126

132127
```
128+
$ kubectl get pods
129+
133130
NAME READY STATUS RESTARTS AGE
134131
azure-vote-back-2978095810-gq9g0 1/1 Running 0 5m
135132
azure-vote-front-1297194256-tpjlg 1/1 Running 0 1m
136133
azure-vote-front-1297194256-tptnx 1/1 Running 0 5m
137134
azure-vote-front-1297194256-zktw9 1/1 Terminating 0 1m
138135
```
139136

140-
## Test updated application
137+
## Test the updated application
141138

142-
Get the external IP address of the `azure-vote-front` service.
139+
To view the update application, first get the external IP address of the `azure-vote-front` service:
143140

144-
```azurecli
141+
```console
145142
kubectl get service azure-vote-front
146143
```
147144

148-
Browse to the IP address to see the updated application.
145+
Now open a local web browser to the IP address.
149146

150147
![Image of Kubernetes cluster on Azure](media/container-service-kubernetes-tutorials/vote-app-updated-external.png)
151148

152149
## Next steps
153150

154-
In this tutorial, you updated an application and rolled out this update to a Kubernetes cluster. The following tasks were completed:
151+
In this tutorial, you updated an application and rolled out this update to a Kubernetes cluster. You learned how to:
155152

156153
> [!div class="checklist"]
157-
> * Updated the front-end application code
158-
> * Created an updated container image
159-
> * Pushed the container image to Azure Container Registry
160-
> * Deployed the updated application
154+
> * Update the front-end application code
155+
> * Create an updated container image
156+
> * Push the container image to Azure Container Registry
157+
> * Deploy the updated container image
161158
162-
Advance to the next tutorial to learn about upgrading Kubernetes to a new version.
159+
Advance to the next tutorial to learn how to upgrade an AKS cluster to a new version of Kubernetes.
163160

164161
> [!div class="nextstepaction"]
165162
> [Upgrade Kubernetes][aks-tutorial-upgrade]
@@ -174,4 +171,5 @@ Advance to the next tutorial to learn about upgrading Kubernetes to a new versio
174171
<!-- LINKS - internal -->
175172
[aks-tutorial-prepare-app]: ./tutorial-kubernetes-prepare-app.md
176173
[aks-tutorial-upgrade]: ./tutorial-kubernetes-upgrade-cluster.md
177-
[az-acr-login]: https://docs.microsoft.com/cli/azure/acr#az-acr-login
174+
[az-acr-login]: /cli/azure/acr#az_acr_login
175+
[azure-cli-install]: /cli/azure/install-azure-cli
Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
---
2-
title: Kubernetes on Azure tutorial - Deploy Application
3-
description: AKS tutorial - Deploy Application
2+
title: Kubernetes on Azure tutorial - Deploy an application
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.
44
services: container-service
55
author: iainfoulds
66
manager: jeconnoc
77

88
ms.service: container-service
99
ms.topic: tutorial
10-
ms.date: 02/22/2018
10+
ms.date: 08/14/2018
1111
ms.author: iainfou
1212
ms.custom: mvc
13+
14+
#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.
1315
---
1416

1517
# Tutorial: Run applications in Azure Kubernetes Service (AKS)
1618

17-
In this tutorial, part four of seven, a sample application is deployed into a Kubernetes cluster. Steps completed include:
19+
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:
1820

1921
> [!div class="checklist"]
20-
> * Update Kubernetes manifest files
21-
> * Run application in Kubernetes
22+
> * Update a Kubernetes manifest files
23+
> * Run an application in Kubernetes
2224
> * Test the application
2325
2426
In subsequent tutorials, this application is scaled out and updated.
@@ -29,35 +31,35 @@ This tutorial assumes a basic understanding of Kubernetes concepts, for detailed
2931

3032
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.
3133

32-
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 have cloned the repo, and that you have changed directories into the cloned repo.
34+
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 have cloned the repo, and that you have changed directories into the cloned repo. If you have not done these steps, and would like to follow along, return to [Tutorial 1 – Create container images][aks-tutorial-prepare-app].
3335

34-
If you have not done these steps, and would like to follow along, return to [Tutorial 1 – Create container images][aks-tutorial-prepare-app].
36+
This tutorial requires that you are running the Azure CLI version 2.0.44 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
3537

36-
## Update manifest file
38+
## Update the manifest file
3739

38-
In this tutorial, Azure Container Registry (ACR) has been used to store a container image. Before running the application, the ACR login server name needs to be updated in the Kubernetes manifest file.
40+
In these tutorials, an Azure Container Registry (ACR) instance stores the container image for the sample application. To deploy the application, you must update the image name in the Kubernetes manifest file to include the ACR login server name.
3941

40-
Get the ACR login server name with the [az acr list][az-acr-list] command.
42+
Get the ACR login server name using the [az acr list][az-acr-list] command as follows:
4143

4244
```azurecli
4345
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
4446
```
4547

46-
The manifest file has been pre-created with a login server name of `microsoft`. Open the file with any text editor. In this example, the file is opened with `nano`.
48+
The sample manifest file from the git repo cloned in the first tutorial uses the login server name of *microsoft*. Open this manifest file with a text editor, such as `vi`:
4749

4850
```console
49-
nano azure-vote-all-in-one-redis.yaml
51+
vi azure-vote-all-in-one-redis.yaml
5052
```
5153

52-
Replace `microsoft` with the ACR login server name. This value is found on line **47** of the manifest file.
54+
Replace *microsoft* with your ACR login server name. The image name is found on line 47 of the manifest file. The following example shows the default image name:
5355

5456
```yaml
5557
containers:
5658
- name: azure-vote-front
5759
image: microsoft/azure-vote-front:v1
5860
```
5961
60-
The above code then becomes.
62+
Provide your own ACR login server name so that your manifest file looks like the following example:
6163
6264
```yaml
6365
containers:
@@ -67,63 +69,61 @@ containers:
6769
6870
Save and close the file.
6971
70-
## Deploy application
72+
## Deploy the application
7173
72-
Use the [kubectl apply][kubectl-apply] command to run the application. This command parses the manifest file and creates the defined Kubernetes objects.
74+
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:
7375
74-
```azurecli
76+
```console
7577
kubectl apply -f azure-vote-all-in-one-redis.yaml
7678
```
7779

78-
Output:
80+
The Kubernetes objects are created within the cluster, as shown in the following example:
7981

8082
```
83+
$ kubectl apply -f azure-vote-all-in-one-redis.yaml
84+
8185
deployment "azure-vote-back" created
8286
service "azure-vote-back" created
8387
deployment "azure-vote-front" created
8488
service "azure-vote-front" created
8589
```
8690

87-
## Test application
88-
89-
A [Kubernetes service][kubernetes-service] is created which exposes the application to the internet. This process can take a few minutes.
91+
## Test the application
9092

91-
To monitor progress, use the [kubectl get service][kubectl-get] command with the `--watch` argument.
93+
A [Kubernetes service][kubernetes-service] is created which exposes the application to the internet. This process can take a few minutes. To monitor progress, use the [kubectl get service][kubectl-get] command with the `--watch` argument:
9294

93-
```azurecli
95+
```console
9496
kubectl get service azure-vote-front --watch
9597
```
9698

97-
Initially the *EXTERNAL-IP* for the *azure-vote-front* service appears as *pending*.
99+
The *EXTERNAL-IP* for the *azure-vote-front* service initially appears as *pending*, as shown in the following example:
98100

99101
```
100102
azure-vote-front 10.0.34.242 <pending> 80:30676/TCP 7s
101103
```
102104

103-
Once the *EXTERNAL-IP* address has changed from *pending* to an *IP address*, use `CTRL-C` to stop the kubectl watch process.
105+
When the *EXTERNAL-IP* address changes from *pending* to an actual public IP address, use `CTRL-C` to stop the kubectl watch process. The following example shows a public IP address is now assigned:
104106

105107
```
106108
azure-vote-front 10.0.34.242 52.179.23.131 80:30676/TCP 2m
107109
```
108110

109-
To see the application, browse to the external IP address.
111+
To see the application in action, open a web browser to the external IP address.
110112

111113
![Image of Kubernetes cluster on Azure](media/container-service-kubernetes-tutorials/azure-vote.png)
112114

113-
If the application did not load, it might be due to an authorization problem with your image registry.
114-
115-
Please follow these steps to [allow access via a Kubernetes secret](https://docs.microsoft.com/azure/container-registry/container-registry-auth-aks#access-with-kubernetes-secret).
115+
If the application did not 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 cannot be pulled, see [allow access to Container Registry with a Kubernetes secret](https://docs.microsoft.com/azure/container-registry/container-registry-auth-aks#access-with-kubernetes-secret).
116116

117117
## Next steps
118118

119-
In this tutorial, the Azure vote application was deployed to a Kubernetes cluster in AKS. Tasks completed include:
119+
In this tutorial, the Azure vote application was deployed to a Kubernetes cluster in AKS. You learned how to:
120120

121121
> [!div class="checklist"]
122-
> * Download Kubernetes manifest files
123-
> * Run the application in Kubernetes
124-
> * Tested the application
122+
> * Update a Kubernetes manifest files
123+
> * Run an application in Kubernetes
124+
> * Test the application
125125
126-
Advance to the next tutorial to learn about scaling both a Kubernetes application and the underlying Kubernetes infrastructure.
126+
Advance to the next tutorial to learn how to scale a Kubernetes application and the underlying Kubernetes infrastructure.
127127

128128
> [!div class="nextstepaction"]
129129
> [Scale Kubernetes application and infrastructure][aks-tutorial-scale]
@@ -139,3 +139,4 @@ Advance to the next tutorial to learn about scaling both a Kubernetes applicatio
139139
[aks-tutorial-prepare-app]: ./tutorial-kubernetes-prepare-app.md
140140
[aks-tutorial-scale]: ./tutorial-kubernetes-scale.md
141141
[az-acr-list]: /cli/azure/acr#list
142+
[azure-cli-install]: /cli/azure/install-azure-cli

0 commit comments

Comments
 (0)