Skip to content

Commit ba20ce7

Browse files
committed
Update chapter 3: Add ConfigMap, fix nodeSelector, update outputs, add service selector explanation, remove AMD references
1 parent 5027344 commit ba20ce7

1 file changed

Lines changed: 62 additions & 44 deletions

File tree

  • content/learning-paths/servers-and-cloud-computing/multiarch_nginx_on_aks

content/learning-paths/servers-and-cloud-computing/multiarch_nginx_on_aks/3-deploy-arm.md

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ layout: learningpathall
88

99
## Add ARM deployment and service
1010

11-
In this section, you'll add nginx on ARM nodes to your existing cluster, completing your multi-architecture Intel/AMD/ARM environment for comprehensive performance comparison.
11+
In this section, you'll add nginx on ARM nodes to your existing cluster, completing your multi-architecture Intel/ARM environment for comprehensive performance comparison.
12+
13+
The **arm_nginx.yaml** file creates the following K8s objects:
14+
- **ConfigMap** (`nginx-arm-config`) - Contains performance-optimized nginx configuration with ARM-specific tuning
15+
- **Deployment** (`nginx-arm-deployment`) - Pulls the multi-architecture nginx image from DockerHub, launches a pod on the ARM node, and mounts the ConfigMap as `/etc/nginx/nginx.conf`
16+
- **Service** (`nginx-arm-svc`) - Load balancer targeting pods with both `app: nginx-multiarch` and `arch: arm` labels
1217

1318
Copy and paste the following commands into a terminal to download and apply the ARM deployment and service:
1419

@@ -17,93 +22,106 @@ curl -o arm_nginx.yaml https://raw.githubusercontent.com/geremyCohen/nginxOnAKS/
1722
kubectl apply -f arm_nginx.yaml
1823
```
1924

20-
When pasted into your terminal, you will see output similar to the following for each command:
25+
You will see output similar to:
2126

2227
```output
23-
curl -o arm_nginx.yaml https://raw.githubusercontent.com/geremyCohen/nginxOnAKS/refs/heads/main/arm_nginx.yaml
24-
kubectl apply -f arm_nginx.yaml
25-
% Total % Received % Xferd Average Speed Time Time Time Current
26-
Dload Upload Total Spent Left Speed
27-
100 739 100 739 0 0 15192 0 --:--:-- --:--:-- --:--:-- 15306
28+
configmap/nginx-arm-config created
2829
deployment.apps/nginx-arm-deployment created
2930
service/nginx-arm-svc created
3031
```
3132

32-
When the above is applied:
33+
### Examining the deployment configuration
34+
35+
Taking a closer look at the `arm_nginx.yaml` deployment file, you'll see settings optimized for ARM architecture:
36+
37+
* The `nodeSelector` `kubernetes.io/arch: arm64`. This ensures that the deployment only runs on ARM nodes, utilizing the arm64 version of the nginx container image.
3338

34-
* A new deployment called `nginx-arm-deployment` is created. This deployment pulls the same multi-architecture nginx image from DockerHub.
39+
```yaml
40+
spec:
41+
nodeSelector:
42+
kubernetes.io/arch: arm64
43+
```
44+
45+
* The service selector uses both `app: nginx-multiarch` and `arch: arm` labels to target only ARM pods. This dual-label approach allows for both architecture-specific and multi-architecture service routing.
46+
47+
```yaml
48+
selector:
49+
app: nginx-multiarch
50+
arch: arm
51+
```
3552

36-
Of particular interest is the `nodeSelector` `agentpool`, with the value of `arm`. This ensures that the deployment only runs on ARM nodes, utilizing the arm64 version of the nginx container image.
53+
* The ARM ConfigMap includes performance optimizations specific to ARM architecture, such as `worker_processes 2` and `worker_cpu_affinity 01 10` for optimal CPU core utilization.
3754

38-
* A new load balancer service `nginx-arm-svc` is created, targeting all pods with the `arch: arm` label (the ARM deployment creates these pods).
55+
### Verify the deployment
3956

40-
### Apply the ARM deployment and service
57+
### Verify the deployment
4158

42-
1. Run the following command to apply the ARM deployment and service:
59+
1. Get the status of nodes, pods and services by running:
4360

4461
```bash
45-
kubectl apply -f arm_nginx.yaml
62+
kubectl get nodes,pods,svc -nnginx
4663
```
4764

48-
You see the following response:
65+
Your output should be similar to the following, showing two nodes, two pods, and two services:
4966

5067
```output
51-
deployment.apps/nginx-arm-deployment created
52-
service/nginx-arm-svc created
68+
NAME STATUS ROLES AGE VERSION
69+
node/aks-arm-56500727-vmss000000 Ready <none> 59m v1.32.7
70+
node/aks-intel-31372303-vmss000000 Ready <none> 63m v1.32.7
71+
72+
NAME READY STATUS RESTARTS AGE
73+
pod/nginx-arm-deployment-5bf8df95db-wznff 1/1 Running 0 36s
74+
pod/nginx-intel-deployment-78bb8885fd-mw24f 1/1 Running 0 9m21s
75+
76+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
77+
service/nginx-arm-svc LoadBalancer 10.0.241.154 48.192.64.197 80:30082/TCP 36s
78+
service/nginx-intel-svc LoadBalancer 10.0.226.250 20.80.128.191 80:30080/TCP 9m22s
5379
```
5480

55-
2. Get the status of nodes, pods and services by running:
81+
You can also verify the ConfigMap was created:
5682

5783
```bash
58-
kubectl get nodes,pods,svc -nnginx
84+
kubectl get configmap -nnginx
5985
```
6086

61-
Your output should be similar to the following, showing three nodes, three pods, and three services:
62-
6387
```output
64-
NAME STATUS ROLES AGE VERSION
65-
node/aks-amd-10099357-vmss000000 Ready <none> 60m v1.32.7
66-
node/aks-arm-49028967-vmss000000 Ready <none> 62m v1.32.7
67-
node/aks-intel-34846084-vmss000000 Ready <none> 65m v1.32.7
68-
69-
NAME READY STATUS RESTARTS AGE
70-
pod/nginx-amd-deployment-7d4c8f9b-abc34 1/1 Running 0 17m
71-
pod/nginx-arm-deployment-6f8d9c2a-def56 1/1 Running 0 2m
72-
pod/nginx-intel-deployment-dc84dc59f-7qb72 1/1 Running 0 30m
73-
74-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
75-
service/nginx-amd-svc LoadBalancer 10.0.67.234 20.4.5.6 80:30081/TCP 17m
76-
service/nginx-arm-svc LoadBalancer 10.0.89.145 20.7.8.9 80:30082/TCP 2m
77-
service/nginx-intel-svc LoadBalancer 10.0.45.123 20.1.2.3 80:30080/TCP 30m
88+
NAME DATA AGE
89+
nginx-arm-config 1 51s
90+
nginx-intel-config 1 10m
7891
```
7992

8093
When the pods show `Running` and the service shows a valid `External IP`, you're ready to test the nginx ARM service.
8194

8295
### Test the nginx web service on ARM
8396

84-
3. Run the following to make an HTTP request to the ARM nginx service using the script you created earlier:
97+
2. Run the following to make an HTTP request to the ARM nginx service using the script you created earlier:
8598

8699
```bash
87100
./nginx_util.sh get arm
88101
```
89102

90-
You get back the HTTP response, as well as the log line from the ARM pod that served it:
103+
You get back the HTTP response, as well as information about which pod served it:
91104

92105
```output
93-
Using service endpoint 20.7.8.9 for get on **arm service**
94-
Response: <title>Welcome to nginx!</title>
95-
Served by: nginx-**arm**-deployment-6f8d9c2a-def56
106+
Using service endpoint 48.192.64.197 for get on arm service
107+
Response:
108+
{
109+
"message": "nginx response",
110+
"timestamp": "2025-10-24T22:04:59+00:00",
111+
"server": "nginx-arm-deployment-5bf8df95db-wznff",
112+
"request_uri": "/"
113+
}
114+
Served by: nginx-arm-deployment-5bf8df95db-wznff
96115
```
97116

98-
If you see the output `Welcome to nginx!` and the pod log shows `nginx-arm-deployment`, you have successfully added ARM nodes to your cluster running nginx.
117+
If you see output similar to above, you have successfully added ARM nodes to your cluster running nginx.
99118

100-
### Compare all architectures
119+
### Compare both architectures
101120

102-
Now you can test all three architectures and compare their responses:
121+
Now you can test both architectures and compare their responses:
103122

104123
```bash
105124
./nginx_util.sh get intel
106-
./nginx_util.sh get amd
107125
./nginx_util.sh get arm
108126
```
109127

0 commit comments

Comments
 (0)