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
- An [Azure Container Registry (ACR) registry][acr-quickstart],
39
+
- An [Azure Container Registry (ACR) registry](../container-registry/container-registry-get-started-azure-cli.md),
40
40
the ACR login server name, and the AKS cluster configured to
41
-
[authenticate with the ACR registry][acr-authentication]
41
+
[authenticate with the ACR registry](../aks/cluster-container-registry-integration.md).
42
42
43
43
- The Azure CLI version 2.0.46 or later installed and configured.
44
44
Run `az --version` to find the version. If you need to install or upgrade,
45
-
see [Install Azure CLI][install-azure-cli].
45
+
see [Install Azure CLI](/cli/azure/install-azure-cli).
46
46
47
-
-[Docker installed][docker-install] on your development system
47
+
-[Docker installed](https://docs.docker.com/install/) on your development system
48
48
49
-
- A GitHub account, [GitHub personal access token][git-access-token],
49
+
- A GitHub account, [GitHub personal access token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/),
50
50
and Git client installed on your development system
51
51
52
52
- If you provide your own Jenkins instance rather
53
53
than this sample scripted way to deploy Jenkins,
54
-
your Jenkins instance needs [Docker installed and configured][docker-install]
55
-
and [kubectl][kubectl-install].
54
+
your Jenkins instance needs [Docker installed and configured](https://docs.docker.com/install/)
55
+
and [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
56
56
57
57
## Prepare your app
58
58
@@ -81,7 +81,7 @@ To create the container images needed for the sample application, use the *docke
81
81
docker-compose up -d
82
82
```
83
83
84
-
The required base images are pulled and the application containers built. You can then use the [docker images][docker-images] command to see the created image. Three images have been downloaded or created. The `azure-vote-front` image contains the application and uses the `nginx-flask` image as a base. The `redis` image is used to start a Redis instance:
84
+
The required base images are pulled and the application containers built. You can then use the [docker images](https://docs.docker.com/engine/reference/commandline/images/) command to see the created image. Three images have been downloaded or created. The `azure-vote-front` image contains the application and uses the `nginx-flask` image as a base. The `redis` image is used to start a Redis instance:
85
85
86
86
```
87
87
$ docker images
@@ -92,13 +92,13 @@ redis latest a1b99da73d05 7 days ago
92
92
tiangolo/uwsgi-nginx-flask flask 788ca94b2313 9 months ago 694MB
93
93
```
94
94
95
-
Before you can push the *azure-vote-front* container image to ACR, get your ACR login server with the [az acr list][az-acr-list] command. The following example gets the ACR login server address for a registry in the resource group named *myResourceGroup*:
95
+
Before you can push the *azure-vote-front* container image to ACR, get your ACR login server with the [az acr list](/cli/azure/acr#az-acr-list) command. The following example gets the ACR login server address for a registry in the resource group named *myResourceGroup*:
96
96
97
97
```azurecli
98
98
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
99
99
```
100
100
101
-
Use the [docker tag][docker-tag] command to tag the image with the ACR login server name and a version number of `v1`. Provide your own `<acrLoginServer>` name obtained in the previous step:
101
+
Use the [docker tag](https://docs.docker.com/engine/reference/commandline/tag/) command to tag the image with the ACR login server name and a version number of `v1`. Provide your own `<acrLoginServer>` name obtained in the previous step:
102
102
103
103
```console
104
104
docker tag azure-vote-front <acrLoginServer>/azure-vote-front:v1
@@ -120,13 +120,13 @@ containers:
120
120
image: microsoft/azure-vote-front:v1
121
121
```
122
122
123
-
Next, use the [kubectl apply][kubectl-apply] command to deploy the application to your AKS cluster:
123
+
Next, use the [kubectl apply](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply) command to deploy the application to your AKS cluster:
124
124
125
125
```console
126
126
kubectl apply -f azure-vote-all-in-one-redis.yaml
127
127
```
128
128
129
-
A Kubernetes load balancer service is created to expose the application to the internet. This process can take a few minutes. To monitor the progress of the load balancer deployment, use the [kubectl get service][kubectl-get] command with the `--watch` argument. Once the *EXTERNAL-IP* address has changed from *pending* to an *IP address*, use `Control + C` to stop the kubectl watch process.
129
+
A Kubernetes load balancer service is created to expose the application to the internet. This process can take a few minutes. To monitor the progress of the load balancer deployment, use the [kubectl get service](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get) command with the `--watch` argument. Once the *EXTERNAL-IP* address has changed from *pending* to an *IP address*, use `Control + C` to stop the kubectl watch process.
To see the application in action, open a web browser to the external IP address of your service. The Azure vote application is displayed, as shown in the following example:
140
140
141
-

141
+

142
142
143
143
## Deploy Jenkins to an Azure VM
144
144
@@ -178,7 +178,7 @@ A Jenkins environment variable is used to hold the ACR login server name. This v
178
178
- On the left-hand side of the Jenkins portal, select **Manage Jenkins** > **Configure System**
179
179
- Under **Global Properties**, select **Environment variables**. Add a variable with the name `ACR_LOGINSERVER` and the value of your ACR login server.
- When complete, click **Save** at the bottom of the Jenkins configuration page.
184
184
@@ -188,7 +188,7 @@ To allow Jenkins to build and then push updated container images to ACR, you nee
188
188
189
189
### Create a service principal for Jenkins to use ACR
190
190
191
-
First, create a service principal using the [az ad sp create-for-rbac][az-ad-sp-create-for-rbac] command:
191
+
First, create a service principal using the [az ad sp create-for-rbac](/cli/azure/ad/sp#az-ad-sp-create-for-rbac) command:
192
192
193
193
```azurecli
194
194
$ az ad sp create-for-rbac --skip-assignment
@@ -204,7 +204,7 @@ $ az ad sp create-for-rbac --skip-assignment
204
204
205
205
Make a note of the *appId* and *password* shown in your output. These values are used in following steps to configure the credential resource in Jenkins.
206
206
207
-
Get the resource ID of your ACR registry using the [az acr show][az-acr-show] command, and store it as a variable. Provide your resource group name and ACR name:
207
+
Get the resource ID of your ACR registry using the [az acr show](/cli/azure/acr#az-acr-show) command, and store it as a variable. Provide your resource group name and ACR name:
1. Choose to add a **Build Step** of type **Execute shell** and use the following text. This script builds a new container image and pushes it to your ACR registry.
253
253
@@ -275,7 +275,7 @@ Before you automate the job based on GitHub commits, first manually test the Jen
275
275
276
276
On the left-hand menu of the project, select**Build Now**.
277
277
278
-

278
+

279
279
280
280
The first build takes a minute or two as the Docker image layers are pulled down to the Jenkins server. Subsequent builds can use the cached image layers to improve the build times.
281
281
@@ -292,7 +292,7 @@ With a successful manual build complete, now integrate GitHub into the Jenkins b
292
292
1. Choose to **Add webhook**. For the *Payload URL*, enter `http://<publicIp:8080>/github-webhook/`, where `<publicIp>` is the IP address of the Jenkins server. Make sure to include the trailing /. Leave the other defaults for content type and to trigger on *push* events.
293
293
1. Select **Add webhook**.
294
294
295
-

295
+

296
296
297
297
## Test the complete CI/CD pipeline
298
298
@@ -318,30 +318,9 @@ When updated, save the file, commit the changes, and push these to your fork of
318
318
319
319
Once the build is complete, refresh your web browser of the sample Azure vote application. Your changes are displayed, as shown in the following example:
320
320
321
-

321
+

322
322
323
323
## Next steps
324
324
325
-
In this article, you learned how to use Jenkins as part of a CI/CD solution. AKS can integrate with other CI/CD solutions and automation tools, such as the [Azure DevOps Project][azure-devops] or [creating an AKS cluster with Ansible][aks-ansible].
0 commit comments