Massively Scalable Realtime Voting Deployed on Hybrid Cloud
Tags: javascript, kubernetes, docker, cloudnative
Published: 2021-02-08 18:03:17

Hybrid cloud deployments offer the easy scaling of public cloud services combined with the privacy and security of an application deployed on a private cloud or on a private server.

In this article, we'll walk through how to deploy a Node.js application that allows users to vote and see a visualization of results. This application will be hosted on a Red Hat OpenShift cluster, which can be deployed on a private or public cloud. We'll also use Twilio Sync, a public cloud service that is scalable and will manage the real-time communication between browsers.

## Who should read this post?

This post & lab is intended for developers, software architects, DevOps professionals and anyone who wants to know more about Kubernetes or Red Hat OpenShift.

# Table of Contents
* Step 0: [Sign Up & Get Your Red Hat OpenShift Cluster](#step0)
* Step 1: [Get Started with Twilio Sync](#step1)
* Step 2: [Deploy Your Application to Red Hat OpenShift](#step2)
* Step 3: [Link it all Together: Run your Hybrid Cloud Application](#step3)
* [Conclusion & Next Steps](#conclusion)
* [Resources](#resources)

## <a name="step0"></a>Step 0: Get your Red Hat OpenShift Cluster

Red Hat OpenShift is the Enterprise Kubernetes platform. In order to get the benefits of running Red Hat OpenShift you'll need to spin up multiple nodes and pay for a license -- but today, we'll be taking advantage of a free cluster offered by IBM Cloud through their Open Labs project.

**1. [Sign Up for IBM Cloud](https://ibm.biz/BdfJjz).** This will give you an account that you can use to get your cluster.

❗❗❗ Remember to **confirm your email address** by clicking the links that are sent to your email address.

**2. [Sign Up for Twilio](https://www.twilio.com/referral/CtzxUL)**

Twilio is a cloud-based messaging service that we will be using to create a chatbot. We'll be using their Autopilot service, which is free, but the link above will give you some credit that you can use for other Twilio services in the future.

**3. Launch IBM's Red Hat OpenShift Lab**

Visit the [IBM Open Labs page](https://developer.ibm.com/openlabs/openshift) and click on **Launch Lab** under **Lab 1**.

![Red Hat OpenShift labs page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mje4dwpdxudi4b5pwrp.png)

ℹ️ Having issues accessing the OpenShift Labs page? Try clearing any cookies from ibm.com and logging in again, or using a private browser window. Sometimes, cookies can confuse the Lab bot.

## <a name="step1"></a>Step 1: Get Started with Twilio Sync

Create your Twilio account and create a Twilio Sync document.

## <a name="step2"></a>Step 2: Deploy Your Application to Red Hat OpenShift

Red Hat OpenShift makes it ridiculously easy to deploy an application from a GitHub repo, even if you don't have any experience creating a container image. In fact, it will create the image for you using its **source to image** feature. In this step, we'll use the code we've already been looking at as well as source-to-image in order to deploy our hybrid cloud application.

**3. Here is Lizzie's GitHub: https://github.com/drnugent/twilio_voting** (we'll use the tree/3stocks branch)

## <a name="step3"></a>Step 3: Link it all Together: Run your Hybrid Cloud Application

## <a name="conclusion"></a>Conclusion & Next Steps

Congratulations on deploying our massively scalable real-time voting application in a hybrid cloud environment! 🎡⛱️🚀 Just to cover what we've done:

* We deployed a Red Hat OpenShift cluster on IBM Cloud, running Kubernetes to make effective use of our compute resources
* We deployed an application directly from our GitHub repo, automatically building a container image and spinning it up into our production environment
* We used Twilio's cloud services to 

In future posts, we'll explore more about Red Hat OpenShift, hybrid cloud deployments, and cloud native software architecture. Please <a href="https://twitter.com/drnugent"reach out to Dave on Twitter</a> if you'd have ideas for future integrations!

## <a name="resources"></a>Resources
* [IBM Cloud Sign-up](https://ibm.biz/BdfsKC)
* [Twilio Sign-up](https://www.twilio.com/referral/CtzxUL)
* [Twilio Functions Docs](https://www.twilio.com/docs/runtime/functions)
* [Lizzie's Voting GitHub Repo](https://github.com/elizabethsiegle/twilio-sync-realtime-data-vis)
* <a href="https://twitter.com/drnugent">Dave's Twitter (my 
DMs are open!)</a>
* <a href="https://twitter.com/lizziepika">Lizzie's Twitter</a>