---
title: Installing a cluster with compute nodes on AWS Local Zones
---

# Installing a cluster with compute nodes on AWS Local Zones {#installing-aws-localzone}

You can quickly install an OpenShift Container Platform cluster on Amazon Web Services (AWS) Local Zones by setting the zone names in the edge compute pool of the `install-config.yaml` file, or install a cluster in an existing Amazon Virtual Private Cloud (VPC) with Local Zone subnets.

AWS Local Zones is an infrastructure that place Cloud Resources close to metropolitan regions. For more information, see "AWS Local Zones Documentation".

## Infrastructure prerequisites {#aws-zones-prerequisites_installing-aws-localzone}

Before you install an OpenShift Container Platform cluster on Amazon Web Services (AWS) Local Zones, you must meet several prerequisites.

The following prerequisites must be met:

- You reviewed details about [OpenShift Container Platform installation and update](/openshift-docs-markdown/architecture/architecture-installation#architecture-installation) processes.
- You are familiar with [Selecting a cluster installation method and preparing it for users](/openshift-docs-markdown/installing/overview/installing-preparing#installing-preparing).
- You [configured an AWS account](/openshift-docs-markdown/installing/installing_aws/installing-aws-account#installing-aws-account) to host the cluster.

  > [!WARNING]
  > If you have an AWS profile stored on your computer, it must not use a temporary session token that you generated while using a multifactor authentication device. The cluster continues to use your current AWS credentials to create AWS resources for the entire life of the cluster, so you must use key-based, long-term credentials. To generate appropriate keys, see [Managing Access Keys for IAM Users](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html) in the AWS documentation. You can supply the keys when you run the installation program.
- You downloaded the AWS CLI and installed it on your computer. See [Install the AWS CLI Using the Bundled Installer (Linux, macOS, or UNIX)](https://docs.aws.amazon.com/cli/latest/userguide/install-bundle.html) in the AWS documentation.
- If you use a firewall, you [configured it to allow the sites](/openshift-docs-markdown/installing/install_config/configuring-firewall#configuring-firewall-module_configuring-firewall) that your cluster must access.
- You noted the region and supported [AWS Local Zones locations](https://aws.amazon.com/about-aws/global-infrastructure/localzones/locations) to create the network resources in.
- You read the [AWS Local Zones features](https://aws.amazon.com/about-aws/global-infrastructure/localzones/features/) in the AWS documentation.
- You added permissions for creating network resources that support AWS Local Zones to the Identity and Access Management (IAM) user or role. The following example enables a zone group that can give a user or role access for creating network resources that support AWS Local Zones.

  ```yaml {title="Example of an additional IAM policy with the ec2:ModifyAvailabilityZoneGroup permission attached to an IAM user or role."}
  {
    "Version": "2012-10-17",
    "Statement": [
      {
        "Action": [
          "ec2:ModifyAvailabilityZoneGroup"
        ],
        "Effect": "Allow",
        "Resource": "*"
      }
    ]
  }
  ```

## Cluster limitations in AWS Local Zones {#cluster-limitations-aws-zone_installing-aws-localzone}

Some limitations exist when you try to deploy a cluster with a default installation configuration in an Amazon Web Services (AWS) Local Zone.

> [!IMPORTANT]
> The following list details limitations when deploying a cluster in a pre-configured AWS zone:
>
> - The maximum transmission unit (MTU) between an Amazon EC2 instance in a zone and an Amazon EC2 instance in the Region is `1300`. This causes the cluster-wide network MTU to change according to the network plugin that is used with the deployment.
> - Network resources such as Network Load Balancer (NLB), Classic Load Balancer, and Network Address Translation (NAT) Gateways are not globally supported.
> - For an OpenShift Container Platform cluster on AWS, the AWS Elastic Block Storage (EBS) `gp3` type volume is the default for node volumes and the default for the storage class. This volume type is not globally available on zone locations. By default, the nodes running in zones are deployed with the `gp2` EBS volume. The `gp2-csi` `StorageClass` parameter must be set when creating workloads on zone nodes.

If you want the installation program to automatically create Local Zone subnets for your OpenShift Container Platform cluster, specific configuration limitations apply with this method.

> [!IMPORTANT]
> The following configuration limitation applies when you set the installation program to automatically create subnets for your OpenShift Container Platform cluster:
>
> - When the installation program creates private subnets in AWS Local Zones, the program associates each subnet with the route table of its parent zone. This operation ensures that each private subnet can route egress traffic to the internet by way of NAT Gateways in an AWS Region.
> - If the parent-zone route table does not exist during cluster installation, the installation program associates any private subnet with the first available private route table in the Amazon Virtual Private Cloud (VPC). This approach is valid only for AWS Local Zones subnets in an OpenShift Container Platform cluster.

## About edge compute pools {#edge-machine-pools-aws-local-zones_installing-aws-localzone}

The edge compute pool configuration is common between Amazon Web Services (AWS) Local Zones locations. You can use the edge compute pool to create new labels to deploy applications onto Amazon Web Services (AWS) Local Zones nodes. Edge compute nodes are tainted compute nodes that run in AWS Local Zones locations.

When deploying a cluster that uses Local Zones, consider the following points:

- Amazon EC2 instances in the Local Zones are more expensive than Amazon EC2 instances in the Availability Zones.
- The latency is lower between the applications running in AWS Local Zones and the user. A latency impact exists for some workloads if, for example, ingress traffic is mixed between Local Zones and Availability Zones.

> [!IMPORTANT]
> Generally, the maximum transmission unit (MTU) between an Amazon EC2 instance in a Local Zones and an Amazon EC2 instance in the Region is 1300. The cluster network MTU must be always less than the EC2 MTU to account for the overhead. The specific overhead is determined by the network plugin. For example: OVN-Kubernetes has an overhead of `100 bytes`.
>
> The network plugin can provide additional features, such as IPsec, that also affect the MTU sizing.

OpenShift Container Platform 4.12 introduced a new compute pool, *edge*, that is designed for use in remote zones. The edge compute pool configuration is common between Amazon Web Services (AWS) Local Zones locations. Because of the type and size limitations of resources like EC2 and EBS on Local Zones resources, the default instance type can vary from the traditional compute pool.

The default Elastic Block Store (EBS) for Local Zones locations is `gp2`, which differs from the non-edge compute pool. The instance type used for each Local Zones on an edge compute pool also might differ from other compute pools, depending on the instance offerings on the zone.

The edge compute pool creates new labels that developers can use to deploy applications onto AWS Local Zones nodes. The new labels are:

- `node-role.kubernetes.io/edge=''`
- `machine.openshift.io/zone-type=local-zone`
- `machine.openshift.io/zone-group=$ZONE_GROUP_NAME`

By default, the machine sets for the edge compute pool define the taint of `NoSchedule` to prevent other workloads from spreading on Local Zones instances. Users can only run user workloads if they define tolerations in the pod specification.

**Additional resources**
{._additional-resources}

- [MTU value selection](/openshift-docs-markdown/networking/advanced_networking/changing-cluster-network-mtu#mtu-value-selection_changing-cluster-network-mtu)
- [Changing the MTU for the cluster network](/openshift-docs-markdown/networking/advanced_networking/changing-cluster-network-mtu#nw-ovn-ipsec-enable_configuring-ipsec-ovn)
- [Understanding taints and tolerations](/openshift-docs-markdown/nodes/scheduling/nodes-scheduler-taints-tolerations#nodes-scheduler-taints-tolerations-about_nodes-scheduler-taints-tolerations)
- [Storage classes](/openshift-docs-markdown/storage/understanding-persistent-storage#pvc-storage-class_understanding-persistent-storage)
- [Ingress Controller sharding](/openshift-docs-markdown/networking/ingress_load_balancing/configuring_ingress_cluster_traffic/configuring-ingress-cluster-traffic-ingress-controller#nw-ingress-sharding_configuring-ingress-cluster-traffic-ingress-controller)
- [How Local Zones work (AWS documentation)](https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html)

## Opting in to an AWS Local Zones {#installation-aws-add-zone-locations_installing-aws-localzone}

Create a subnet in an Amazon Web Services (AWS) Local Zones when you need workloads to run physically closer to users or data sources than a standard AWS Local Zones. If you plan to create subnets in AWS Local Zones, you must opt in to each zone group separately.

**Prerequisites**

- You have installed the AWS CLI.
- You have determined an AWS Region for where you want to deploy your OpenShift Container Platform cluster.
- You have attached a permissive IAM policy to a user or role account that opts in to the zone group.

**Procedure**

1. List the zones that are available in your AWS Region by running the following command:

   ```terminal {title="Example command for listing available AWS Local Zones in an AWS Region"}
   $ aws --region "<value_of_AWS_Region>" ec2 describe-availability-zones \
       --query 'AvailabilityZones[].[{ZoneName: ZoneName, GroupName: GroupName, Status: OptInStatus}]' \
       --filters Name=zone-type,Values=local-zone \
       --all-availability-zones
   ```

   Depending on the AWS Region, the list of available zones might be long. The command returns the following fields:

   `ZoneName`
   :   The name of the Local Zones.

   `GroupName`
   :   The group that comprises the zone. To opt in to the Region, save the name.

   `Status`
   :   The status of the Local Zones group. If the status is `not-opted-in`, you must opt in the `GroupName` as described in the next step.
2. Opt in to the zone group on your AWS account by running the following command:

   ```terminal
   $ aws ec2 modify-availability-zone-group \
       --group-name "<value_of_GroupName>" \
       --opt-in-status opted-in
   ```

   `<value_of_GroupName>`
   :   Replace with the name of the group of the Local Zones where you want to create subnets. For example, specify `us-east-1-nyc-1` to use the zone `us-east-1-nyc-1a` (US East New York).

## Obtaining an AWS Marketplace image {#installation-aws-marketplace-subscribe_installing-aws-localzone}

If you are deploying an OpenShift Container Platform cluster by using an Amazon Web Services (AWS) Marketplace image, you must first subscribe through AWS. Subscribing to the offer provides you with the Amazon Machine Image (AMI) ID that the installation program uses to deploy compute nodes.

> [!NOTE]
> You should only modify the RHCOS image for compute machines to use an AWS Marketplace image. Control plane machines and infrastructure nodes do not require an OpenShift Container Platform subscription and use the public RHCOS default image by default, which does not incur subscription costs on your AWS bill. Therefore, you should not modify the cluster default boot image or the control plane boot images. Applying the AWS Marketplace image to them will incur additional licensing costs that cannot be recovered.

**Prerequisites**

- You have an AWS account to buy the offer. This account does not have to be the same account that you use to install the cluster.

**Procedure**

1. Complete the OpenShift Container Platform subscription from the [AWS Marketplace](https://aws.amazon.com/marketplace/fulfillment?productId=59ead7de-2540-4653-a8b0-fa7926d5c845).
2. Record the AMI ID for your specific AWS region. As part of the installation process, you must update the `install-config.yaml` file with this value before deploying the cluster.

   ```yaml {title="Sample install-config.yaml file with AWS Marketplace compute nodes"}
   apiVersion: v1
   baseDomain: example.com
   compute:
   - hyperthreading: Enabled
     name: worker
     platform:
       aws:
         amiID: ami-06c4d345f7c207239
         type: m5.4xlarge
     replicas: 3
   metadata:
     name: test-cluster
   platform:
     aws:
       region: us-east-2
   sshKey: ssh-ed25519 AAAA...
   pullSecret: '{"auths": ...}'
   ```

   where:

   `compute.platform.aws.amiID`
   :   Specifies the AMI ID from your AWS Marketplace subscription.

   `platform.aws.region`
   :   Specifies the `platform.aws.region` parameter. Your AMI ID is associated with a specific AWS region. When creating the installation configuration file, ensure that you select the same AWS region that you specified when configuring your subscription.

## Minimum resource requirements for cluster installation {#installation-minimum-resource-requirements_installing-aws-localzone}

To ensure that your OpenShift Container Platform cluster runs as expected, each cluster machine must meet minimum CPU, memory, and storage requirements.

**Minimum resource requirements**

<table>
<thead>
<tr>
  <th>Machine</th>
  <th>Operating system</th>
  <th>vCPU</th>
  <th>Virtual RAM</th>
  <th>Storage</th>
  <th>Input/Output Per Second (IOPS)</th>
</tr>
</thead>
<tbody>
<tr>
  <td>Bootstrap</td>
  <td>RHCOS</td>
  <td>4</td>
  <td>16 GB</td>
  <td>100 GB</td>
  <td>300</td>
</tr>
<tr>
  <td>Control plane</td>
  <td>RHCOS</td>
  <td>4</td>
  <td>16 GB</td>
  <td>100 GB</td>
  <td>300</td>
</tr>
<tr>
  <td>Compute</td>
  <td>RHCOS</td>
  <td>2</td>
  <td>8 GB</td>
  <td>100 GB</td>
  <td>300</td>
</tr>
</tbody>
</table>

- One vCPU is equal to one physical core when simultaneous multithreading (SMT), or Hyper-Threading, is not enabled. When enabled, use the following formula to calculate the corresponding ratio: (threads per core × cores) × sockets = vCPUs.
- OpenShift Container Platform and Kubernetes are sensitive to disk performance, and Red Hat recommends faster storage, particularly for etcd on the control plane nodes which require a 10 ms p99 fsync duration. On many cloud platforms, storage size and IOPS scale together, so you might need to provision more storage to get enough performance.
- As with all user-provisioned installations, if you choose to use RHEL compute machines in your cluster, you take responsibility for all operating system life cycle management and maintenance, including performing system updates, applying patches, and completing all other required tasks. OpenShift Container Platform 4.10 and later do not support RHEL 7 compute machines.

> [!NOTE]
> In OpenShift Container Platform version 4.22, RHCOS uses RHEL version 9.8, which updates the micro-architecture requirements. Each architecture requires the following minimum instruction set architectures (ISA):
>
> - x86-64 architecture requires x86-64-v2 ISA
> - ARM64 architecture requires ARMv8.0-A ISA
> - ppc64le architecture requires IBM(R) Power9 ISA
> - s390x architecture requires IBM(R) z14 ISA
>
> For more information, see [Architectures](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/9.8_release_notes/index#architectures) in the RHEL documentation.

If an instance type for your platform meets the minimum requirements for cluster machines, it is supported to use in OpenShift Container Platform.

## Tested instance types for AWS {#installation-aws-tested-machine-types_installing-aws-localzone}

To ensure cluster stability and performance, use one of the tested Amazon Web Services (AWS) instance types for your OpenShift Container Platform machines.

The following AWS instance types have been tested with OpenShift Container Platform for use with AWS Local Zones.

> [!NOTE]
> Use the machine types included in the following charts for your AWS instances. If you use an instance type that is not listed in the chart, ensure that the instance size you use matches the minimum resource requirements in "Minimum resource requirements for cluster installation".

See the following machine types based on 64-bit x86 architecture for AWS Local Zones:

- `c5.*`
- `c5d.*`
- `m6i.*`
- `m5.*`
- `r5.*`
- `t3.*`

**Additional resources**
{._additional-resources}

- [AWS Local Zones features (AWS documentation)](https://aws.amazon.com/about-aws/global-infrastructure/localzones/features/)

## Creating the installation configuration file {#installation-generate-aws-user-infra-install-config_installing-aws-localzone}

Generate and customize the installation configuration file that the installation program needs to deploy your cluster.

**Prerequisites**

- You obtained the OpenShift Container Platform installation program for user-provisioned infrastructure and the pull secret for your cluster.
- You checked that you are deploying your cluster to an Amazon Web Services (AWS) Region with an accompanying Red Hat Enterprise Linux CoreOS (RHCOS) AMI published by Red Hat. If you are deploying to an AWS Region that requires a custom AMI, such as an AWS GovCloud Region, you must create the `install-config.yaml` file manually.

**Procedure**

1. Create the `install-config.yaml` file.

   1. Change to the directory that contains the installation program and run the following command:

      ```terminal
      $ ./openshift-install create install-config --dir <installation_directory>
      ```

      For `<installation_directory>`, specify the directory name to store the files that the installation program creates.

      > [!IMPORTANT]
      > Specify an empty directory. Some installation assets, such as bootstrap X.509 certificates have short expiration intervals, so you must not reuse an installation directory. If you want to reuse individual files from another cluster installation, you can copy them into your directory. However, the file names for the installation assets might change between releases. Use caution when copying installation files from an earlier OpenShift Container Platform version.
   2. At the prompts, provide the configuration details for your cloud:

      1. Optional: Select an SSH key to use to access your cluster machines.

         > [!NOTE]
         > For production OpenShift Container Platform clusters on which you want to perform installation debugging or disaster recovery, specify an SSH key that your `ssh-agent` process uses.
      2. Select **aws** as the platform to target.
      3. If you do not have an AWS profile stored on your computer, enter the AWS access key ID and secret access key for the user that you configured to run the installation program.

         > [!NOTE]
         > The AWS access key ID and secret access key are stored in `~/.aws/credentials` in the home directory of the current user on the installation host. You are prompted for the credentials by the installation program if the credentials for the exported profile are not present in the file. Any credentials that you provide to the installation program are stored in the file.
      4. Select the AWS Region to deploy the cluster to.
      5. Select the base domain for the Route 53 service that you configured for your cluster.
      6. Enter a descriptive name for your cluster.
      7. Paste the [pull secret from Red Hat OpenShift Cluster Manager](https://console.redhat.com/openshift/install/pull-secret).
2. Optional: Back up the `install-config.yaml` file.

   > [!IMPORTANT]
   > The `install-config.yaml` file is consumed during the installation process. If you want to reuse the file, you must back it up now.

## Examples of installation configuration files with edge compute pools {#installation-aws-edge-compute-pools-examples_installing-aws-localzone}

See an example `install-config.yaml` file to better understand configurations for edge compute pools.

The following examples show `install-config.yaml` files that contain an edge machine pool configuration.

```yaml {title="Configuration that uses an edge pool with a custom instance type"}
apiVersion: v1
baseDomain: devcluster.openshift.com
metadata:
  name: ipi-edgezone
compute:
- name: edge
  platform:
    aws:
      type: r5.2xlarge
platform:
  aws:
    region: us-west-2
pullSecret: '{"auths": ...}'
sshKey: ssh-ed25519 AAAA...
```

Instance types differ between locations. To verify availability in the Local Zones in which the cluster runs, see the AWS documentation.

```yaml {title="Configuration that uses an edge pool with a custom Amazon Elastic Block Store (EBS) type"}
apiVersion: v1
baseDomain: devcluster.openshift.com
metadata:
  name: ipi-edgezone
compute:
- name: edge
  platform:
    aws:
      zones:
      - us-west-2-lax-1a
      - us-west-2-lax-1b
      - us-west-2-phx-2a
      rootVolume:
        type: gp3
        size: 120
platform:
  aws:
    region: us-west-2
pullSecret: '{"auths": ...}'
sshKey: ssh-ed25519 AAAA...
```

Elastic Block Storage (EBS) types differ between locations. Check the AWS documentation to verify availability in the Local Zones in which the cluster runs.

```yaml {title="Configuration that uses an edge pool with custom security groups"}
apiVersion: v1
baseDomain: devcluster.openshift.com
metadata:
  name: ipi-edgezone
compute:
- name: edge
  platform:
    aws:
      additionalSecurityGroupIDs:
        - sg-1
        - sg-2
platform:
  aws:
    region: us-west-2
pullSecret: '{"auths": ...}'
sshKey: ssh-ed25519 AAAA...
```

For the `additionalSecurityGroupIDs` parameter, specify the name of the security group as it is displayed on the Amazon EC2 console. Ensure that you include the `sg` prefix.

## Customizing the cluster network MTU {#installation-aws-cluster-network-mtu_installing-aws-localzone}

Before you deploy a cluster on AWS, you can customize the cluster network maximum transmission unit (MTU) for your cluster network to meet the needs of your infrastructure.

By default, when you install a cluster with supported Local Zones capabilities, the MTU value for the cluster network is automatically adjusted to the lowest value that the network plugin accepts.

> [!IMPORTANT]
> Setting an unsupported MTU value for EC2 instances that operate in the Local Zones infrastructure can cause issues for your OpenShift Container Platform cluster.

If the Local Zone supports higher MTU values in between EC2 instances in the Local Zone and the AWS Region, you can manually configure the higher value to increase the network performance of the cluster network.

You can customize the MTU for a cluster by specifying the `networking.clusterNetworkMTU` parameter in the `install-config.yaml` configuration file.

> [!IMPORTANT]
> All subnets in Local Zones must support the higher MTU value, so that each node in that zone can successfully communicate with services in the AWS Region and deploy your workloads.

```yaml {title="Example of overwriting the default MTU value"}
apiVersion: v1
baseDomain: devcluster.openshift.com
metadata:
  name: edge-zone
networking:
  clusterNetworkMTU: 8901
compute:
- name: edge
  platform:
    aws:
      zones:
      - us-west-2-lax-1a
      - us-west-2-lax-1b
platform:
  aws:
    region: us-west-2
pullSecret: '{"auths": ...}'
sshKey: ssh-ed25519 AAAA...
```

**Additional resources**
{._additional-resources}

- [AWS resources supported in Local Zones (AWS documentation)](https://docs.aws.amazon.com/local-zones/latest/ug/how-local-zones-work.html#considerations)

## Cluster installation options for an AWS Local Zones environment {#aws-cluster-installation-options-aws-lzs_installing-aws-localzone}

You can install an OpenShift Container Platform cluster on AWS with edge compute nodes defined in Local Zones.

Choose one of the following installation options:

- Fully automated option: Installing a cluster to quickly extend compute nodes to edge compute pools, where the installation program automatically creates infrastructure resources for the OpenShift Container Platform cluster.
- Existing VPC option: Installing a cluster on AWS into an existing VPC, where you supply Local Zones subnets to the `install-config.yaml` file.

## Install a cluster quickly in AWS Local Zones {#installation-cluster-quickly-extend-compute-nodes_installing-aws-localzone}

You can quickly install a cluster on Amazon Web Services (AWS) to extend compute nodes to Local Zones locations.

By using this installation route, the installation program automatically creates network resources and Local Zones subnets for each zone that you defined in your configuration file. To customize the installation, you must modify parameters in the `install-config.yaml` file before you deploy the cluster.

### Modifying an installation configuration file to use Amazon Web Services (AWS) Local Zones {#install-creating-install-config-aws-edge-zones_installing-aws-localzone}

Modify an `install-config.yaml` file to include AWS Local Zones.

**Prerequisites**

- You have configured an AWS account.
- You added your AWS keys and AWS Region to your local AWS profile by running `aws configure`.
- You are familiar with the configuration limitations that apply when you specify the installation program to automatically create subnets for your OpenShift Container Platform cluster.
- You opted in to the Local Zones group for each zone.
- You created an `install-config.yaml` file by using the procedure "Creating the installation configuration file".

**Procedure**

1. Modify the `install-config.yaml` file by specifying Local Zones names in the `platform.aws.zones` property of the edge compute pool.

   ```yaml
   # ...
   platform:
     aws:
       region: <region_name>
   compute:
   - name: edge
     platform:
       aws:
         zones:
         - <local_zone_name>
   #...
   ```

   where:

   `platform.aws.region`
   :   Specifies the AWS Region name.

   `compute.platform.aws.zones`
   :   Specifies the list of Local Zones names to use. The zones must exist in the same AWS Region specified in the `platform.aws.region` field. The following example shows a configuration for installing a cluster in the `us-west-2` AWS Region that extends edge nodes to Local Zones in `Los Angeles` and `Las Vegas` locations:

   ```yaml
   apiVersion: v1
   baseDomain: example.com
   metadata:
     name: cluster-name
   platform:
     aws:
       region: us-west-2
   compute:
   - name: edge
     platform:
       aws:
         zones:
         - us-west-2-lax-1a
         - us-west-2-lax-1b
         - us-west-2-las-1a
   pullSecret: '{"auths": ...}'
   sshKey: 'ssh-ed25519 AAAA...'
   #...
   ```
2. Deploy your cluster.

**Additional resources**
{._additional-resources}

- [Creating the installation configuration file](/openshift-docs-markdown/installing/installing_aws/ipi/installing-aws-localzone#installation-generate-aws-user-infra-install-config_installing-aws-localzone)
- [Cluster limitations in AWS Local Zones](/openshift-docs-markdown/installing/installing_aws/ipi/installing-aws-localzone#cluster-limitations-aws-zone_installing-aws-localzone)
- [Deploying the cluster](/openshift-docs-markdown/installing/installing_aws/ipi/installing-aws-localzone#installation-launching-installer_installing-aws-localzone)

## Installing a cluster in an existing VPC that has Local Zone subnets {#creating-aws-local-zone-environment-existing_installing-aws-localzone}

You can install a cluster into an existing Amazon Virtual Private Cloud (VPC) on Amazon Web Services (AWS). The installation program provisions the rest of the required infrastructure, which you can further customize.

To customize the installation, change parameters in the `install-config.yaml` file before you install the cluster.

Installing a cluster on AWS into an existing VPC requires extending compute nodes to the edge of the Cloud Infrastructure by using AWS Local Zones.

Local Zone subnets extend regular compute nodes to edge networks. Each edge compute nodes runs a user workload. After you create an Amazon Web Service (AWS) Local Zone environment, and you deploy your cluster, you can use edge compute nodes to create user workloads in Local Zone subnets.

> [!NOTE]
> If you want to create private subnets, you must either change the provided CloudFormation template or create your own template.

You can use a provided CloudFormation template to create network resources. Additionally, you can change a template to customize your infrastructure or use the information that they contain to create AWS resources according to your company’s policies.

> [!IMPORTANT]
> The documentation provides the steps for performing an installer-provisioned infrastructure installation for example purposes only. Installing a cluster in an existing VPC requires that you have knowledge of the cloud provider and the installation process of OpenShift Container Platform. You can use a CloudFormation template to assist you with completing these steps or to help model your own cluster installation. Instead of using the CloudFormation template to create resources, you can decide to use other methods for generating these resources.

### Creating a VPC in Amazon Web Services (AWS) {#installation-creating-aws-vpc-localzone_installing-aws-localzone}

You can create a Virtual Private Cloud (VPC), and subnets for all Local Zones locations, in AWS for your OpenShift Container Platform cluster to extend compute nodes to edge locations.

You can further customize your VPC to meet your requirements, including a VPN and route tables. You can also add new Local Zones subnets not included at initial deployment.

You can use the provided CloudFormation template and a custom parameter file to create a stack of AWS resources that represent the VPC.

> [!NOTE]
> If you do not use the provided CloudFormation template to create your AWS infrastructure, you must review the provided information and manually create the infrastructure. If your cluster does not initialize correctly, you might have to contact Red Hat support with your installation logs.

**Prerequisites**

- You configured an AWS account.
- You added your AWS keys and AWS Region to your local AWS profile by running `aws configure`.
- You opted in to the AWS Local Zones on your AWS account.

**Procedure**

1. Create a JSON file that contains the parameter values that the CloudFormation template requires:

   ```json
   [
     {
       "ParameterKey": "VpcCidr",
       "ParameterValue": "10.0.0.0/16"
     },
     {
       "ParameterKey": "AvailabilityZoneCount",
       "ParameterValue": "3"
     },
     {
       "ParameterKey": "SubnetBits",
       "ParameterValue": "12"
     }
   ]
   ```

   where:

   `VpcCidr`
   :   Specifies the CIDR block for the VPC. Use a CIDR block in the format `x.x.x.x/16-24`.

   `AvailabilityZoneCount`
   :   Specifies the number of availability zones to deploy the VPC in. Use an integer between `1` and `3`.

   `SubnetBits`
   :   Specifies the size of each subnet in each availability zone. Use an integer between `5` and `13`, where `5` is `/27` and `13` is `/19`.
2. Go to the section of the documentation named "CloudFormation template for the VPC", and then copy the syntax from the provided template. Save the copied template syntax as a YAML file on your local system. This template describes the VPC that your cluster requires.
3. Launch the CloudFormation template to create a stack of AWS resources that represent the VPC by running the following command:

   > [!IMPORTANT]
   > You must enter the command on a single line.

   ```terminal
   $ aws cloudformation create-stack --stack-name <name> \
        --template-body file://<template>.yaml \
        --parameters file://<parameters>.json
   ```

   where:

   `--stack-name <name>`
   :   Specifies the name for the CloudFormation stack, such as `cluster-vpc`. You need the name of this stack if you remove the cluster.

   `--template-body file://<template>.yaml`
   :   Specifies the relative path to and name of the CloudFormation template YAML file that you saved.

   `--parameters file://<parameters>.json`
   :   Specifies the relative path to and name of the CloudFormation parameters JSON file.

   ```terminal {title="Example output"}
   arn:aws:cloudformation:us-east-1:123456789012:stack/cluster-vpc/dbedae40-2fd3-11eb-820e-12a48460849f
   ```
4. Confirm that the template components exist by running the following command:

   ```terminal
   $ aws cloudformation describe-stacks --stack-name <name>
   ```

   After the `StackStatus` displays `CREATE_COMPLETE`, the output displays values for the following parameters. You must provide these parameter values to the other CloudFormation templates that you run to create your cluster.

   `VpcId`
   :   The ID of your VPC.

   `PublicSubnetIds`
   :   The IDs of the new public subnets.

   `PrivateSubnetIds`
   :   The IDs of the new private subnets.

   `PublicRouteTableId`
   :   The ID of the new public route table ID.

### CloudFormation template for the VPC {#installation-cloudformation-vpc-localzone_installing-aws-localzone}

You can use a CloudFormation template to deploy the VPC that you need for your OpenShift Container Platform cluster.

See the following template:

:::details{title="CloudFormation template for the VPC"}
```yaml
AWSTemplateFormatVersion: 2010-09-09
Description: Template for Best Practice VPC with 1-3 AZs

Parameters:
  VpcCidr:
    AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-4]))$
    ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-24.
    Default: 10.0.0.0/16
    Description: CIDR block for VPC.
    Type: String
  AvailabilityZoneCount:
    ConstraintDescription: "The number of availability zones. (Min: 1, Max: 3)"
    MinValue: 1
    MaxValue: 3
    Default: 1
    Description: "How many AZs to create VPC subnets for. (Min: 1, Max: 3)"
    Type: Number
  SubnetBits:
    ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/19-27.
    MinValue: 5
    MaxValue: 13
    Default: 12
    Description: "Size of each subnet to create within the availability zones. (Min: 5 = /27, Max: 13 = /19)"
    Type: Number

Metadata:
  AWS::CloudFormation::Interface:
    ParameterGroups:
    - Label:
        default: "Network Configuration"
      Parameters:
      - VpcCidr
      - SubnetBits
    - Label:
        default: "Availability Zones"
      Parameters:
      - AvailabilityZoneCount
    ParameterLabels:
      AvailabilityZoneCount:
        default: "Availability Zone Count"
      VpcCidr:
        default: "VPC CIDR"
      SubnetBits:
        default: "Bits Per Subnet"

Conditions:
  DoAz3: !Equals [3, !Ref AvailabilityZoneCount]
  DoAz2: !Or [!Equals [2, !Ref AvailabilityZoneCount], Condition: DoAz3]

Resources:
  VPC:
    Type: "AWS::EC2::VPC"
    Properties:
      EnableDnsSupport: "true"
      EnableDnsHostnames: "true"
      CidrBlock: !Ref VpcCidr
  PublicSubnet:
    Type: "AWS::EC2::Subnet"
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Select [0, !Cidr [!Ref VpcCidr, 6, !Ref SubnetBits]]
      AvailabilityZone: !Select
      - 0
      - Fn::GetAZs: !Ref "AWS::Region"
  PublicSubnet2:
    Type: "AWS::EC2::Subnet"
    Condition: DoAz2
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Select [1, !Cidr [!Ref VpcCidr, 6, !Ref SubnetBits]]
      AvailabilityZone: !Select
      - 1
      - Fn::GetAZs: !Ref "AWS::Region"
  PublicSubnet3:
    Type: "AWS::EC2::Subnet"
    Condition: DoAz3
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Select [2, !Cidr [!Ref VpcCidr, 6, !Ref SubnetBits]]
      AvailabilityZone: !Select
      - 2
      - Fn::GetAZs: !Ref "AWS::Region"
  InternetGateway:
    Type: "AWS::EC2::InternetGateway"
  GatewayToInternet:
    Type: "AWS::EC2::VPCGatewayAttachment"
    Properties:
      VpcId: !Ref VPC
      InternetGatewayId: !Ref InternetGateway
  PublicRouteTable:
    Type: "AWS::EC2::RouteTable"
    Properties:
      VpcId: !Ref VPC
  PublicRoute:
    Type: "AWS::EC2::Route"
    DependsOn: GatewayToInternet
    Properties:
      RouteTableId: !Ref PublicRouteTable
      DestinationCidrBlock: 0.0.0.0/0
      GatewayId: !Ref InternetGateway
  PublicSubnetRouteTableAssociation:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      SubnetId: !Ref PublicSubnet
      RouteTableId: !Ref PublicRouteTable
  PublicSubnetRouteTableAssociation2:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Condition: DoAz2
    Properties:
      SubnetId: !Ref PublicSubnet2
      RouteTableId: !Ref PublicRouteTable
  PublicSubnetRouteTableAssociation3:
    Condition: DoAz3
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      SubnetId: !Ref PublicSubnet3
      RouteTableId: !Ref PublicRouteTable
  PrivateSubnet:
    Type: "AWS::EC2::Subnet"
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Select [3, !Cidr [!Ref VpcCidr, 6, !Ref SubnetBits]]
      AvailabilityZone: !Select
      - 0
      - Fn::GetAZs: !Ref "AWS::Region"
  PrivateRouteTable:
    Type: "AWS::EC2::RouteTable"
    Properties:
      VpcId: !Ref VPC
  PrivateSubnetRouteTableAssociation:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      SubnetId: !Ref PrivateSubnet
      RouteTableId: !Ref PrivateRouteTable
  NAT:
    DependsOn:
    - GatewayToInternet
    Type: "AWS::EC2::NatGateway"
    Properties:
      AllocationId:
        "Fn::GetAtt":
        - EIP
        - AllocationId
      SubnetId: !Ref PublicSubnet
  EIP:
    Type: "AWS::EC2::EIP"
    Properties:
      Domain: vpc
  Route:
    Type: "AWS::EC2::Route"
    Properties:
      RouteTableId:
        Ref: PrivateRouteTable
      DestinationCidrBlock: 0.0.0.0/0
      NatGatewayId:
        Ref: NAT
  PrivateSubnet2:
    Type: "AWS::EC2::Subnet"
    Condition: DoAz2
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Select [4, !Cidr [!Ref VpcCidr, 6, !Ref SubnetBits]]
      AvailabilityZone: !Select
      - 1
      - Fn::GetAZs: !Ref "AWS::Region"
  PrivateRouteTable2:
    Type: "AWS::EC2::RouteTable"
    Condition: DoAz2
    Properties:
      VpcId: !Ref VPC
  PrivateSubnetRouteTableAssociation2:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Condition: DoAz2
    Properties:
      SubnetId: !Ref PrivateSubnet2
      RouteTableId: !Ref PrivateRouteTable2
  NAT2:
    DependsOn:
    - GatewayToInternet
    Type: "AWS::EC2::NatGateway"
    Condition: DoAz2
    Properties:
      AllocationId:
        "Fn::GetAtt":
        - EIP2
        - AllocationId
      SubnetId: !Ref PublicSubnet2
  EIP2:
    Type: "AWS::EC2::EIP"
    Condition: DoAz2
    Properties:
      Domain: vpc
  Route2:
    Type: "AWS::EC2::Route"
    Condition: DoAz2
    Properties:
      RouteTableId:
        Ref: PrivateRouteTable2
      DestinationCidrBlock: 0.0.0.0/0
      NatGatewayId:
        Ref: NAT2
  PrivateSubnet3:
    Type: "AWS::EC2::Subnet"
    Condition: DoAz3
    Properties:
      VpcId: !Ref VPC
      CidrBlock: !Select [5, !Cidr [!Ref VpcCidr, 6, !Ref SubnetBits]]
      AvailabilityZone: !Select
      - 2
      - Fn::GetAZs: !Ref "AWS::Region"
  PrivateRouteTable3:
    Type: "AWS::EC2::RouteTable"
    Condition: DoAz3
    Properties:
      VpcId: !Ref VPC
  PrivateSubnetRouteTableAssociation3:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Condition: DoAz3
    Properties:
      SubnetId: !Ref PrivateSubnet3
      RouteTableId: !Ref PrivateRouteTable3
  NAT3:
    DependsOn:
    - GatewayToInternet
    Type: "AWS::EC2::NatGateway"
    Condition: DoAz3
    Properties:
      AllocationId:
        "Fn::GetAtt":
        - EIP3
        - AllocationId
      SubnetId: !Ref PublicSubnet3
  EIP3:
    Type: "AWS::EC2::EIP"
    Condition: DoAz3
    Properties:
      Domain: vpc
  Route3:
    Type: "AWS::EC2::Route"
    Condition: DoAz3
    Properties:
      RouteTableId:
        Ref: PrivateRouteTable3
      DestinationCidrBlock: 0.0.0.0/0
      NatGatewayId:
        Ref: NAT3
  S3Endpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      PolicyDocument:
        Version: 2012-10-17
        Statement:
        - Effect: Allow
          Principal: '*'
          Action:
          - '*'
          Resource:
          - '*'
      RouteTableIds:
      - !Ref PublicRouteTable
      - !Ref PrivateRouteTable
      - !If [DoAz2, !Ref PrivateRouteTable2, !Ref "AWS::NoValue"]
      - !If [DoAz3, !Ref PrivateRouteTable3, !Ref "AWS::NoValue"]
      ServiceName: !Join
      - ''
      - - com.amazonaws.
        - !Ref 'AWS::Region'
        - .s3
      VpcId: !Ref VPC

Outputs:
  VpcId:
    Description: ID of the new VPC.
    Value: !Ref VPC
  PublicSubnetIds:
    Description: Subnet IDs of the public subnets.
    Value:
      !Join [
        ",",
        [!Ref PublicSubnet, !If [DoAz2, !Ref PublicSubnet2, !Ref "AWS::NoValue"], !If [DoAz3, !Ref PublicSubnet3, !Ref "AWS::NoValue"]]
      ]
  PrivateSubnetIds:
    Description: Subnet IDs of the private subnets.
    Value:
      !Join [
        ",",
        [!Ref PrivateSubnet, !If [DoAz2, !Ref PrivateSubnet2, !Ref "AWS::NoValue"], !If [DoAz3, !Ref PrivateSubnet3, !Ref "AWS::NoValue"]]
      ]
  PublicRouteTableId:
    Description: Public Route table ID
    Value: !Ref PublicRouteTable
  PrivateRouteTableIds:
    Description: Private Route table IDs
    Value:
      !Join [
        ",",
        [
          !Join ["=", [
            !Select [0, "Fn::GetAZs": !Ref "AWS::Region"],
            !Ref PrivateRouteTable
          ]],
          !If [DoAz2,
               !Join ["=", [!Select [1, "Fn::GetAZs": !Ref "AWS::Region"], !Ref PrivateRouteTable2]],
               !Ref "AWS::NoValue"
          ],
          !If [DoAz3,
               !Join ["=", [!Select [2, "Fn::GetAZs": !Ref "AWS::Region"], !Ref PrivateRouteTable3]],
               !Ref "AWS::NoValue"
          ]
        ]
      ]
```
:::

### Creating subnets in Local Zones {#installation-creating-aws-vpc-subnets-lz_installing-aws-localzone}

Before you configure a machine set for edge compute nodes in your OpenShift Container Platform cluster, you must create the subnets in Local Zones.

Complete the following procedure for each Local Zone that you want to deploy compute nodes to.

You can use the provided CloudFormation template and create a CloudFormation stack. You can then use this stack to custom provision a subnet.

> [!NOTE]
> If you do not use the provided CloudFormation template to create your Amazon Web Services (AWS) infrastructure, you must review the provided information and manually create the infrastructure. If your cluster does not initialize correctly, you might have to contact Red Hat support with your installation logs.

**Prerequisites**

- You configured an AWS account.
- You added your AWS keys and region to your local AWS profile by running `aws configure`.
- You opted in to the Local Zones group.

**Procedure**

1. Go to the section of the documentation named "CloudFormation template for the VPC subnet", and copy the syntax from the template. Save the copied template syntax as a YAML file on your local system. This template describes the VPC that your cluster requires.
2. Run the following command to deploy the CloudFormation template, which creates a stack of AWS resources that represent the VPC:

   ```terminal
   $ aws cloudformation create-stack --stack-name <stack_name> \
     --region ${CLUSTER_REGION} \
     --template-body file://<template>.yaml \
     --parameters \
       ParameterKey=VpcId,ParameterValue="${VPC_ID}" \
       ParameterKey=ClusterName,ParameterValue="${CLUSTER_NAME}" \
       ParameterKey=ZoneName,ParameterValue="${ZONE_NAME}" \
       ParameterKey=PublicRouteTableId,ParameterValue="${ROUTE_TABLE_PUB}" \
       ParameterKey=PublicSubnetCidr,ParameterValue="${SUBNET_CIDR_PUB}" \
       ParameterKey=PrivateRouteTableId,ParameterValue="${ROUTE_TABLE_PVT}" \
       ParameterKey=PrivateSubnetCidr,ParameterValue="${SUBNET_CIDR_PVT}"
   ```

   where:

   `<stack_name>`
   :   Specifies the name for the CloudFormation stack, such as `cluster-wl-<local_zone_shortname>`. You need the name of this stack if you remove the cluster.

   `<template>`
   :   Specifies the relative path and the name of the CloudFormation template YAML file that you saved.

   `${VPC_ID}`
   :   Specifies the VPC ID, which is the value `VpcID` in the output of the CloudFormation template for the VPC.

   `${CLUSTER_NAME}`
   :   Specifies the value of `ClusterName` to be used as a prefix of the new AWS resource names.

   `${ZONE_NAME}`
   :   Specifies the value of the Local Zones name to create the subnets.

   `${ROUTE_TABLE_PUB}`
   :   Specifies the `PublicRouteTableId` extracted from the output of the VPC’s CloudFormation stack.

   `${SUBNET_CIDR_PUB}`
   :   Specifies a valid CIDR block that is used to create the public subnet. This block must be part of the VPC CIDR block `VpcCidr`.

   `${ROUTE_TABLE_PVT}`
   :   Specifies the `PrivateRouteTableId` extracted from the output of the VPC’s CloudFormation stack.

   `${SUBNET_CIDR_PVT}`
   :   Specifies a valid CIDR block that is used to create the private subnet. This block must be part of the VPC CIDR block `VpcCidr`.

   ```terminal {title="Example output"}
   arn:aws:cloudformation:us-east-1:123456789012:stack/<stack_name>/dbedae40-820e-11eb-2fd3-12a48460849f
   ```

**Verification**

- Confirm that the template components exist by running the following command:

  ```terminal
  $ aws cloudformation describe-stacks --stack-name <stack_name>
  ```

  After the `StackStatus` displays `CREATE_COMPLETE`, the output displays values for the following parameters. Ensure that you provide these parameter values to the other CloudFormation templates that you run to create for your cluster.

  `PublicSubnetId`
  :   The IDs of the public subnet created by the CloudFormation stack.

  `PrivateSubnetId`
  :   The IDs of the private subnet created by the CloudFormation stack.

### CloudFormation template for the VPC subnet {#installation-cloudformation-subnet-localzone_installing-aws-localzone}

Use the CloudFormation template to deploy the private and public subnets in a zone on Local Zones infrastructure. The template provisions an `AWS::EC2::Subnet` and associates it with a specific Local Zones and VPC route table to reduce latency.

```yaml {title="CloudFormation template for VPC subnets"}
AWSTemplateFormatVersion: 2010-09-09
Description: Template for Best Practice Subnets (Public and Private)

Parameters:
  VpcId:
    Description: VPC ID that comprises all the target subnets.
    Type: String
    AllowedPattern: ^(?:(?:vpc)(?:-[a-zA-Z0-9]+)?\b|(?:[0-9]{1,3}\.){3}[0-9]{1,3})$
    ConstraintDescription: VPC ID must be with valid name, starting with vpc-.*.
  ClusterName:
    Description: Cluster name or prefix name to prepend the Name tag for each subnet.
    Type: String
    AllowedPattern: ".+"
    ConstraintDescription: ClusterName parameter must be specified.
  ZoneName:
    Description: Zone Name to create the subnets, such as us-west-2-lax-1a.
    Type: String
    AllowedPattern: ".+"
    ConstraintDescription: ZoneName parameter must be specified.
  PublicRouteTableId:
    Description: Public Route Table ID to associate the public subnet.
    Type: String
    AllowedPattern: ".+"
    ConstraintDescription: PublicRouteTableId parameter must be specified.
  PublicSubnetCidr:
    AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-4]))$
    ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-24.
    Default: 10.0.128.0/20
    Description: CIDR block for public subnet.
    Type: String
  PrivateRouteTableId:
    Description: Private Route Table ID to associate the private subnet.
    Type: String
    AllowedPattern: ".+"
    ConstraintDescription: PrivateRouteTableId parameter must be specified.
  PrivateSubnetCidr:
    AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-4]))$
    ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-24.
    Default: 10.0.128.0/20
    Description: CIDR block for private subnet.
    Type: String

Resources:
  PublicSubnet:
    Type: "AWS::EC2::Subnet"
    Properties:
      VpcId: !Ref VpcId
      CidrBlock: !Ref PublicSubnetCidr
      AvailabilityZone: !Ref ZoneName
      Tags:
      - Key: Name
        Value: !Join ['-', [!Ref ClusterName, "public", !Ref ZoneName]]

  PublicSubnetRouteTableAssociation:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      SubnetId: !Ref PublicSubnet
      RouteTableId: !Ref PublicRouteTableId

  PrivateSubnet:
    Type: "AWS::EC2::Subnet"
    Properties:
      VpcId: !Ref VpcId
      CidrBlock: !Ref PrivateSubnetCidr
      AvailabilityZone: !Ref ZoneName
      Tags:
      - Key: Name
        Value: !Join ['-', [!Ref ClusterName, "private", !Ref ZoneName]]

  PrivateSubnetRouteTableAssociation:
    Type: "AWS::EC2::SubnetRouteTableAssociation"
    Properties:
      SubnetId: !Ref PrivateSubnet
      RouteTableId: !Ref PrivateRouteTableId

Outputs:
  PublicSubnetId:
    Description: Subnet ID of the public subnets.
    Value:
      !Join ["", [!Ref PublicSubnet]]

  PrivateSubnetId:
    Description: Subnet ID of the private subnets.
    Value:
      !Join ["", [!Ref PrivateSubnet]]
```

**Additional resources**
{._additional-resources}

- [AWS CloudFormation console (AWS documentation)](https://console.aws.amazon.com/cloudformation/)

### Modifying an installation configuration file to use Amazon Web Services (AWS) Local Zones subnets {#installing-aws-edge-zones-custom-vpc-config_installing-aws-localzone}

Modify your `install-config.yaml` file to include Local Zones subnets.

**Prerequisites**

- You created subnets by using the procedure "Creating subnets in Local Zones".
- You created an `install-config.yaml` file by using the procedure "Creating the installation configuration file".

**Procedure**

- Modify the `install-config.yaml` configuration file by specifying Local Zones subnets in the `platform.aws.subnets` parameter.

  ```yaml {title="Example installation configuration file with Local Zones subnets"}
  # ...
  platform:
    aws:
      region: us-west-2
      subnets:
      - publicSubnetId-1
      - publicSubnetId-2
      - publicSubnetId-3
      - privateSubnetId-1
      - privateSubnetId-2
      - privateSubnetId-3
      - publicSubnetId-LocalZone-1
  # ...
  ```

  `platform.aws.subnets` specifies the list of subnet IDs created in the zones: Availability and Local Zones.

**Additional resources**
{._additional-resources}

- [AWS CloudFormation console](https://console.aws.amazon.com/cloudformation)
- [Configuration and credential file settings in the AWS CLI (AWS documentation)](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
- [Deploying the cluster](/openshift-docs-markdown/installing/installing_aws/ipi/installing-aws-localzone#installation-launching-installer_installing-aws-localzone)

## Optional: AWS security groups {#installation-aws-security-groups_installing-aws-localzone}

By default, the installation program creates and attaches security groups to control plane and compute machines. The rules associated with the default security groups cannot be modified.

However, you can apply additional existing AWS security groups, which are associated with your existing VPC, to control plane and compute machines. Applying custom security groups can help you meet the security needs of your organization, in such cases where you need to control the incoming or outgoing traffic of these machines.

As part of the installation process, you apply custom security groups by modifying the `install-config.yaml` file before deploying the cluster.

For more information, see "Edge compute pools and AWS Local Zones".

> [!IMPORTANT]
> By default, AWS allows 5 security groups per network interface. The installation program creates 2 security groups for compute machines and 3 security groups for control plane machines. If you are installing a cluster into a shared VPC, there are three scenarios in which you must increase this quota:
>
> - You specified 4 or more custom security groups for compute machines using the `compute.platform.aws.additionalSecurityGroupIDs` parameter in the `install-config.yaml` file.
> - You specified 3 or more custom security groups for control plane machines using the `controlPlane.platform.aws.additionalSecurityGroupIDs` parameter in the `install-config.yaml` file.
> - You specified 3 or more custom security groups for all machines using the `platform.aws.defaultMachinePlatform` parameter in the `install-config.yaml` file.
>
> You must increase the quota of security groups per network interface to a number greater than or equal to `3 + (number of control plane custom security groups OR number of default machine platform custom security groups)`, or `2 + (number of compute custom security groups OR number of default machine platform custom security groups)`, whichever is higher. If you do not specify a sufficient quota, the installation will succeed, but it will generate `SecurityGroupsPerInterfaceLimitExceeded` errors in the installation log, and the additional security groups will not be applied. The maximum allowed quota is 16 and the maximum number of user-specified security groups is 10.

## Optional: Assign public IP addresses to edge compute nodes {#installing-with-edge-node-public_installing-aws-localzone}

If your workload requires deploying the edge compute nodes in public subnets on Local Zones infrastructure, you can configure the machine set manifests when installing a cluster.

AWS Local Zones infrastructure accesses the network traffic in a specified zone, so applications can take advantage of lower latency when serving end users that are closer to that zone.

The default setting that deploys compute nodes in private subnets might not meet your needs, so consider creating edge compute nodes in public subnets when you want to apply more customization to your infrastructure.

> [!IMPORTANT]
> By default, OpenShift Container Platform deploy the compute nodes in private subnets. For best performance, consider placing compute nodes in subnets that have their Public IP addresses attached to the subnets.
>
> You must create additional security groups, but ensure that you only open the groups' rules over the internet when you really need to.

**Procedure**

1. Change to the directory that contains the installation program and generate the manifest files. Ensure that the installation manifests get created at the `openshift` and `manifests` directory level.

   ```terminal
   $ ./openshift-install create manifests --dir <installation_directory>
   ```
2. Edit the machine set manifest that the installation program generates for the Local Zones, so that the manifest gets deployed in public subnets. Specify `true` for the `spec.template.spec.providerSpec.value.publicIP` parameter.

   ```yaml {title="Example machine set manifest configuration for installing a cluster quickly in Local Zones"}
   spec:
     template:
       spec:
         providerSpec:
           value:
             publicIp: true
             subnet:
               filters:
                 - name: tag:Name
                   values:
                     - ${INFRA_ID}-public-${ZONE_NAME}
   ```

   ```yaml {title="Example machine set manifest configuration for installing a cluster in an existing VPC that has Local Zones subnets"}
   apiVersion: machine.openshift.io/v1beta1
   kind: MachineSet
   metadata:
     name: <infrastructure_id>-edge-<zone>
     namespace: openshift-machine-api
   spec:
     template:
       spec:
         providerSpec:
           value:
             publicIp: true
   ```

## Deploying the cluster {#installation-launching-installer_installing-aws-localzone}

To deploy your OpenShift Container Platform cluster, you initialize installation by running the `openshift-install create cluster` command from the directory that contains the installation program. The installation program provisions the required infrastructure and completes the cluster setup.

> [!IMPORTANT]
> You can run the `create cluster` command of the installation program only once, during initial installation.

**Prerequisites**

- You have configured an account with the cloud platform that hosts your cluster.
- You have the OpenShift Container Platform installation program and the pull secret for your cluster.
- You have verified that the cloud provider account on your host has the correct permissions to deploy the cluster. An account with incorrect permissions causes the installation process to fail with an error message that displays the missing permissions.

**Procedure**

1. In the directory that contains the installation program, initialize the cluster deployment by running the following command:

```terminal
$ ./openshift-install create cluster --dir <installation_directory> \
    --log-level=info
```

where:

- `<installation_directory>`: Specifies the location of your customized `./install-config.yaml` file.
- `--log-level`: Specifies the log level. To view different installation details, specify `warn`, `debug`, or `error` instead of `info`.

1. Optional: Remove or disable the `AdministratorAccess` policy from the IAM account that you used to install the cluster.

   > [!NOTE]
   > The elevated permissions provided by the `AdministratorAccess` policy are required only during installation.

**Verification**

When the cluster deployment completes successfully:

- The terminal displays directions for accessing your cluster, including a link to the web console and credentials for the `kubeadmin` user.
- Credential information also outputs to `<installation_directory>/.openshift_install.log`.

  > [!IMPORTANT]
  > Do not delete the installation program or the files that the installation program creates. Both are required to delete the cluster.

  The following example shows the expected output:

  ```terminal
  ...
  INFO Install complete!
  INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/home/myuser/install_dir/auth/kubeconfig'
  INFO Access the OpenShift web-console here: https://console-openshift-console.apps.mycluster.example.com
  INFO Login to the console with user: "kubeadmin", and password: "password"
  INFO Time elapsed: 36m22s
  ```

  > [!IMPORTANT]
  > - The Ignition config files that the installation program generates contain certificates that expire after 24 hours, which are then renewed at that time. If the cluster is shut down before renewing the certificates and the cluster is later restarted after the 24 hours have elapsed, the cluster automatically recovers the expired certificates. The exception is that you must manually approve the pending `node-bootstrapper` certificate signing requests (CSRs) to recover kubelet certificates. See the documentation for *Recovering from expired control plane certificates* for more information.
  > - It is recommended that you use Ignition config files within 12 hours after they are generated because the 24-hour certificate rotates from 16 to 22 hours after the cluster is installed. By using the Ignition config files within 12 hours, you can avoid installation failure if the certificate update runs during installation.

## Logging in to the cluster by using the CLI {#cli-logging-in-kubeadmin_installing-aws-localzone}

To log in to your cluster as the default system user, export the `kubeconfig` file. This configuration enables the CLI to authenticate and connect to the specific API server created during OpenShift Container Platform installation.

The `kubeconfig` file is specific to a cluster and OpenShift Container Platform generates it during installation.

**Prerequisites**

- You deployed an OpenShift Container Platform cluster.
- You installed the OpenShift CLI (`oc`).

**Procedure**

1. Export the `kubeadmin` credentials by running the following command:

   ```terminal
   $ export KUBECONFIG=<installation_directory>/auth/kubeconfig
   ```

   where:

   `<installation_directory>`
   :   Specifies the path to the directory that stores the installation files.
2. Verify you can run `oc` commands successfully using the exported configuration by running the following command:

   ```terminal
   $ oc whoami
   ```

   ```terminal {title="Example output"}
   system:admin
   ```

**Next steps**

- "Customize your cluster"
- "Remote health reporting"

## Logging in to the cluster by using the web console {#logging-in-by-using-the-web-console_installing-aws-localzone}

To verify that your cluster deployed successfully and access its features, log in to the OpenShift Container Platform web console as the `kubeadmin` user.

**Prerequisites**

- You have access to the installation host.
- You completed a cluster installation and all cluster Operators are available.

**Procedure**

1. Obtain the password for the `kubeadmin` user from the `kubeadmin-password` file on the installation host:

   ```terminal
   $ cat <installation_directory>/auth/kubeadmin-password
   ```

   > [!NOTE]
   > Or, you can obtain the `kubeadmin` password from the `<installation_directory>/.openshift_install.log` log file on the installation host.
2. List the OpenShift Container Platform web console route:

   ```terminal
   $ oc get routes -n openshift-console | grep 'console-openshift'
   ```

   > [!NOTE]
   > Or, you can obtain the OpenShift Container Platform route from the `<installation_directory>/.openshift_install.log` log file on the installation host.

   ```terminal {title="Example output"}
   console     console-openshift-console.apps.<cluster_name>.<base_domain>            console     https   reencrypt/Redirect   None
   ```
3. Navigate to the route detailed in the output of the preceding command in a web browser and log in as the `kubeadmin` user.

**Additional resources**
{._additional-resources}

- [Accessing the web console](/openshift-docs-markdown/web_console/web-console#web-console)

## Verifying nodes that were created with edge compute pool {#machine-edge-pool-review-nodes_installing-aws-localzone}

After you install a cluster that uses AWS Local Zones infrastructure, check the status of the machine that was created by the machine set manifests created during installation.

**Procedure**

1. To check the machine sets created from the subnet you added to the `install-config.yaml` file, run the following command:

   ```terminal
   $ oc get machineset -n openshift-machine-api
   ```

   ```terminal {title="Example output"}
   NAME                                  DESIRED   CURRENT   READY   AVAILABLE   AGE
   cluster-7xw5g-edge-us-east-1-nyc-1a   1         1         1       1           3h4m
   cluster-7xw5g-worker-us-east-1a       1         1         1       1           3h4m
   cluster-7xw5g-worker-us-east-1b       1         1         1       1           3h4m
   cluster-7xw5g-worker-us-east-1c       1         1         1       1           3h4m
   ```
2. To check the machines that were created from the machine sets, run the following command:

   ```terminal
   $ oc get machines -n openshift-machine-api
   ```

   ```terminal {title="Example output"}
   NAME                                        PHASE     TYPE          REGION      ZONE               AGE
   cluster-7xw5g-edge-us-east-1-nyc-1a-wbclh   Running   c5d.2xlarge   us-east-1   us-east-1-nyc-1a   3h
   cluster-7xw5g-master-0                      Running   m6i.xlarge    us-east-1   us-east-1a         3h4m
   cluster-7xw5g-master-1                      Running   m6i.xlarge    us-east-1   us-east-1b         3h4m
   cluster-7xw5g-master-2                      Running   m6i.xlarge    us-east-1   us-east-1c         3h4m
   cluster-7xw5g-worker-us-east-1a-rtp45       Running   m6i.xlarge    us-east-1   us-east-1a         3h
   cluster-7xw5g-worker-us-east-1b-glm7c       Running   m6i.xlarge    us-east-1   us-east-1b         3h
   cluster-7xw5g-worker-us-east-1c-qfvz4       Running   m6i.xlarge    us-east-1   us-east-1c         3h
   ```
3. To check nodes with edge roles, run the following command:

   ```terminal
   $ oc get nodes -l node-role.kubernetes.io/edge
   ```

   ```terminal {title="Example output"}
   NAME                           STATUS   ROLES         AGE    VERSION
   ip-10-0-207-188.ec2.internal   Ready    edge,worker   172m   v1.25.2+d2e245f
   ```

**Additional resources**
{._additional-resources}

- [AWS Local Zones Documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-local-zones)
- [Validating an installation](/openshift-docs-markdown/installing/validation_and_troubleshooting/validating-an-installation#validating-an-installation)
- [Remote health reporting](/openshift-docs-markdown/support/remote_health_monitoring/remote-health-reporting#remote-health-reporting)
