|
| 1 | +//Module included in the following assembly |
| 2 | +// |
| 3 | +//post_installation_configuration/configuring-multi-arch-compute-machines/creating-multi-arch-compute-nodes-gcp.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="multi-architecture-modify-machine-set-gcp_{context}"] |
| 7 | += Adding an ARM64 compute machine set to your GCP cluster |
| 8 | + |
| 9 | +To configure a cluster with multi-architecture compute machines, you must create a GCP ARM64 compute machine set. This adds ARM64 compute nodes to your cluster. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You installed the {oc-first}. |
| 14 | +* You used the installation program to create an AMD64 single-architecture AWS cluster with the multi-architecture installer binary. |
| 15 | +
|
| 16 | +.Procedure |
| 17 | +* Create and modify a compute machine set, this controls the ARM64 compute nodes in your cluster: |
| 18 | ++ |
| 19 | +[source,terminal] |
| 20 | +---- |
| 21 | +$ oc create -f gcp-arm64-machine-set-0.yaml |
| 22 | +---- |
| 23 | ++ |
| 24 | +-- |
| 25 | +.Sample GCP YAML compute machine set to deploy an ARM64 compute node |
| 26 | +[source,yaml] |
| 27 | +---- |
| 28 | +apiVersion: machine.openshift.io/v1beta1 |
| 29 | +kind: MachineSet |
| 30 | +metadata: |
| 31 | + labels: |
| 32 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 33 | + name: <infrastructure_id>-w-a |
| 34 | + namespace: openshift-machine-api |
| 35 | +spec: |
| 36 | + replicas: 1 |
| 37 | + selector: |
| 38 | + matchLabels: |
| 39 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> |
| 40 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-w-a |
| 41 | + template: |
| 42 | + metadata: |
| 43 | + creationTimestamp: null |
| 44 | + labels: |
| 45 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> |
| 46 | + machine.openshift.io/cluster-api-machine-role: <role> <2> |
| 47 | + machine.openshift.io/cluster-api-machine-type: <role> |
| 48 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-w-a |
| 49 | + spec: |
| 50 | + metadata: |
| 51 | + labels: |
| 52 | + node-role.kubernetes.io/<role>: "" |
| 53 | + providerSpec: |
| 54 | + value: |
| 55 | + apiVersion: gcpprovider.openshift.io/v1beta1 |
| 56 | + canIPForward: false |
| 57 | + credentialsSecret: |
| 58 | + name: gcp-cloud-credentials |
| 59 | + deletionProtection: false |
| 60 | + disks: |
| 61 | + - autoDelete: true |
| 62 | + boot: true |
| 63 | + image: <path_to_image> <3> |
| 64 | + labels: null |
| 65 | + sizeGb: 128 |
| 66 | + type: pd-ssd |
| 67 | + gcpMetadata: <4> |
| 68 | + - key: <custom_metadata_key> |
| 69 | + value: <custom_metadata_value> |
| 70 | + kind: GCPMachineProviderSpec |
| 71 | + machineType: n1-standard-4 <5> |
| 72 | + metadata: |
| 73 | + creationTimestamp: null |
| 74 | + networkInterfaces: |
| 75 | + - network: <infrastructure_id>-network |
| 76 | + subnetwork: <infrastructure_id>-worker-subnet |
| 77 | + projectID: <project_name> <6> |
| 78 | + region: us-central1 <7> |
| 79 | + serviceAccounts: |
| 80 | + - email: <infrastructure_id>-w@<project_name>.iam.gserviceaccount.com |
| 81 | + scopes: |
| 82 | + - https://www.googleapis.com/auth/cloud-platform |
| 83 | + tags: |
| 84 | + - <infrastructure_id>-worker |
| 85 | + userDataSecret: |
| 86 | + name: worker-user-data |
| 87 | + zone: us-central1-a |
| 88 | +---- |
| 89 | +<1> Specify the infrastructure ID that is based on the cluster ID that you set when you provisioned the cluster. You can obtain the infrastructure ID by running the following command: |
| 90 | ++ |
| 91 | +[source,terminal] |
| 92 | +---- |
| 93 | +$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster |
| 94 | +---- |
| 95 | +<2> Specify the role node label to add. |
| 96 | +<3> Specify the path to the image that is used in current compute machine sets. You need the project and image name for your path to image. |
| 97 | ++ |
| 98 | +To access the project and image name, run the following command: |
| 99 | ++ |
| 100 | +[source,terminal] |
| 101 | +---- |
| 102 | +$ oc get configmap/coreos-bootimages \ |
| 103 | + -n openshift-machine-config-operator \ |
| 104 | + -o jsonpath='{.data.stream}' | jq \ |
| 105 | + -r '.architectures.aarch64.images.gcp' |
| 106 | +---- |
| 107 | ++ |
| 108 | +.Example output |
| 109 | +[source,terminal] |
| 110 | +---- |
| 111 | + "gcp": { |
| 112 | + "release": "415.92.202309142014-0", |
| 113 | + "project": "rhcos-cloud", |
| 114 | + "name": "rhcos-415-92-202309142014-0-gcp-aarch64" |
| 115 | + } |
| 116 | +---- |
| 117 | +Use the `project` and `name` parameters from the output to create the path to image field in your machine set. The path to the image should follow the following format: |
| 118 | ++ |
| 119 | +[source,terminal] |
| 120 | +---- |
| 121 | +$ projects/<project>/global/images/<image_name> |
| 122 | +---- |
| 123 | +<4> Optional: Specify custom metadata in the form of a `key:value` pair. For example use cases, see the GCP documentation for link:https://cloud.google.com/compute/docs/metadata/setting-custom-metadata[setting custom metadata]. |
| 124 | +<5> Specify an ARM64 supported machine type. For more information, refer to _Tested instance types for GCP on 64-bit ARM infrastructures_ in "Additional resources". |
| 125 | +<6> Specify the name of the GCP project that you use for your cluster. |
| 126 | +<7> Specify the region, for example, `us-central1`. Ensure that the zone you select offers 64-bit ARM machines. |
| 127 | +-- |
| 128 | +
|
| 129 | +.Verification |
| 130 | +. View the list of compute machine sets by entering the following command: |
| 131 | ++ |
| 132 | +[source,terminal] |
| 133 | +---- |
| 134 | +$ oc get machineset -n openshift-machine-api |
| 135 | +---- |
| 136 | +You can then see your created ARM64 machine set. |
| 137 | ++ |
| 138 | +.Example output |
| 139 | +[source,terminal] |
| 140 | +---- |
| 141 | +NAME DESIRED CURRENT READY AVAILABLE AGE |
| 142 | +<infrastructure_id>-gcp-arm64-machine-set-0 2 2 2 2 10m |
| 143 | +---- |
| 144 | +. You can check that the nodes are ready and scheduable with the following command: |
| 145 | ++ |
| 146 | +[source,terminal] |
| 147 | +---- |
| 148 | +$ oc get nodes |
| 149 | +---- |
0 commit comments