Skip to content

Single click installation of RedHat OpenShift with Contrail SDN (on AWS)

Savithru Lokanath edited this page Apr 29, 2018 · 26 revisions

Red Hat OpenShift Origin with Contrail SDN

This tutorial walks you through the installation of Red Hat OpenShift container orchestration platform with Contrail SDN as the CNI on Amazon Web Services (AWS).

It leverages AWS's CloudFormation to launch the stack & takes approximately 30 min for the total installation to complete. The stack builds

  • Red Hat OpenShift Origin v3.7
  • Contrail Networking CNI 5.0

Prerequisites

  • Create an AWS account if you don't have one. Else Login

  • Subscribe to CentOS AMI on AWS marketplace

Installation

  • Click on the button below to launch the stack in AWS

    Launch Stack

  • Once you click on the button, you will be navigated to AWS CloudFormation page. Enter the parameters

    launch-stack

    NOTE: You can leave most of the parameters set to default

     InstanceType:
       Description: EC2 instance type
       Default: t2.xlarge
    
     VpcCIDR:
       Description: CIDR block for the VPC
       Default: 10.10.0.0/16
    
     SubnetCIDR:
       Description: CIDR block for the VPC subnet
       Default: 10.10.10.0/24
    
     MasterIPv4Address:
       Description: Master instance's IPv4 Address
       Default: 10.10.10.10
    
     MinionIPv4Address:
       Description: Minion instance's IPv4 Address
       Default: 10.10.10.11
    
     SSHLocation:
       Description: Allow access to EC2 instances from
       Default: 0.0.0.0/0
    
     InstancePassword:
       Description: Password for the instances
    
     ContrailBuild:
       Description: Contrail build information
       Default: latest
    
  • Wait for the stack to complete. You can monitor the resource creation by clicking on the Events tab

    monitor-stack

  • Once complete, navigate to the Outputs tab & copy the ShellURL value. Login to the instance using the ShellURL & the password you set

    complete-stack

  • Run the script from the master instance's /root directory

     (local-instance)# ssh root@ec2-<public-ip>.us-west-1.compute.amazonaws.com
    
     (master-instance)# cd /root
     (master-instance)# ~/run.sh
    

    run-stack

  • Once the installation is complete, enter the password for "admin" user to login into OpenShift dashboard

     (master-instance)# oadm policy add-cluster-role-to-user cluster-admin admin
     (master-instance)# htpasswd /etc/origin/master/htpasswd admin
    
  • Run post-install validations

     (master-instance)# docker restart $(docker ps | grep -i kube-man | cut -d " " -f1 | head -1)
     (master-instance)# ssh root@$(oc get nodes  | grep -i " Ready" | cut -d " " -f1) iptables -I INPUT 4 -j ACCEPT
     (master-instance)# oc get pods -n kube-system -o wide
    
  • Login to the dashboards (WebUI) of both OpenShift & Contrail. The URL's are listed in the Outputs tab of AWS CloudFormation

    openshift-webui

    contrail-webui

  • Verify all Contrail pods are running healthy, by logging into OpenShift & Contrail dashboards

    OpenShift Dashboard > My Projects > kube-system > Applications > Pods

    contrail-pods

    Contrail Dashboard > Monitor > Infrastructure > Dashboard

    contrail-status

  • Try launching an application using OpenShift dashboard. Follow the example video below

    Build automated scale-out applications using OpenShift & Contrail SDN