On-Cloud Infrastructure for Production

True to my commitment from the previous article, this weekend’s focus will be a deeper dive into my On-Cloud Infrastructure. While the exact initiation with Amazon Web Services (AWS) eludes my memory, I distinctly recall Lightsail being the inaugural service I provisioned for my project.

Deploying with Lightsail is a breeze—simply select the instance region, zone, and choose the application or OS. The process extends to picking an ideal type aligning with the project’s monthly budget, each type boasting fixed allocations for CPU, RAM, Storage, and monthly Data Transfer. This structure is particularly advantageous for maintaining fixed recurring monthly costs. With the newly acquired advanced user badge, I’m gearing up to transition to Elastic Compute Cloud (EC2). 😊

AWS Cloud

In selecting the production region, I’ve opted for the Asia Pacific (Singapore) region, ap-southeast-1. While AWS now offers a region in Asia Pacific (Jakarta), ap-southeast-3, my preference leans towards the Singapore region. It boasts the broadest array of available Instance Types and Services, and its proximity to Jakarta further enhances its appeal.


In the realm of virtual machines, my preference leans towards Ubuntu 20.04 LTS, gracefully running on the t3a.medium Instance type, equipped with a robust 128GB Elastic Block Store (EBS). Drawing from my Docker-driven endeavors, the t3a.medium instance type emerges as not only the bare minimum but also the epitome of stability for handling production workloads.


Given my reliance on the older Rancher version, v1.6, there’s a corresponding necessity to adhere to Docker’s vintage, v18.09.x-ce, which gracefully accommodates Kubernetes v1.12 for the host environment. While the temptation to explore higher Docker versions was indulged, the outcome proved to be unpredictable and unstable during container execution. As a result, my prudent recommendation aligns with the documentation, advocating for the specified versions for a seamless experience. For detailed guidance, please consult the reference URL provided below.


In the process of registering the EC2 as a Host, it’s imperative to deploy a container equipped with the Rancher agent v1.2.11, validated as the current stable version. While Rancher offers built-in support for cloud providers like AWS, Azure, and Digital Ocean, I opt for a more hands-on approach in the current production scenario. My preference lies in the manual custom registration using bash scripting, providing a tailored and controlled method for seamless integration.


For efficient container data storage, I’ve chosen the path of setting up MySQL on Ubuntu 20.04 LTS. The strategy involves harnessing the host’s capabilities to configure it as a database server, optimizing its computing power, memory, and storage resources to the fullest. While acknowledging that this might not be the optimal setup for a high-availability (HA) production infrastructure, it aligns with the need to keep costs in check, especially considering the personal responsibility for monthly billing.





In my upcoming article, I’ll be delving into the world of Cloudflare, so be sure to stay tuned for an insightful exploration next weekend.