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
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/background.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,21 +10,20 @@ layout: "learningpathall"
10
10
11
11
## Overview
12
12
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.
14
14
15
15
16
16
## Why use Google Axion processors for GKE?
17
17
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.
19
19
20
-
###What is Google Axion?
20
+
## What is Google Axion?
21
21
22
22
[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.
23
23
24
-
###Why migrate to Arm on GKE?
24
+
## Why migrate to Arm on GKE?
25
25
There are three clear benefits to consider when considerring migrating to Arm on GKE:
26
26
27
-
28
27
- 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.
29
28
- Energy efficiency: you reduce power usage for always-on microservices, lowering both operational costs and environmental impact.
30
29
- 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
43
42
44
43
The migration process involves these steps:
45
44
46
-
- Open Google Cloud Shell and set the environment variables.
45
+
- Open Google Cloud Shell and set up the environment variables.
47
46
- Enable required APIs, create an Artifact Registry repository, and authenticate Docker.
48
47
- Create a GKE Standard cluster with an amd64 node pool and add an arm64 (Axion-based C4A) node pool.
49
48
- Create a Buildx (Kubernetes driver) builder that targets both pools, then build and push multi-architecture images (amd64 and arm64) natively using BuildKit pods.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/cloud-build.md
+36-5Lines changed: 36 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,11 @@ weight: 7
6
6
layout: learningpathall
7
7
---
8
8
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
10
10
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.
12
14
13
15
## What does this pipeline do?
14
16
@@ -19,9 +21,8 @@ The pipeline performs the following steps:
19
21
- Connects to your GKE cluster
20
22
- Applies the amd64 Kustomize overlay, verifies pods, then applies the arm64 overlay and verifies pods again
21
23
- Prints the frontend-external LoadBalancer IP at the end
22
-
23
24
{{% 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.
25
26
{{% /notice %}}
26
27
27
28
## Grant IAM permission to the Cloud Build service account
@@ -110,7 +111,7 @@ YAML
110
111
111
112
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. 
112
113
113
-
Run the commands to create the `cloudbuild.yaml` file.
114
+
Run the commands to create the `cloudbuild.yaml` file:
114
115
115
116
```yaml
116
117
cat > cloudbuild.yaml <<'YAML'
@@ -263,3 +264,33 @@ Open http://<EXTERNAL-IP> in your browser.
263
264
```
264
265
265
266
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/gke-build-push.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
---
2
-
title: Provision a dual-architecture GKE cluster and publish images
2
+
title: Build and deploy multi-architecture images on GKE
3
3
weight: 5
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
9
+
## Create a cluster and build the multi-arch images
10
+
9
11
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.
10
12
11
13
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
40
42
41
43
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.
42
44
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:
44
46
45
47
```bash
46
48
# Cluster vars (reuses earlier PROJECT_ID/REGION/ZONE)
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/gke-deploy.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,14 @@ weight: 6
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
+
## Prepare deployment manifests
8
9
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.
10
11
11
-
## Prepare deployment manifests
12
12
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
14
14
15
-
## Point base manifests at your images
15
+
Replace the sample image references in the base manifests with your Artifact Registry path and tag:
16
16
17
17
Replace the image references with your references:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/multi-arch-images.md
+31-33Lines changed: 31 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,28 +6,35 @@ weight: 4
6
6
layout: learningpathall
7
7
---
8
8
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
10
10
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.
12
14
13
15
## Services to edit
14
16
15
-
Most services already build for both architectures.
17
+
Most services in Online Boutique already build for both architectures without any changes.
16
18
17
-
The four listed below need small changes:
19
+
Four services need small updates:
18
20
19
21
- emailservice
20
22
- recommendationservice
21
23
- loadgenerator
22
24
- cartservice
23
25
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.
25
32
26
33
{{% notice Note %}}
27
34
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.
28
35
{{% /notice %}}
29
36
30
-
###Update the emailservice Dockerfile
37
+
## Update the emailservice Dockerfile
31
38
32
39
You can review the [emailservice Dockerfile](https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/refs/heads/main/src/emailservice/Dockerfile) before replacing it.
33
40
@@ -73,21 +80,18 @@ EOF
73
80
74
81
Here is a summary of the changes:
75
82
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.
81
86
82
-
## Apply updates to the other three services
87
+
## Apply updates to recommendationservice, loadgenerator, and cartservice
83
88
84
89
Run the following sed commands to automatically patch the remaining Dockerfiles.
85
90
86
91
### 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.
87
93
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:
91
95
92
96
```bash
93
97
sed -i \
@@ -101,17 +105,13 @@ sed -i \
101
105
src/recommendationservice/Dockerfile
102
106
```
103
107
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.
109
109
110
110
### Update loadgenerator Dockerfile
111
111
112
112
You can review the [loadgenerator Dockerfile](https://raw.githubusercontent.com/GoogleCloudPlatform/microservices-demo/refs/heads/main/src/loadgenerator/Dockerfile) before modifying it.
113
113
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:
115
115
116
116
```bash
117
117
FILE=src/loadgenerator/Dockerfile
@@ -135,17 +135,12 @@ sed -i -E \
135
135
"$FILE"
136
136
```
137
137
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.
143
139
144
140
### Update cartservice Dockerfile
145
141
146
142
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:
149
144
150
145
```bash
151
146
FILE=src/cartservice/src/Dockerfile
@@ -164,14 +159,17 @@ sed -i \
164
159
165
160
Here is a summary of the changes:
166
161
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.
170
166
171
167
{{% 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.
173
169
174
170
{{% /notice %}}
175
171
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!
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/project-setup.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ layout: "learningpathall"
10
10
11
11
## Get started in Cloud Shell
12
12
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.
14
14
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`.
16
16
17
17
{{% notice Note %}}
18
18
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}"
41
41
42
42
You'll need the environment variables in any shell you use to work on the project.
43
43
44
-
###Enable required Google Cloud APIs
44
+
## Enable the required Google Cloud APIs
45
45
46
46
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:
0 commit comments