
// Module included in the following assemblies:
//
// * assemblies/rosa-nodes-machinepools-configuring.adoc

:_mod-docs-content-type: PROCEDURE
[id="rosa-nodes-machine-pools-local-zones_{context}"]
= Configuring machine pools in Local Zones

Use the following steps to configure machine pools in Local Zones.

[IMPORTANT]
====
AWS Local Zones are supported on {product-title} 4.12. See the link:https://access.redhat.com/articles/6989889[Red{nbsp}Hat Knowledgebase article] for information on how to enable Local Zones.
====
.Prerequisites

* {product-title} is generally available in the parent region of choice. See the link:https://aws.amazon.com/about-aws/global-infrastructure/localzones/locations/?pg=ln&cp=bn#GA[AWS generally available locations list] to determine the Local Zone available to specific AWS regions.
* The {product-title} cluster was initially built in an existing Amazon VPC (BYO-VPC).
* The maximum transmission unit (MTU) for the {product-title} cluster is set at 1200.
+
[IMPORTANT]
====
Generally, the Maximum Transmission Unit (MTU) between an Amazon EC2 instance in a Local Zone and an Amazon EC2 instance in the Region is 1300. See link:https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html[How Local Zones work] in the AWS documentation.
The cluster network MTU must always be less than the EC2 MTU to account for the overhead. The specific overhead is determined by your network plugin, for example:
- OVN-Kubernetes: `100 bytes`
- OpenShift SDN: `50 bytes`

The network plugin could provide additional features that may also decrease the MTU. Check the documentation for additional information.

====
* The AWS account has link:https://docs.aws.amazon.com/local-zones/latest/ug/getting-started.html#getting-started-find-local-zone[Local Zones enabled].
* The AWS account has a link:https://docs.aws.amazon.com/local-zones/latest/ug/getting-started.html#getting-started-create-local-zone-subnet[Local Zone subnet] for the same VPC as the cluster.
* The AWS account has a subnet that is associated with a routing table that has a route to a NAT gateway.
* The AWS account has the tag `kubernetes.io/cluster/<infra_id>: shared' on the associated subnet.

.Procedure

. Create a machine pool on the cluster by running the following ROSA CLI (`rosa`) command.
+
[source,terminal]
----
$ rosa create machinepool -c <cluster-name> -i
----
+
. Add the subnet and instance type for the machine pool in the ROSA CLI. After several minutes, the cluster will provision the nodes.
+
[source,terminal]
----
I: Enabling interactive mode <1>
? Machine pool name: xx-lz-xx <2>
? Create multi-AZ machine pool: No <3>
? Select subnet for a single AZ machine pool (optional): Yes <4>
? Subnet ID: subnet-<a> (region-info) <5>
? Enable autoscaling (optional): No <6>
? Replicas: 2 <7>
I: Fetching instance types <8>
? disk-size (optional): <9>
----
+

<1> Enables interactive mode.
<2> Names the machine pool. This is limited to alphanumeric and a maximum length of 30 characters.
<3> Set this option to no.
<4> Set this option to yes.
<5> Selects a subnet ID from the list.
<6> Select yes to enable autoscaling or no to disable autoscaling.
<7> Selects the number of machines for the machine pool. This number can be anywhere from 1 - 180.
<8> Selects an instance type from the list. Only instance types that are supported in the selected Local Zone will appear.
<9> Optional: Specifies the worker node disk size. The value can be in GB, GiB, TB, or TiB. Set a numeric value and unit, for example '200GiB'. You cannot separate the digit and the unit. No spaces are allowed.

. Provide the subnet ID to provision the machine pool in the Local Zone.

See the link:https://aws.amazon.com/about-aws/global-infrastructure/localzones/locations/[AWS Local Zones locations] list on AWS for generally available and announced AWS Local Zone locations.