Skip to content

Commit 4902678

Browse files
Merge pull request #2130 from madeline-underwood/red_hat
Red hat_JA to sign off
2 parents 60c76b8 + c7eb95a commit 4902678

File tree

2 files changed

+82
-82
lines changed

2 files changed

+82
-82
lines changed
Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,57 @@
11
---
22
title: Build multi-architecture applications with Red Hat OpenShift Pipelines on AWS
33

4-
draft: true
5-
cascade:
6-
draft: true
7-
84
minutes_to_complete: 30
95

10-
who_is_this_for: This topic is for OpenShift administrators interested in migrating their applications to Arm.
11-
6+
who_is_this_for: This topic is for OpenShift administrators who want to migrate their applications to Arm.
127

138
learning_objectives:
14-
- Migrate existing OpenShift applications to Arm.
9+
- Migrate existing OpenShift applications to Arm-based nodes
1510

1611
prerequisites:
17-
- An AWS account with an OpenShift 4.18 cluster with x86 nodes installed and configured.
18-
- Red Hat OpenShift Pipelines (Tekton) operator installed in your cluster.
19-
- Familiarity with Red Hat OpenShift (oc CLI), container concepts, and basic Tekton principles (Task, Pipeline, PipelineRun).
20-
- Access to your Red Hat OpenShift cluster with cluster-admin or equivalent privileges for node configuration and pipeline setup.
12+
- An AWS account with an OpenShift 4.18 cluster running x86 compute nodes
13+
- Red Hat OpenShift Pipelines (Tekton) Operator installed in your cluster
14+
- Familiarity with the `oc` CLI, container fundamentals, and basic Tekton concepts (Task, Pipeline, PipelineRun)
15+
- Cluster access with `cluster-admin` or equivalent permissions to configure nodes and pipelines
2116

2217
author: Jeff Young
2318

24-
### Tags
19+
# Tags
2520
skilllevels: Advanced
2621
subjects: CI-CD
2722
armips:
28-
- Neoverse
23+
- Neoverse
2924
tools_software_languages:
30-
- Tekton
31-
- OpenShift
25+
- Tekton
26+
- OpenShift
3227
operatingsystems:
33-
- Linux
28+
- Linux
3429

3530
further_reading:
36-
- resource:
37-
title: Red Hat OpenShift Documentation
38-
link: https://docs.openshift.com/container-platform/latest/welcome/index.html
39-
type: documentation
40-
- resource:
41-
title: OpenShift Pipelines (Tekton) Documentation
42-
link: https://docs.openshift.com/container-platform/latest/cicd/pipelines/understanding-openshift-pipelines.html
43-
type: documentation
44-
- resource:
45-
title: OpenShift Multi-Architecture Compute Machines
46-
link: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/postinstallation_configuration/configuring-multi-architecture-compute-machines-on-an-openshift-cluster
47-
type: documentation
48-
- resource:
49-
title: OpenShift ImageStreams Documentation
50-
link: https://docs.openshift.com/container-platform/latest/openshift_images/image-streams-managing.html
51-
type: documentation
52-
- resource:
53-
title: Migrating to Multi-Architecture Compute Machines
54-
link: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html-single/updating_clusters/#migrating-to-multi-payload
55-
type: documentation
31+
- resource:
32+
title: Red Hat OpenShift documentation
33+
link: https://docs.openshift.com/container-platform/latest/welcome/index.html
34+
type: documentation
35+
- resource:
36+
title: OpenShift Pipelines (Tekton) documentation
37+
link: https://docs.openshift.com/container-platform/latest/cicd/pipelines/understanding-openshift-pipelines.html
38+
type: documentation
39+
- resource:
40+
title: OpenShift multi-architecture compute machines
41+
link: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/postinstallation_configuration/configuring-multi-architecture-compute-machines-on-an-openshift-cluster
42+
type: documentation
43+
- resource:
44+
title: OpenShift ImageStreams documentation
45+
link: https://docs.openshift.com/container-platform/latest/openshift_images/image-streams-managing.html
46+
type: documentation
47+
- resource:
48+
title: Migrating to multi-architecture compute machines
49+
link: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html-single/updating_clusters/#migrating-to-multi-payload
50+
type: documentation
5651

5752
### FIXED, DO NOT MODIFY
5853
# ================================================================================
59-
weight: 1 # _index.md always has weight of 1 to order correctly
60-
layout: "learningpathall" # All files under learning paths have this same wrapper
61-
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
62-
---
54+
weight: 1
55+
layout: "learningpathall"
56+
learning_path_main_page: "yes"
57+
---

content/learning-paths/servers-and-cloud-computing/arm-cost-savings/migrationsteps.md

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,72 @@
11
---
2-
title: Migrate an x86 workload to Arm on AWS
2+
title: Migrate an x86 workload to Arm on AWS
33
weight: 2
44

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

9-
Migrating workloads from x86 to Arm on AWS can help reduce costs and improve performance. The steps below explain how to assess your workload compatibility, enable multi-architecture support in Red Hat OpenShift, configure arm64 nodes, rebuild and verify container images, and safely transition your deployments.
9+
Migrating container workloads from x86 to Arm on AWS can help reduce cloud costs, improve energy efficiency, and enhance performance. This Learning Path shows you how to assess workload compatibility, enable multi-architecture support in Red Hat OpenShift, configure Arm64 nodes, rebuild and verify container images, and transition your deployments safely.
1010

11-
This example assumes you have the [OpenShift Pipelines Tutorial](https://github.com/openshift/pipelines-tutorial) built and running on x86.
11+
This example uses the [OpenShift Pipelines Tutorial](https://github.com/openshift/pipelines-tutorial) as the baseline and assumes it is running on x86 infrastructure.
1212

13-
### 1. Assess Workload Compatibility
13+
## Assess workload compatibility
1414

15-
Before migrating, determine whether your applications can run on 64-bit Arm architecture. Most modern applications built with portable runtimes such as Java, Go, Python, or Node.js can run seamlessly on 64-bit Arm with little or no modifications. Check your container images and dependencies for 64-bit Arm compatibility.
15+
Before migrating, confirm that your applications can run on the Arm 64-bit (`arm64`) architecture. Most modern applications built with portable runtimes such as Java, Go, Python, or Node.js run on Arm with little or no changes. Check your container images and dependencies for compatibility.
1616

17-
To check if your container images support multiple architectures (such as arm64 and amd64), you can use tools like [KubeArchInspect](https://learn.arm.com/learning-paths/servers-and-cloud-computing/kubearchinspect/) to analyze images in your Kubernetes cluster.
17+
Use the following tools to inspect container images for multi-architecture support:
1818

19-
Additionally, you can use the Python script provided in [Learn how to use Docker](https://learn.arm.com/learning-paths/cross-platform/docker/check-images/) to inspect images for multi-architecture support.
19+
- [KubeArchInspect](https://learn.arm.com/learning-paths/servers-and-cloud-computing/kubearchinspect/): scans container images in your Kubernetes cluster.
20+
- [Docker inspect script](https://learn.arm.com/learning-paths/cross-platform/docker/check-images/): checks local image manifests for platform variants.
2021

21-
The OpenShift Pipelines Tutorial supports arm64 and doesn't have any architecture restrictions.
22+
{{% notice Note %}}
23+
The OpenShift Pipelines Tutorial supports `arm64` and has no architecture restrictions.
24+
{{% /notice %}}
2225

23-
### 2. Enable Multi-Arch Support in Red Hat OpenShift
2426

25-
Red Hat OpenShift supports multi-architecture workloads, allowing you to run both x86 and Arm based nodes in the same cluster.
27+
## Enable multi-architecture support in Red Hat OpenShift
2628

27-
Red Hat OpenShift's [documentation](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/postinstallation_configuration/configuring-multi-architecture-compute-machines-on-an-openshift-cluster#multi-architecture-verifying-cluster-compatibility_creating-multi-arch-compute-nodes-aws) provides full details for the process.
29+
OpenShift supports multi-architecture workloads, allowing you to run x86 and Arm nodes in the same cluster.
2830

29-
To check if your cluster is multi-architecture compatible, use the OpenShift CLI and run:
31+
To check if your cluster is multi-architecture compatible, run:
3032

3133
```bash
3234
oc adm release info -o jsonpath="{ .metadata.metadata }"
3335
```
3436

35-
If the output includes `"release.openshift.io/architecture": "multi"`, your cluster supports multi-architecture compute nodes.
37+
If the output includes:
38+
39+
```json
40+
"release.openshift.io/architecture": "multi"
41+
```
42+
43+
...then your cluster supports multi-architecture nodes.
3644

3745
If your cluster is not multi-architecture compatible, you must migrate it to use the multi-architecture release payload. This involves updating your OpenShift cluster to a version that supports multi-architecture and switching to the multi-architecture payload. For step-by-step instructions, see the OpenShift documentation on [migrating to a cluster with multi-architecture compute machines](https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html-single/updating_clusters/#migrating-to-multi-payload). Once migration is complete, you can add compute nodes with different architectures.
3846

39-
### 3. Add 64-bit Arm MachineSets
47+
## Add 64-bit Arm MachineSets
4048

4149
To take advantage of Arm-based compute, you need to add new MachineSets to your OpenShift cluster that use Arm (Graviton) EC2 instances. This step enables your cluster to schedule workloads on Arm nodes, allowing you to run and test your applications on the target architecture while maintaining your existing x86 nodes for a smooth migration.
4250

43-
#### Decide on a scheduling strategy
51+
## Decide on a scheduling strategy
4452

4553
When introducing Arm nodes into your OpenShift cluster, you need to control which workloads are scheduled onto these new nodes. There are two main approaches:
4654

47-
- **Manual scheduling with Taints and Tolerations:** By applying a taint to your Arm nodes, you ensure that only workloads with a matching toleration are scheduled there. This gives you precise control over which applications run on Arm, making it easier to test and migrate workloads incrementally.
48-
- **Automated scheduling with the Multiarch Tuning Operator:** This operator helps automate the placement of workloads on the appropriate architecture by managing node affinity and tolerations for you. This is useful for larger environments or when you want to simplify multi-architecture workload management.
55+
- **Manual scheduling with Taints and Tolerations:** by applying a taint to your Arm nodes, you ensure that only workloads with a matching toleration are scheduled there. This gives you precise control over which applications run on Arm, making it easier to test and migrate workloads incrementally.
56+
- **Automated scheduling with the Multiarch Tuning Operator:** this operator helps automate the placement of workloads on the appropriate architecture by managing node affinity and tolerations for you. This is useful for larger environments or when you want to simplify multi-architecture workload management.
4957

50-
For scenarios with a single workload in the build pipeline, the manual taint and toleration method can be used. The following taint can be added to new Arm machine sets:
58+
For manual scheduling, add the following taint:
5159

52-
```
53-
taints:
54-
- effect: NoSchedule
55-
key: newarch
56-
value: arm64
60+
```yaml
61+
taints:
62+
- effect: NoSchedule
63+
key: newarch
64+
value: arm64
5765
```
5866
5967
This prevents existing x86 workloads from being scheduled to the Arm nodes, ensuring only workloads that explicitly tolerate this taint will run on Arm.
6068
61-
#### Reimport needed ImageStreams with import-mode set to PreserveOriginal
69+
## Reimport needed ImageStreams with import-mode set to PreserveOriginal
6270
6371
When running workloads on Arm nodes, you may need to ensure that the required container images are available for the arm64 architecture. OpenShift uses ImageStreams to manage container images, and by default, these may only include x86 (amd64) images.
6472
@@ -71,19 +79,23 @@ oc import-image php -n openshift --all --confirm --import-mode='PreserveOriginal
7179
oc import-image python -n openshift --all --confirm --import-mode='PreserveOriginal'
7280
```
7381

74-
This step is important to avoid image pull errors when deploying workloads to Arm nodes.
82+
{{% notice Note %}}
83+
This avoids image pull errors when deploying on Arm nodes.
84+
{{% /notice %}}
85+
7586

76-
### 4. Rebuild and Verify Container Images
87+
## Rebuild and verify container images
7788

7889
To build 64-bit Arm compatible images, the OpenShift Pipelines Tutorial has been modified to patch deployments with the Tekton Task's podTemplate information. This will allow you to pass a podTemplate for building and deploying your newly built application on the target architecture. It also makes it easy to revert back to 64-bit x86 by re-running the pipeline without the template.
7990

8091
{{% notice Note %}}
81-
Red Hat OpenShift only supports native architecture container builds. Cross-architecture container builds are not supported.
92+
Red Hat OpenShift only supports native builds. Cross-architecture builds are not supported.
8293
{{% /notice %}}
8394

95+
## Define a podTemplate
8496
Create a podTemplate defining a toleration and a node affinity to make the builds deploy on Arm machines.
8597

86-
Save the code below in a file named `arm64.yaml`
98+
Save the following as `arm64.yaml`:
8799

88100
```yaml
89101
tolerations:
@@ -172,30 +184,23 @@ Finally the `04_pipeline.yaml` needs to be updated to pass the taskrun-name to t
172184

173185
```yaml
174186
- name: update-deployment
175-
taskRef:
187+
taskRef:
176188
name: update-deployment
177-
params:
189+
params:
178190
- name: deployment
179-
value: $(params.deployment-name)
191+
value: $(params.deployment-name)
180192
- name: IMAGE
181-
value: $(params.IMAGE)
182-
- name: taskrun-name //add these
183-
value: $(context.taskRun.name) //lines
193+
value: $(params.IMAGE)
194+
- name: taskrun-name
195+
value: $(context.taskRun.name)
184196
```
185197

186198
Now the UI and API can be redeployed using the `arm64.yaml` podTemplate. This will force all parts of the build pipeline and deployment to the tainted Arm nodes.
187199

188200
Run the `tkn` command:
189201

190202
```bash
191-
tkn pipeline start build-and-deploy \\\\
192-
--prefix-name build-deploy-api-pipelinerun-arm64 \\\\
193-
-w name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01\_pipeline/03\_persistent\_volume\_claim.yaml \\\\
194-
-p deployment-name=pipelines-vote-api \\\\
195-
-p git-url=https://github.com/openshift/pipelines-vote-api.git \\\\
196-
-p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/pipelines-vote-api-arm64
197-
--use-param-defaults \\\\
198-
--pod-template arm64.yaml
203+
tkn pipeline start build-and-deploy --prefix-name build-deploy-api-pipelinerun-arm64 -w name=shared-workspace,volumeClaimTemplateFile=https://raw.githubusercontent.com/openshift/pipelines-tutorial/master/01_pipeline/03_persistent_volume_claim.yaml -p deployment-name=pipelines-vote-api -p git-url=https://github.com/openshift/pipelines-vote-api.git -p IMAGE=image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/pipelines-vote-api-arm64 --use-param-defaults --pod-template arm64.yaml
199204
```
200205

201206
Once the pods are up and running, you can safely remove the x86 worker nodes from the cluster, and remove the taints from the Arm worker nodes (if you choose to do so).

0 commit comments

Comments
 (0)