DEVOPS & CLOUD

Building your first Red Hat OpenShift cluster on Verizon 5G Edge

Verizon 5G Edge Blog
6 min readAug 23, 2021

By Ashish Aggarwal, Principal Solutions Architect, Red Hat & Robert Belson, Corporate Strategy, Verizon

This tutorial shows you how to deploy a containerized application onto an OpenShift cluster available on Verizon 5G Edge in an AWS Wavelength Zone.

What is Red Hat OpenShift?

Red Hat® OpenShift® is an open-source container application platform based on the Kubernetes® container orchestrator that supports an enterprise hybrid cloud. Using Verizon 5G Edge, developers can extend their containerized architecture to the network edge by moving worker nodes to mobile edge computing (MEC) zones while keeping the control plane in the parent region (e.g., the traditional Amazon Web Services® [AWS®] region).

In this tutorial, you will launch your first virtual private cloud (VPC) with subnets in the parent region and in AWS Wavelength Zones. After configuring your carrier gateway, you will launch a cluster of worker nodes using OpenShift.

Deploying OpenShift.

The diagram above is a high-level overview of the deployment architecture for OpenShift Container Platform (OCP) in AWS with Wavelength. We first deployed Red Hat OpenShift using the installer-provisioned infrastructure (IPI) method on an existing VPC with predefined subnets. We did this primarily for ease of use but also to avoid exhausting the full CIDR range of the VPC and to provide optionality for additional subnets for the Wavelength Zone.

Creating the AWS environment.

Using our CloudFormation template wavelength-vpc.yaml, we instantiated a VPC with six subnets. Note that we will later add an additional subnet in the Wavelength Zone after instantiating the OCP cluster.

● Three private subnets in the parent region (e.g., us-east-1x)

● Three public subnets in the parent region (e.g., us-east-1x)

Check out Installing a cluster on AWS using CloudFormation templates for more information on creating your VPC for OCP using CloudFormation templates.

Installing the OpenShift cluster.

After provisioning our VPC and subnet, we use the installer-provisioned infrastructure method to launch the OCP cluster within an existing VPC. The cluster creation process should take about 40 minutes to complete.

Using Red Hat Enterprise Linux CoreOS for your OCP nodes, the IPI method will automatically do the following:

● Create your bootstrap node to use during OCP cluster initialization

● Create the control plane machines in AWS that your cluster will use

Last, we will create MachineSets (worker nodes) ourselves in a Wavelength Zone for our cluster. The following steps explain how:

Step 1: Download the OpenShift installer binaries. (Note: You need an account on the Red Hat Console.)

Step 2: Create the cluster config from the OpenShift installer binaries. This action generates a file called install-config.yaml in the directory you specified.

./openshift-install create install-config — dir cluster

In the installation process, set your SSH public key, platform, region, base domain (from route 53), cluster domain and pull secret (from the console).

Check out Installing a cluster on AWS into an existing VPC to learn more.

Step 3: Edit the install-config.yaml file to include the worker node subnets and additional cluster information. Make sure that the zone attributes are AZs in the parent region, and check that replicas are set to zero so that we can define our MachineSets separately.

Next, confirm that the subnets are those defined from the CloudFormation template.

Step 4: Within the network configuration manifest, let’s tweak the maximum transmission unit (MTU) and worker node configuration.

./openshift-install create manifests — dir cluster

cd cluster/manifests

cp cluster-network-02-config.yaml cluster-network-03-config.yaml

vi cluster_network-03-conf.yaml

In this file, change MTU size to 1,188 to accommodate the built-in OpenShiftSDN capability.

Step 5: Create a Wavelength Zone subnet and carrier gateway.

In the VPC subsection of the AWS Console, navigate to Subnets and create a new subnet within the existing VPC you created. Under Availability Zone, select a Wavelength Zone of your choice that corresponds to the metropolitan area where you’d like to deploy your application.

After instantiating the subnet, don’t forget to attach the carrier gateway to your VPC. To learn more about the carrier gateway, visit the docs.

Step 6: Create a MachineSet for the Wavelength Zone.

A MachineSet is a group of machines that have a template of specifications. MachineSets are to the machines as ReplicaSets are to the pods.

We will use the existing MachineSet template and edit it to create a MachineSet within the Wavelength Zone subnet you just created.

In the existing 99_openshift_cluster-api_worker-machineset-0.yaml file, you will need to edit the following attributes:

cd ../openshift

vi 99_openshift_cluster-api_worker-machineset-0.yaml

  1. Under the metadata section, change the name attribute to reflect the Wavelength Zone we’ve selected
  2. Under the instanceType attribute, select either t3.xlarge or r5.2xlarge. Learn more about the available instance types on AWS Wavelength in the docs.
  3. Confirm that the availabilityZone attribute has the Wavelength Zone ID specified (e.g., us-east-1-wl1-nyc-wlz-1)
  4. Specify the subnet-id of the newly created subnet of the Wavelength Zone

When we create the cluster, it will override the default network configurations with the configuration you created in cluster_network-03-conf.yaml. The same logic applies to our work MachineSet with 99_openshift_cluster-api_worker-machineset-0.yaml.

./openshift-install create cluster — dir cluster

Step 7: Once the installation is complete, log in to the web console to see if the cluster is ready and operational.

Deploying an application on the worker node.

To test further, we can deploy an application on the worker node in the Wavelength Zone.

To make sure that our application only runs on the Wavelength Zone subnet, let’s label the node using the zone attribute.

Next, let’s create a project and use the node-selector attribute so that any application deployed in this project runs on the Wavelength Zone node.

Using the OpenShift web UI, we can now navigate to our project, click on Samples, select the Apache HTTP Server 2.4 and click Create application.

Congratulations, your application is now live!

Using the console, you can view the private IP address of the pod or the underlying node in which it was scheduled.

Conclusion

The installer-provisioned infrastructure deployment method can be used to install a stretched OpenShift cluster on Verizon 5G Edge with centralized masters running in traditional AWS availability zones (us-east-1[a,b,c]) and worker nodes running in an AWS Wavelength Zone. By centralizing the control plane, this architecture significantly reduces the footprint of your cluster, allowing developers to maximize use of the MEC infrastructure itself for applications.

--

--

Verizon 5G Edge Blog

Powering the next generation of immersive applications at the network edge.