Skip to content

Commit 45d9ebd

Browse files
Update GKE multi-arch Axion documentation for clarity and accuracy
1 parent afdb779 commit 45d9ebd

File tree

7 files changed

+88
-58
lines changed

7 files changed

+88
-58
lines changed

content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Migrate x86 workloads to Arm on GKE with Google Axion
2+
title: Migrate x86 workloads to Arm on Google Kubernetes Engine with Axion processors
33

44
minutes_to_complete: 90
55

@@ -36,7 +36,7 @@ tools_software_languages:
3636

3737
further_reading:
3838
- resource:
39-
title: GKE documentation
39+
title: Google Kubernetes Engine documentation
4040
link: https://cloud.google.com/kubernetes-engine/docs
4141
type: documentation
4242
- resource:

content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/background.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,20 @@ layout: "learningpathall"
1010

1111
## Overview
1212

13-
This Learning Path shows you how to migrate a microservices application from x86 to Arm on GKE using multi-architecture container images. You'll work with Google's Online Boutique, a sample application built with multiple programming languages. The migration requires no code changes, making it a straightforward example of moving to Arm-based Google Axion processors.
13+
This Learning Path shows you how to migrate a microservices application from x86 to Arm on Google Kubernetes Engine (GKE) using multi-architecture container images. You'll work with Google's Online Boutique, a sample application built with multiple programming languages. The migration requires no code changes, making it a straightforward example of moving to Arm-based Google Axion processors.
1414

1515

1616
## Why use Google Axion processors for GKE?
1717

18-
Google Axion processors bring modern Arm-based compute to GKE, delivering strong price-performance and energy efficiency for cloud-native, scale-out services. With multi-architecture images and mixed node pools, you can migrate services from x86 to Arm gradually, with no major code changes.
18+
Google Axion processors bring modern Arm-based compute to GKE. You get strong price-performance and energy efficiency for cloud-native, scale-out services. With multi-architecture images and mixed node pools, you can migrate services from x86 to Arm gradually, with no major code changes.
1919

20-
### What is Google Axion?
20+
## What is Google Axion?
2121

2222
[Google Axion](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu) is Google Cloud's Arm-based CPU family built on Arm Neoverse, for general-purpose, cloud-native services and CPU-based AI. You can deploy it for workloads like web apps and web servers, containerized microservices, open-source databases, in-memory caches, data analytics, media processing, and CPU-based AI inference and data processing. On GKE, you can leverage Axion through the C4A and N4A VM families, paired with Google's Titanium offloads to free CPU cycles for application work.
2323

24-
### Why migrate to Arm on GKE?
24+
## Why migrate to Arm on GKE?
2525
There are three clear benefits to consider when considerring migrating to Arm on GKE:
2626

27-
2827
- Price-performance: you can run more workload per unit of cost, which is particularly valuable for scale-out services that need to handle increasing traffic efficiently.
2928
- Energy efficiency: you reduce power usage for always-on microservices, lowering both operational costs and environmental impact.
3029
- Compatibility: you can migrate containerized applications with build and deploy changes only—no code rewrites are required, making the transition straightforward.
@@ -43,7 +42,7 @@ You'll migrate the Online Boutique application from x86 to Arm step by step. You
4342

4443
The migration process involves these steps:
4544

46-
- Open Google Cloud Shell and set the environment variables.
45+
- Open Google Cloud Shell and set up the environment variables.
4746
- Enable required APIs, create an Artifact Registry repository, and authenticate Docker.
4847
- Create a GKE Standard cluster with an amd64 node pool and add an arm64 (Axion-based C4A) node pool.
4948
- Create a Buildx (Kubernetes driver) builder that targets both pools, then build and push multi-architecture images (amd64 and arm64) natively using BuildKit pods.

content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/cloud-build.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ weight: 7
66
layout: learningpathall
77
---
88

9-
Google [**Cloud Build**](https://cloud.google.com/build/docs/set-up) is a managed CI/CD service that runs your containerized build and deploy steps in isolated runners.
9+
## Automate the deployment with Cloud Build
1010

11-
In this section, you'll automate the flow you performed manually: build multi-arch images, deploy to GKE on amd64, then migrate to arm64, and print the app's external IP.
11+
Google [Cloud Build](https://cloud.google.com/build/docs/set-up) is a managed CI/CD service that runs your containerized build and deploy steps in isolated runners.
12+
13+
In this section, you automate the flow you performed manually: build multi-arch images, deploy to GKE on amd64, then migrate to arm64, and print the app's external IP.
1214

1315
## What does this pipeline do?
1416

@@ -19,9 +21,8 @@ The pipeline performs the following steps:
1921
- Connects to your GKE cluster
2022
- Applies the amd64 Kustomize overlay, verifies pods, then applies the arm64 overlay and verifies pods again
2123
- Prints the frontend-external LoadBalancer IP at the end
22-
2324
{{% notice Tip %}}
24-
Run this from the microservices-demo repo root in Cloud Shell. Ensure you completed the previous steps.
25+
Run this command from the `microservices-demo` repository root in Cloud Shell. Make sure you've completed the previous steps.
2526
{{% /notice %}}
2627

2728
## Grant IAM permission to the Cloud Build service account
@@ -110,7 +111,7 @@ YAML
110111

111112
This pipeline installs Docker with Buildx in the runner, enables QEMU, builds two services as examples (extend as desired), connects to your cluster, deploys to amd64, verifies, migrates to arm64, verifies, and prints the external IP. 
112113

113-
Run the commands to create the `cloudbuild.yaml` file.
114+
Run the commands to create the `cloudbuild.yaml` file:
114115

115116
```yaml
116117
cat > cloudbuild.yaml <<'YAML'
@@ -263,3 +264,33 @@ Open http://<EXTERNAL-IP> in your browser.
263264
```
264265

265266
Open the URL to load the storefront and confirm the full build, deploy, and migrate flow is automated.
267+
268+
## What you've accomplished
269+
270+
Congratulations! You've successfully automated the entire build, deploy, and migration workflow using Cloud Build and Skaffold. Your multi-architecture application runs natively on Arm-powered GKE nodes, and you can deploy updates automatically with a single command.
271+
272+
You've learned how to:
273+
274+
- Update Dockerfiles to support native builds on both amd64 and arm64 architectures
275+
- Create a dual-architecture GKE cluster with separate node pools for each platform
276+
- Build multi-architecture container images using Docker Buildx with native BuildKit pods
277+
- Deploy applications to amd64 nodes, then migrate them to arm64 nodes using Kustomize overlays
278+
- Automate the entire workflow with Cloud Build and Skaffold for continuous deployment
279+
280+
## What's next
281+
282+
Now that you have a working multi-architecture deployment pipeline, you can explore these next steps:
283+
284+
- Optimize for Arm performance: profile your services on arm64 nodes to identify optimization opportunities. Arm Neoverse processors offer different performance characteristics than x86, so you might discover new ways to improve throughput or reduce latency.
285+
286+
- Expand your migration: add build steps for the remaining Online Boutique services. You can extend the `cloudbuild.yaml` file to build all services, not just the two examples provided.
287+
288+
- Implement progressive rollouts: use Skaffold profiles and Cloud Build triggers to set up canary deployments or blue-green deployments across architectures. This lets you test changes on a subset of traffic before rolling out to all users.
289+
290+
- Monitor architecture-specific metrics: set up monitoring dashboards in Cloud Monitoring to compare performance, resource usage, and cost between amd64 and arm64 deployments. This data helps you make informed decisions about your migration strategy.
291+
292+
- Explore cost optimization: review your GKE cluster costs and consider rightsizing your node pools. Arm-based C4A instances often provide better price-performance for cloud-native workloads, so you might reduce costs while maintaining or improving performance.
293+
294+
295+
296+

content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/gke-build-push.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
2-
title: Provision a dual-architecture GKE cluster and publish images
2+
title: Build and deploy multi-architecture images on GKE
33
weight: 5
44

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

9+
## Create a cluster and build the multi-arch images
10+
911
You are ready to create a GKE cluster with two node pools (amd64 and arm64), then build and push multi-arch images natively on those node pools.
1012

1113
Each architecture uses its own BuildKit pod, and no QEMU emulation is required.
@@ -40,7 +42,7 @@ This approach prevents users on the default VPC from accidentally setting NETWOR
4042

4143
Create a GKE Standard cluster with VPC-native (IP aliasing) enabled and no default node pool. You'll add amd64 and arm64 pools in the next step.
4244

43-
The command below works for both default and custom VPCs. If the NETWORK, SUBNET, and secondary range variables are unset, GKE uses the default VPC and manages ranges automatically.
45+
The command below works for both default and custom VPCs. If the NETWORK, SUBNET, and secondary range variables are unset, GKE uses the default VPC and manages ranges automatically:
4446

4547
```bash
4648
# Cluster vars (reuses earlier PROJECT_ID/REGION/ZONE)

content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/gke-deploy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ weight: 6
55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
8+
## Prepare deployment manifests
89

9-
You'll now configure the application manifests to use your Artifact Registry images and create Kustomize overlays for different CPU architectures. This allows you to deploy the same application to both x86 and Arm node pools.
10+
You'll now configure the application manifests to use your Artifact Registry images and create Kustomize overlays for different CPU architectures. This allows you to deploy the same application to both x86 and Arm node pools by replacing sample image references with your Artifact Registry path and tag, then creating overlays to select nodes by architecture.
1011

11-
## Prepare deployment manifests
1212

13-
Replace sample image references with your Artifact Registry path and tag, then create Kustomize overlays to select nodes by architecture.
13+
## Update base manifests to use your images
1414

15-
## Point base manifests at your images
15+
Replace the sample image references in the base manifests with your Artifact Registry path and tag:
1616

1717
Replace the image references with your references:
1818

content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/multi-arch-images.md

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,35 @@ weight: 4
66
layout: learningpathall
77
---
88

9-
With your environment set up, you're ready to modify the Online Boutique services to support multi-architecture builds.
9+
## Update Dockerfiles to support multi-architecture builds
1010

11-
You will patch some Dockerfiles so they build cleanly for both architectures. In the next section, you will build and push images using a GKE-native Buildx builder.
11+
Now that your environment set up, you're now ready to modify the Online Boutique services to support multi-architecture builds.
12+
13+
You will patch some Dockerfiles so they build cleanly for both architectures.
1214

1315
## Services to edit
1416

15-
Most services already build for both architectures.
17+
Most services in Online Boutique already build for both architectures without any changes.
1618

17-
The four listed below need small changes:
19+
Four services need small updates:
1820

1921
- emailservice
2022
- recommendationservice
2123
- loadgenerator
2224
- cartservice
2325

24-
These edits don't change application behavior, they only ensure the right compiler headers and runtime libraries are present per architecture. This includes Python native wheels for email/recommendation/loadgen, and system `protoc` for the .NET cartservice.
26+
These edits ensure the correct compiler headers and runtime libraries are present for each architecture. The changes include:
27+
28+
- Python native wheels for emailservice, recommendationservice, and loadgenerator
29+
- System `protoc` for the .NET cartservice
30+
31+
These updates don't change application behavior.
2532

2633
{{% notice Note %}}
2734
Production migrations begin with assessing cross-architecture compatibility for each service (base images, native extensions such as CGO/JNI, platform-specific packages, and CI build targets). This section demonstrates minor Dockerfile edits for four representative services. In the referenced Online Boutique release, the remaining services generally build for both **amd64** and **arm64** without modification.
2835
{{% /notice %}}
2936

30-
### Update the emailservice Dockerfile
37+
## Update the emailservice Dockerfile
3138

3239
You can review the [emailservice Dockerfile](https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/refs/heads/main/src/emailservice/Dockerfile) before replacing it.
3340

@@ -73,21 +80,18 @@ EOF
7380

7481
Here is a summary of the changes:
7582

76-
- **BuildKit syntax** unlocks `--mount=type=cache` to speed rebuilds.
77-
- **TARGETPLATFORM** lets Buildx set linux/amd64 vs linux/arm64 explicitly.
78-
- **Dev vs runtime packages:** build stage compiles native wheels; final stage keeps only needed shared libs.
79-
- **`--prefer-binary`** avoids source builds when wheels exist (more reliable across arches).
80-
- **Removed extra `apk update`** since `apk add --no-cache` already avoids stale indexes & caches.
83+
- The updated Dockerfile uses BuildKit syntax to enable cache mounts, which speed up rebuilds.
84+
- The `TARGETPLATFORM` argument allows Buildx to explicitly set the target architecture (either `linux/amd64` or `linux/arm64`). The build follows a two-stage approach: the builder stage compiles native wheels with necessary development packages, while the final runtime stage includes only the required shared libraries.
85+
- The `--prefer-binary` flag helps avoid building from source when pre-built wheels are available, making builds more reliable across architectures. The update also removes the extra `apk update` command because `apk add --no-cache` already handles index updates without creating a cache.
8186

82-
## Apply updates to the other three services
87+
## Apply updates to recommendationservice, loadgenerator, and cartservice
8388

8489
Run the following sed commands to automatically patch the remaining Dockerfiles.
8590

8691
### Update the recommendationservice Dockerfile
92+
You can review the [recommendationservice Dockerfile](https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/refs/heads/main/src/recommendationservice/Dockerfile) before modifying it.
8793

88-
You can review the [recommendationservice Dockerfile](https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/refs/heads/main/src/recommendationservice/Dockerfile) before modifying it.
89-
90-
Paste the command below to your terminal to update the file with the required multi-architecture changes.
94+
Run the following command to update the file with the required multi-architecture changes:
9195

9296
```bash
9397
sed -i \
@@ -101,17 +105,13 @@ sed -i \
101105
src/recommendationservice/Dockerfile
102106
```
103107

104-
Here is a summary of the changes:
105-
106-
- Make the base image architecture-aware
107-
- Let native wheels build cleanly
108-
- Keep the runtime slim & predictable
108+
The three key changes are to make the base image architecture-aware, let native wheels build cleanly, and keep the runtime slim and predictable.
109109

110110
### Update loadgenerator Dockerfile
111111

112112
You can review the [loadgenerator Dockerfile](https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/refs/heads/main/src/loadgenerator/Dockerfile) before modifying it.
113113

114-
Paste the command below to your terminal to run `sed` to update the file with the required multi-architecture changes.
114+
Run the following command to update the file with the required multi-architecture changes:
115115

116116
```bash
117117
FILE=src/loadgenerator/Dockerfile
@@ -135,17 +135,12 @@ sed -i -E \
135135
"$FILE"
136136
```
137137

138-
Here is a summary of the changes:
139-
140-
- Make the base image architecture-aware
141-
- Fix native build/run deps
142-
- Keep runtime lean and no flags/app code changed
138+
The changes focus on three key areas. First, make the base image architecture-aware so it automatically selects the correct variant for your platform. Second, fix native build and runtime dependencies to ensure they match the target architecture. Third, keep the runtime environment lean—you don't need to change any flags or application code.
143139

144140
### Update cartservice Dockerfile
145141

146142
You can review the [carkservice Dockerfile](https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/refs/heads/main/src/cartservice/src/Dockerfile) before replacing it.
147-
148-
Paste the command below to your terminal to update the file with the required multi-architecture changes.
143+
Run the following command to update the file with the required multi-architecture changes:
149144

150145
```bash
151146
FILE=src/cartservice/src/Dockerfile
@@ -164,14 +159,17 @@ sed -i \
164159

165160
Here is a summary of the changes:
166161

167-
- Install the system `protoc` command
168-
- Force MSBuild to use the supplied `protoc` command
169-
- No behavioral changes
162+
- Install the system `protoc` compiler in the builder image
163+
- Configure MSBuild to use the installed `protoc` instead of downloading one
164+
165+
These changes don't affect application behavior.
170166

171167
{{% notice Note %}}
172-
`ARG TARGETPLATFORM` + `FROM --platform=$TARGETPLATFORM` is not strictly required if you always build with --platform and your base image is multi-arch. Keeping it is good practice and makes intent explicit and does not change runtime behavior.
168+
Using `ARG TARGETPLATFORM` and `FROM --platform=$TARGETPLATFORM` isn't strictly required when you build with `--platform` and your base image supports multiple architectures. However, keeping these declarations makes your build intent explicit and doesn't change runtime behavior.
173169

174170
{{% /notice %}}
175171

176-
After making the Dockerfile modification, all services now support multi-architecture builds.
172+
After updating these Dockerfiles, all services support multi-architecture builds. You're ready to build and push images using a GKE-native Buildx builder. Great job!
173+
174+
177175

content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/project-setup.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ layout: "learningpathall"
1010

1111
## Get started in Cloud Shell
1212

13-
Use [Cloud Shell](https://cloud.google.com/shell/docs/using-cloud-shell) to set variables, enable APIs, create Artifact Registry, authenticate Docker, and clone the sample microservices demo.
13+
You can use [Cloud Shell](https://cloud.google.com/shell/docs/using-cloud-shell) to set variables, enable APIs, create Artifact Registry, authenticate Docker, and clone the sample microservices demo.
1414

15-
Make sure `kubectl`, `gcloud`, `docker`, and `git` commands are installed.
15+
Make sure you have the following tools installed: `kubectl`, `gcloud`, `docker`, and `git`.
1616

1717
{{% notice Note %}}
1818
You can use your local macOS or Linux computer instead of Cloud Shell. Make sure the required software is installed.
@@ -41,31 +41,31 @@ gcloud config set compute/zone "${ZONE}"
4141

4242
You'll need the environment variables in any shell you use to work on the project.
4343

44-
### Enable required Google Cloud APIs
44+
## Enable the required Google Cloud APIs
4545

4646
Enable the required APIs so the project can create GKE clusters, push and pull container images in Artifact Registry, and use Cloud Build for CI/CD:
4747

4848
```bash
4949
gcloud services enable container.googleapis.com artifactregistry.googleapis.com cloudbuild.googleapis.com
5050
```
5151

52-
### Create an Artifact Registry (Docker) repository
52+
## Create an Artifact Registry (Docker) repository
5353

5454
Create a Docker repository in Artifact Registry in this region for pushing and pulling your multi-architecture images:
5555

5656
```bash
5757
gcloud artifacts repositories create "${REPO}" --repository-format=docker --location="${REGION}" --description="Multi-arch images for microservices demo"
5858
```
5959

60-
### Authenticate Docker to Artifact Registry
60+
## Authenticate Docker to Artifact Registry
6161

6262
Authenticate Docker to Artifact Registry so you can push and pull images:
6363

6464
```bash
6565
gcloud auth configure-docker "${REGION}-docker.pkg.dev"
6666
```
6767

68-
### Clone the Online Boutique sample microservices application
68+
## Clone the Online Boutique sample microservices application
6969

7070
Clone the sample application repository:
7171

0 commit comments

Comments
 (0)