Back to the main page

OCI (Oracle Cloud Infrastructure) Load Balancer

Introduction

There has been active development, new features are comming all the time, so this applies for say end of 2018 - start of 2019.
OCI has regions, one is Phoenix, TX, USA. Region usually has three Availability Domain (AD), these are just data centres. They are ~60 miles apart. Virtual Cloud Network (VCN) is regional service. See picture below, we'll use two ADs, each AD has two subnets for this setup.

Create VCN, Virtual Cloud Network

A VCN is regional service, so for Phoenix region, create new VCN. From menu, select "Networking - VCN"

Create SSH keys

Create public/private SSH keys, for launch and ssh into computer instances. Use ssh-keygen command.

Create two compute instances

Create first compute instance

From menu, Compute - Instance - Create instance Take note of public IP, 129.213.50.233. Private IP is on subnet3, see diagram above.

Create second compute instance

Repeat for the second instance, webtwo.

Public IP 129.213.125.34 and private IP is in subnet 4, see diagram above.

Install web servers

Prep work for Load Balancer creation

LB should be in different subnet then instances, and we'll have ingress (incoming traffic) and egress (outgoing traffic) rules. Basically, instances are secure in private subnets, and public Internet traffic is allowed to LB in public subnets.

Create Load Balancer

From menu, Networking - Load Balancer
So, only one LB is created by me, then OCI creates second "LB service" in second subnet, for failover purpose.

Update security list

Basically, each instance has default security list. List has stateful and stateless rules.
So default stateful ingress for newly created instance is :
Allow TCP traffic on destination port 22 (SSH) from source 0.0.0.0/0 and any source port. So you can quickly SSH to it and do work.

Usually when you create ingress rule, things to specify are: stateful or stateless, source stuff and then destination. Then with egress, you define first destination, then source stuff.


Back to the main page