1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/multi-architecture-modify-machine-set-aws.adoc

148 lines
5.5 KiB
Plaintext

// Module included in the following assembly
//
// * post_installation_configuration/cluster-tasks.adoc
:_mod-docs-content-type: PROCEDURE
[id="multi-architecture-modify-machine-set-aws_{context}"]
= Adding a multi-architecture compute machine set to your AWS cluster
After creating a multi-architecture cluster, you can add nodes with different architectures.
You can add multi-architecture compute machines to a multi-architecture cluster in the following ways:
* Adding 64-bit x86 compute machines to a cluster that uses 64-bit ARM control plane machines and already includes 64-bit ARM compute machines. In this case, 64-bit x86 is considered the secondary architecture.
* Adding 64-bit ARM compute machines to a cluster that uses 64-bit x86 control plane machines and already includes 64-bit x86 compute machines. In this case, 64-bit ARM is considered the secondary architecture.
include::snippets/about-multiarch-tuning-operator.adoc[]
.Prerequisites
* You installed the {oc-first}.
* You used the installation program to create an 64-bit ARM or 64-bit x86 single-architecture AWS cluster with the multi-architecture installer binary.
.Procedure
. Log in to the {oc-first}.
. Create a YAML file, and add the configuration to create a compute machine set to control the 64-bit ARM or 64-bit x86 compute nodes in your cluster.
+
--
.Example `MachineSet` object for an AWS 64-bit ARM or x86 compute node
[source,yaml]
----
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
name: <infrastructure_id>-aws-machine-set-0 <1>
namespace: openshift-machine-api
spec:
replicas: 1
selector:
matchLabels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<zone> <2>
template:
metadata:
labels:
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
machine.openshift.io/cluster-api-machine-role: <role> <3>
machine.openshift.io/cluster-api-machine-type: <role> <3>
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<zone> <2>
spec:
metadata:
labels:
node-role.kubernetes.io/<role>: ""
providerSpec:
value:
ami:
id: ami-02a574449d4f4d280 <4>
apiVersion: awsproviderconfig.openshift.io/v1beta1
blockDevices:
- ebs:
iops: 0
volumeSize: 120
volumeType: gp2
credentialsSecret:
name: aws-cloud-credentials
deviceIndex: 0
iamInstanceProfile:
id: <infrastructure_id>-worker-profile <1>
instanceType: m6g.xlarge <5>
kind: AWSMachineProviderConfig
placement:
availabilityZone: us-east-1a <6>
region: <region> <7>
securityGroups:
- filters:
- name: tag:Name
values:
- <infrastructure_id>-node <1>
subnet:
filters:
- name: tag:Name
values:
- <infrastructure_id>-subnet-private-<zone>
tags:
- name: kubernetes.io/cluster/<infrastructure_id> <1>
value: owned
- name: <custom_tag_name>
value: <custom_tag_value>
userDataSecret:
name: worker-user-data
----
<1> Specify the infrastructure ID that is based on the cluster ID that you set when you provisioned the cluster. If you have the {oc-first} installed, you can obtain the infrastructure ID by running the following command:
+
[source,terminal]
----
$ oc get -o jsonpath="{.status.infrastructureName}{'\n'}" infrastructure cluster
----
<2> Specify the infrastructure ID, role node label, and zone.
<3> Specify the role node label to add.
<4> Specify a {op-system-first} Amazon Machine Image (AMI) for your AWS region for the nodes. The {op-system} AMI must be compatible with the machine architecture.
+
[source,terminal]
----
$ oc get configmap/coreos-bootimages \
-n openshift-machine-config-operator \
-o jsonpath='{.data.stream}' | jq \
-r '.architectures.<arch>.images.aws.regions."<region>".image'
----
<5> Specify a machine type that aligns with the CPU architecture of the chosen AMI. For more information, see "Tested instance types for AWS 64-bit ARM"
<6> Specify the zone. For example, `us-east-1a`. Ensure that the zone you select has machines with the required architecture.
<7> Specify the region. For example, `us-east-1`. Ensure that the zone you select has machines with the required architecture.
--
. Create the compute machine set by running the following command:
+
[source,terminal]
----
$ oc create -f <file_name> <1>
----
<1> Replace `<file_name>` with the name of the YAML file with compute machine set configuration. For example: `aws-arm64-machine-set-0.yaml`, or `aws-amd64-machine-set-0.yaml`.
.Verification
. View the list of compute machine sets by running the following command:
+
[source,terminal]
----
$ oc get machineset -n openshift-machine-api
----
+
The output must include the machine set that you created.
+
.Example output
[source,terminal]
----
NAME DESIRED CURRENT READY AVAILABLE AGE
<infrastructure_id>-aws-machine-set-0 2 2 2 2 10m
----
. You can check if the nodes are ready and schedulable by running the following command:
+
[source,terminal]
----
$ oc get nodes
----