Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Build your next cloud-based PaaS in under an hour

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

August 22, 2016
Matyas Danter
Related topics:
CI/CDContainersDevOpsLinuxKubernetes
Related products:
Red Hat OpenShift Container PlatformRed Hat Enterprise Linux

    The charter of Open Innovation Labs is to help our customers accelerate application development and realize the latest advancements in software delivery, by providing skills, mentoring, and tools. Some of the challenges I frequently hear from customers are those around Platform as a Service (PaaS) environment provisioning and configuration. This article is first in the series of articles that guide you through installation configuration and usage of the Red Hat OpenShift Container Platform
    (OCP) on Amazon Web Services (AWS).

    This installation addresses cloud based security group creation, Amazon Route 53 based DNS, creates a server farm that survives power cycles, and configures OCP for web based authentication and persistent registry. This article and companion video (view below) eliminates the pain-points of a push button installation and validation of a four node Red Hat OCP cluster on AWS.

    By the end of the tutorial, you should have a working Red Hat OCP PaaS that is ready to facilitate your team’s application development and DevOps pipeline.

    Please note: The setup process uses Red Hat Ansible and an enhanced version of the openshift-ansible aws community installer.

    https://www.youtube.com/watch?v=4_ckNfjg_GU

    Installer Enhancements

    Security group set-up necessary for a default installation

    In AWS Security Groups act as a virtual firewall and are used to control traffic between nodes in the OCP cluster. The enhanced installer includes additional Ansible based logic to set up the security group based rules OCP needs for all of its infrastructural pieces.

    Static private and public IP address based configuration

    The Ansible based community AWS provisioner didn’t create EC2 instances with fixed IP addresses. This meant that after initial configuration the OCP environment would work, but would not survive the restart of a cluster. The enhanced installer addresses this by statically assigning in-VPC private IP addresses as well as an individual public elastic IP address to network interfaces tied to each OCP node.

    DNS setup

    The enhanced installer follows a domain naming scheme based on conventions. There are other entries for convenience as well, one of them is to the master node at master-1.<cluster-id>.rht-labs.com.

    OCP infrastructure node set up for public DNS

    In order to view OCP projects via a web browser at a domain name such as <project1>-<app1>.apps-1.openshift.rht-labs.com, the enhanced installer uses the AWS’ DNS service called Route 53 to create a wildcard DNS entry.

    HTTP authentication for OCP web based management console

    The stock installer comes with no authentication configuration. The enhanced installer configures web based authentication with two pre-configured user names. Please refer to the Red Hat OCP documentation on how to further customize authentication.

    OCP persistent docker registry

    The stock installer doesn’t set up a persistent registry, which means that any work performed on the cluster is ephemeral (i.e. doesn’t survive a restart). The enhanced installer mitigates this by configuring OCP to persist the docker registry to a directory.

    Checklist for AWS and the enhanced OCP installer:

    • You possess a key pair that is imported in AWS and configured with your ssh-agent (ssh-add -l ).
    • The ssh key-pair is set up in your environment so you can authenticate without providing a password, i.e.:
      >> ssh ec2-user@bastion.rht-labs.com
      Last login: Thu Jul 28 15:28:57 2016 from some ISP lease
      [ec2-user@ip-172-31-7-21 ~]$
    • You have AWS credentials in order to fill out the values to some variables below.
    • You're picking an empty subnet for OCP install.
    • Your AWS account has limits set to be able to fit 5 more in-VPC Elastic IPs.
    • You have a domain registered and a zone set up via AWS Route 53.
    • You have Ansible v 2.1.0+, Python boto, and git installed

    Create the environment

    1. Edit the text below and paste and execute in a terminal window
    >> export AWS_ACCESS_KEY_ID=[YOUR KEY ID HERE]
    >> export AWS_SECRET_ACCESS_KEY=[YOUR SECRET HERE]
    1. Clone our git repository and change into the cloned directory
    >> git clone https://github.com/rht-labs/openshift-ansible
    
    >> cd openshift-ansible
    1. You will need to fill out some AWS, and Red Hat Subscription related information in the command below in order to have a successful OCP cluster build.
    • cluster_id: arbitrary alphanumeric identifier that you set to associate all nodes of your cluster in AWS, please pick one that is not already present in the AWS account.
    • private_subnet: the first three octets should correspond in ip range to the VPC subnet from section 1 (in bold in section 1), pick an empty subnet
    • rhsm_username and rhsm_password: subscription manager credentials
    • rhsm_pool: pool id that contains the Red Hat OCP entitlements
    >> ansible-playbook  \
    -i inventory/aws/hosts \
    -e \
    'num_masters=1 
    num_nodes=2 
    cluster_id=<cluster id> 
    cluster_env=dev
    num_etcd=0 
    num_infra=1 
    deployment_type=openshift-enterprise 
    private_subnet=<first three octets of subnet ###.###.###> 
    rhsm_username=<RHN username> 
    rhsm_password=<RHN password>
    rhsm_pool=<RHSM Pool ID>
    zone=<DNS zone name> 
    openshift_persist_registry=true 
    cli_ec2_vpc_subnet=<subnet housing private_subnet> 
    cli_ec2_keypair=<ssh keypair name imported to AWS>
    cli_ec2_security_groups=<security group to be created> 
    cli_ec2_image=<RHEL 7 ami ID> 
    cli_os_docker_vol_size=50 
    cli_os_docker_vol_ephemeral=false 
    cli_ec2_region=<aws region e.g. us-east-1>' \
    playbooks/aws/openshift-cluster/launch.yml

    Please note:

    If the installer fails, please run the terminate.yml playbook with the proper cluster_id, zone, and deployment type before attempting to run the launch.yml playbook again. Each launch.yml run attempt should have a distinct cluster id.

    Take these steps to prevent the dynamic inventory from selecting terminated ec2 instances as part of your cluster.

     

    Validate the environment

    Creating the OCP PaaS will take about one hour; once complete you will be able to log in to OCP 3.2 via:

    hostname: https://master-1.<cluster_id>.<zone>:8443/
    username: andrew
    password: r3dh4t1!

    To further configure http based authentication, please follow the Red Hat OCP user guide.

    If you are new to Red Hat OCP, please follow the video to validate that your new PaaS Cluster is operational. The video guides you through project creation using a sample Node.js based container and accessing it at the url scheme

    http://<project>-<app>.apps-1.<cluster_id>.<zone>

    I.e. if you create a project called test and an application called myapp, your OCP cluster is called cluster-1 and the domain name is example.com, upon successfully building your new app it will be accessible at:

    http://test-myapp.apps-1.cluster-1.example.com

    Terminate the environment

    To destroy the environment after testing:

    >> ansible-playbook  \
    -i inventory/aws/hosts \
    -e \
    'cluster_id=<cluster id>
    cluster_env=dev
    deployment_type=openshift-enterprise 
    zone=<DNS zone name>' \
    playbooks/aws/openshift-cluster/terminate.yml

    This is just one piece of the activities and work that is underway at Labs. Interested in getting in on the ground floor?

    In subsequent posts, I’ll introduce you to the operational aspects of the Red Hat OpenShift Container Platform and discuss more advanced configuration options.

    About Matyas

    Matyas Danter is a software developer with over a decade of experience, majority of which is server side web development. He is employed by Red Hat's Open Innovation Labs as a Senior Consultant. He has created applications using Java, Groovy, Grails, PHP, AngularJS, Javascript, Korn Shell, Puppet, and Ansbile that measurably improved major company wide processes for his employers. He is a contributor to jBPM, and OptaPlanner. He devotes his free time to maintaining the phpecc elliptic curve cryptography library for PHP.

    Last updated: June 6, 2023

    Recent Posts

    • What's new in OpenShift Container Platform system management

    • Claude as your performance analysis partner

    • LogAn: Large-scale log analysis with small language models

    • stalld’s BPF Backend: Breaking Free from debugfs

    • Running AI inference on Rebellions ATOM NPU with Red Hat AI

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.