Skip to content

Commit bf6c173

Browse files
Merge pull request #2520 from madeline-underwood/azure
AKS_JA to sign off
2 parents 590c44b + b9a3929 commit bf6c173

File tree

9 files changed

+187
-142
lines changed

9 files changed

+187
-142
lines changed

content/learning-paths/servers-and-cloud-computing/multiarch_nginx_on_aks/_index.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
---
2-
title: Build hybrid AKS clusters with Arm nodes and nginx
3-
4-
draft: true
5-
cascade:
6-
draft: true
2+
title: Build a multi-architecture Kubernetes cluster running nginx on Azure AKS
73

84
minutes_to_complete: 60
95

10-
who_is_this_for: This Learning Path is for developers who want to understand nginx performance on x64 and arm64 deployments by running a hybrid Azure Kubernetes Service (AKS) cluster.
6+
who_is_this_for: This is an introductory topic for developers who want to deploy multi-architecture Kubernetes workloads and compare nginx performance between x86 and Arm-based nodes in Azure Kubernetes Service (AKS) clusters.
117

128
learning_objectives:
13-
- Create a hybrid AKS cluster with x64 and arm64 nodes
14-
- Deploy nginx's multi-architecture container image, pods, and services to the AKS cluster
15-
- Smoke test nginx from each architecture in the cluster to verify proper installation
16-
- Test the performance of each architecture in the cluster
17-
- Apply the same process to other kubernetes workloads
9+
- Create a hybrid AKS cluster with both x86 and Arm64 nodes
10+
- Deploy nginx using multi-architecture container images across different node types
11+
- Verify nginx deployment and functionality on each architecture
12+
- Compare performance between x86 and Arm64 nginx instances
13+
- Learn techniques for deploying multi-architecture Kubernetes workloads
1814

1915

2016
prerequisites:
21-
- An [Azure account](https://azure.microsoft.com/en-us/free/).
22-
- A local machine with [jq](https://jqlang.org/download/), [curl](https://curl.se/download.html), [wrk](https://github.com/wg/wrk), [Azure CLI](/install-guides/azure-cli/) and [kubectl](/install-guides/kubectl/) installed.
17+
- An [Azure account](https://azure.microsoft.com/en-us/free/)
18+
- A local machine with [`jq`](https://jqlang.org/download/), [`curl`](https://curl.se/download.html), [`wrk`](https://github.com/wg/wrk), [Azure CLI](/install-guides/azure-cli/), and [`kubectl`](/install-guides/kubectl/) installed
2319

2420
author:
2521
- Geremy Cohen
@@ -39,22 +35,28 @@ operatingsystems:
3935
tools_software_languages:
4036
- nginx
4137
- Web Server
38+
- Azure
39+
- Kubernetes
4240

4341
further_reading:
4442
- resource:
45-
title: nginx - High Performance Load Balancer, Web Server, & Reverse Proxy
43+
title: nginx website
4644
link: https://nginx.org/
47-
type: documentation
45+
type: website
4846
- resource:
49-
title: nginx Docker Hub
47+
title: nginx on Docker Hub
5048
link: https://hub.docker.com/_/nginx
5149
type: documentation
5250
- resource:
5351
title: Azure Kubernetes Service (AKS) documentation
5452
link: https://docs.microsoft.com/en-us/azure/aks/
5553
type: documentation
5654
- resource:
57-
title: Learn how to tune Nginx
55+
title: Learn how to deploy nginx [Arm Learning Path]
56+
link: https://learn.arm.com/learning-paths/servers-and-cloud-computing/nginx/
57+
type: documentation
58+
- resource:
59+
title: Learn how to tune nginx [Arm Learning Path]
5860
link: https://learn.arm.com/learning-paths/servers-and-cloud-computing/nginx_tune/
5961
type: documentation
6062

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---

content/learning-paths/servers-and-cloud-computing/multiarch_nginx_on_aks/apply-configuration.md

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
---
22
title: Monitor performance with wrk and btop
3-
weight: 70
3+
weight: 9
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

99
## Install btop monitoring tool on nginx pods
1010

11-
Now that you have all your nginx deployments running across Intel and Arm architectures, you can monitor performance across each architecture using wrk to generate load and btop to monitor system performance.
11+
Now that you have all your nginx deployments running across Intel and Arm architectures, you can monitor performance across each architecture using `wrk` to generate load and `btop` to monitor system performance.
1212

1313
{{% notice Note %}}
14-
This tutorial uses [wrk](https://github.com/wg/wrk) to generate load, which is readily available on apt and brew package managers. [wrk2](https://github.com/giltene/wrk2) is a modern fork of wrk with additional features. wrk was chosen for this tutorial due to its ease of installation, but if you prefer to install and use wrk2 (or other http load generators) for your testing, feel free to do so.
15-
{{% /notice %}}
16-
17-
### Install btop and apply optimized configuration
14+
This Learning Path uses [`wrk`](https://github.com/wg/wrk) to generate HTTP load testing. You can easily install `wrk` using `apt` or `brew` package managers.
1815

19-
The `nginx_util.sh` script includes a `put config` command that will:
16+
If you prefer alternatives like [`wrk2`](https://github.com/giltene/wrk2) (a modern fork with additional features) or other HTTP load generators, you can use those instead.
17+
{{% /notice %}}
2018

21-
- Apply a performance-optimized nginx configuration to all pods
22-
- Install btop monitoring tool on all pods for system monitoring
23-
- Restart pods with the new configuration
19+
## Install btop and apply optimized configuration
2420

2521
Run the following command to apply the configuration updates:
2622

@@ -41,7 +37,14 @@ Installing btop on nginx-intel-deployment-6f5bff9667-zdrqc...
4137
✅ btop installed on all pods!
4238
```
4339

44-
### Check pod restart status
40+
The `nginx_util.sh` script includes a `put config` command that:
41+
42+
- Applies a performance-optimized nginx configuration to all pods
43+
- Installs `btop` monitoring tool on all pods for system monitoring
44+
- Restarts pods with the new configuration
45+
46+
47+
## Check pod restart status
4548

4649
Check that all pods have restarted with the new configuration:
4750

@@ -52,26 +55,26 @@ kubectl get pods -n nginx
5255
You should see all pods with recent restart times.
5356

5457
{{% notice Note %}}
55-
Because pods are ephemeral, btop will need to be reinstalled if the pods are deleted or restarted. If you get an error saying btop is not found, rerun the `./nginx_util.sh put btop` command to reinstall it.
58+
Because pods are ephemeral, you need to reinstall `btop` if pods restart or get deleted. If you see a "btop not found" error, run `./nginx_util.sh put btop` again to reinstall it.
5659
{{% /notice %}}
5760

5861

59-
### Set up real-time performance monitoring
60-
61-
You can now log in to any pod and use btop to monitor system performance. There are many variables that can affect an individual workload's performance, and btop (like top) is a great first step in understanding those variables.
62+
## Set up real-time performance monitoring
63+
You can now log in to any pod and monitor system performance with `btop`. Many factors can affect workload performance, and `btop` (like `top`) is an excellent starting point for understanding these metrics.
6264

6365
{{% notice Note %}}
64-
When performing load generation tests from your laptop, local system and network settings may interfere with proper load generation between your machine and the remote cluster services. To mitigate these issues, it's suggested to install the `nginx_util.sh` script on a [remote Azure instance](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/azure/) in the same region and zone as your K8s cluster for best results. If you aren't seeing at least 70K+ requests/s to either K8s service endpoint, switching to a better located system is advised.
65-
{{% /notice %}}
66+
Network performance can impact load testing accuracy when running from your local machine. If you experience low request rates (under 70,000 requests/s), consider running the test from an Azure VM in the same region as your cluster.
67+
68+
You can create an [Azure VM instance](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/azure/) and install the `nginx_util.sh` script there for more reliable results.{{% /notice %}}
6669

6770
Running two btop terminals, one for each pod, is a convenient way to view performance in real time.
6871

69-
To bring up btop on both Arm and Intel pods:
72+
To bring up btop on both Arm and Intel pods, follow these steps:
7073

71-
1. Open two new terminal windows
72-
2. In one terminal, run `login arm` from the nginx utility script to enter the pod
73-
3. In the second terminal, run `login intel` from the nginx utility script to enter the pod
74-
4. Once inside each pod, run btop to see real-time system monitoring
74+
- Open two new terminal windows
75+
- In one terminal, run `login arm` from the nginx utility script to enter the pod
76+
- In the second terminal, run `login intel` from the `nginx` utility script to enter the pod
77+
- Once inside each pod, run `btop` to see real-time system monitoring
7578

7679
The commands are shown below.
7780

@@ -95,25 +98,28 @@ btop --utf-force
9598

9699
You should now see something similar to the image below, with one terminal for each Arm and Intel pod running btop:
97100

98-
![Project Overview](images/btop_idle.png)
101+
![Two terminal windows displaying btop system monitoring interface with CPU, memory, and process information for nginx pods running on different architectures in an idle state alt-text#center](images/btop_idle.png)
99102

100-
To visualize performance with btop against the Arm and Intel pods via the load balancer service endpoints, you can use the `nginx_util.sh` wrapper to generate load to both simultaneously:
103+
To visualize performance with btop against the Arm and Intel pods using the load balancer service endpoints, you can use the `nginx_util.sh` wrapper to generate load to both simultaneously:
101104

102105
```bash
103106
./nginx_util.sh wrk both
104107
```
105108

106-
This runs wrk with predefined settings (1 thread, 50 simultaneous connections) to generate load to the K8s architecture-specific endpoints.
109+
This runs `wrk` with predefined settings (1 thread, 50 simultaneous connections) to generate load to the K8s architecture-specific endpoints.
107110

108-
While it runs (for a default of 30s), you can observe some performance characteristics from the btop outputs:
111+
While it runs (for a default of 30s), you can observe some performance characteristics from the `btop` outputs:
109112

110-
![Project Overview](images/under_load.png)
113+
![Two terminal windows showing btop system monitoring during load testing, comparing nginx performance between Arm and Intel architectures with CPU and memory metrics highlighted alt-text#center](images/under_load.png)
111114

112-
Of particular interest is memory and CPU resource usage per pod. For Intel, red marker 1 shows memory usage for the process, and red marker 2 shows total CPU usage.
115+
You can observe several performance characteristics from the btop outputs during load testing. Pay attention to the memory and CPU resource usage for each pod:
113116

114-
Red markers 3 and 4 show the same metrics for Arm.
117+
- Intel pod metrics: Memory usage (marker 1) and total CPU usage (marker 2)
118+
- Arm pod metrics: Memory usage (marker 3) and total CPU usage (marker 4)
115119

116-
![Project Overview](images/mem_and_cpu.png)
120+
These real-time metrics help you compare how each architecture handles the load and resource consumption patterns.
121+
122+
![Two terminal windows showing btop system monitoring interface displaying CPU usage graphs and memory statistics while nginx pods run under load testing, comparing performance between Intel and Arm architectures with numerical markers highlighting specific CPU and memory metrics for analysis alt-text#center](images/mem_and_cpu.png)
117123

118124
In addition to the visual metrics, the script also returns runtime results including requests per second and latencies:
119125

@@ -169,15 +175,13 @@ For example, to generate load using 500 connections across 4 threads to the Arm
169175
wrk -t4 -c500 -d300 http://20.252.73.72/
170176
```
171177

172-
## Next Steps
173-
174-
You have learned how to run a sample nginx workload on a dual-architecture (Arm and Intel) Azure Kubernetes Service.
178+
## What you've accomplished and what's next
175179

176-
You learned how to generate load with the wrk utility and monitor runtime metrics with btop.
180+
You have successfully deployed and monitored `nginx` workloads across both Arm and Intel architectures on Azure Kubernetes Service. You've learned how to generate load with `wrk`, monitor real-time performance with `btop`, and compare performance characteristics between different architectures.
177181

178-
Here are some ideas for further exploration:
182+
You now have the knowledge to experiment with your own workloads on Arm-based AKS nodes to identify performance and efficiency opportunities unique to your own environments. Here are some ideas for further exploration:
179183

180184
* What do the performance curves look like between the two architectures as a function of load?
181185
* How do larger instance types scale versus smaller ones?
182186

183-
You now have the knowledge to experiment with your own workloads on Arm-based AKS nodes to identify performance and efficiency opportunities unique to your own environments.
187+
Congratulations on completing this Learning Path! You've built a solid foundation for deploying and optimizing multi-architecture Kubernetes workloads on Azure, positioning yourself to take full advantage of Arm's performance and cost benefits in your cloud infrastructure.

content/learning-paths/servers-and-cloud-computing/multiarch_nginx_on_aks/create-test-utility.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
---
22
title: Create the test utility
3-
weight: 20
3+
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Test utility script
9+
## Understand the utility script’s purpose
1010

11-
In this section, you'll create a utility script to test and manage your nginx services across both architectures. The script will be used throughout the Learning Path to test services, apply configurations, and access pods.
11+
In this section, you'll create a utility script that simplifies working with your multi-architecture Kubernetes deployment. This script acts as a convenient wrapper around common kubectl and testing commands, making it easier to interact with nginx pods across different architectures.
1212

13-
### Script functionality
13+
Instead of typing long kubectl commands repeatedly, you'll use this utility to quickly test services, monitor performance, and access pods on both Arm and Intel nodes. This approach saves time and reduces errors, especially when comparing behavior across architectures.
1414

15-
The `nginx_util.sh` script provides three main functions:
15+
By the end of this section, you'll have a ready-to-use tool that streamlines the testing and monitoring tasks you'll perform throughout the rest of this Learning Path.
1616

17-
- **`curl intel|arm|multiarch`** - Test nginx services and show which pod served the request
18-
- **`put btop`** - Install btop monitoring tool on all pods
19-
- **`login intel|arm`** - Interactive bash access to architecture-specific pods
17+
## Get to know the utility script
18+
The utility script provides three main functions to help you work with your multi-architecture nginx deployment. You can use it to test services across different architectures, monitor performance, and access pods directly.
19+
20+
The script provides the following key commands to interact with your nginx deployment:
21+
22+
- `curl intel|arm|multiarch` tests nginx services and show which pod served the request
23+
- `put btop` installs btop monitoring tool on all pods
24+
- `login intel|arm` is an interactive bash access to architecture-specific pods
25+
26+
These commands streamline common tasks you'll perform when working with multi-architecture deployments. The `curl` command helps you verify that requests are being properly distributed across different architectures, while the `login` command gives you direct access to pods for debugging or configuration changes.
2027

2128
The script conveniently bundles test and logging commands into a single place, making it easy to test, troubleshoot, and view services.
2229

23-
### Download the utility script
30+
## Download the utility script
2431

2532
{{% notice Note %}}
2633
The following utility `nginx_util.sh` is provided for your convenience.
2734

28-
It's a wrapper for kubectl and other commands, utilizing [curl](https://curl.se/). Make sure you have curl installed before running.
35+
It's a wrapper for `kubectl` and other commands, utilizing [curl](https://curl.se/). Make sure you have curl installed before running.
2936

30-
You can click on the link below to review the code before downloading.
37+
You can review the code before downloading by visiting the [GitHub repository](https://raw.githubusercontent.com/geremyCohen/nginxOnAKS/refs/heads/main/nginx_util.sh).
3138
{{% /notice %}}
3239

3340
Copy and paste the following commands into a terminal to download and create the `nginx_util.sh` script:
@@ -37,13 +44,12 @@ curl -o nginx_util.sh https://raw.githubusercontent.com/geremyCohen/nginxOnAKS/r
3744
chmod +x nginx_util.sh
3845
```
3946

40-
In the folder you ran the curl command, you should now see the `nginx_util.sh` script. Test it by running:
47+
In the folder you ran the `curl` command, you should now see the `nginx_util.sh` script. Test it by running:
4148

4249
```bash
4350
./nginx_util.sh
4451
```
45-
46-
The output presents the usage instructions:
52+
The script displays its usage instructions:
4753

4854
```output
4955
Invalid first argument. Use 'curl', 'wrk', 'put', or 'login'.

0 commit comments

Comments
 (0)