<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Cloud - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Cloud - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 18 May 2026 04:49:01 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/cloud/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Build and Deploy a Production-Ready WhatsApp Bot with FastAPI, Evolution API, Docker, EasyPanel, and GCP ]]>
                </title>
                <description>
                    <![CDATA[ WhatsApp bots are widely used for customer support, automated replies, notifications, and internal tools. Instead of relying on expensive third-party platforms, you can build and deploy your own self- ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-build-and-deploy-a-production-ready-whatsapp-bot/</link>
                <guid isPermaLink="false">699877ac3dc17c4862f466c7</guid>
                
                    <category>
                        <![CDATA[ chatbot ]]>
                    </category>
                
                    <category>
                        <![CDATA[ whatsapp ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud Computing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ google cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AI ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Raju Manoj ]]>
                </dc:creator>
                <pubDate>Fri, 20 Feb 2026 15:03:08 +0000</pubDate>
                <media:content url="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/5e1e335a7a1d3fcc59028c64/de480f02-206a-4325-b4c2-788d33d746b1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>WhatsApp bots are widely used for customer support, automated replies, notifications, and internal tools. Instead of relying on expensive third-party platforms, you can build and deploy your own self-hosted WhatsApp bot using modern open-source tools.</p>
<p>In this tutorial, you’ll learn how to build and deploy a production-ready WhatsApp bot using:</p>
<ul>
<li><p>FastAPI</p>
</li>
<li><p>Evolution API</p>
</li>
<li><p>Docker</p>
</li>
<li><p>EasyPanel</p>
</li>
<li><p>Google Cloud Platform (GCP)</p>
</li>
</ul>
<p>By the end of this guide, you will have a fully working WhatsApp bot connected to your own WhatsApp account and deployed on a cloud virtual machine.</p>
<h2 id="heading-table-of-contents"><strong>Table of Contents</strong></h2>
<ul>
<li><p><a href="#heading-how-the-architecture-works">How the Architecture Works</a></p>
</li>
<li><p><a href="#heading-how-your-whatsapp-bot-works">How Your WhatsApp Bot Works</a></p>
</li>
<li><p><a href="#heading-prerequisites">Prerequisites</a></p>
</li>
<li><p><a href="#heading-step-1-create-firewall-rules-on-gcp">Step 1: Create Firewall Rules on GCP</a></p>
</li>
<li><p><a href="#heading-step-2-create-a-virtual-machine-ubuntu-2204">Step 2: Create a Virtual Machine (Ubuntu 22.04)</a></p>
</li>
<li><p><a href="#heading-step-3-ssh-into-the-vm">Step 3: SSH into the VM</a></p>
</li>
<li><p><a href="#heading-step-4-install-docker">Step 4: Install Docker</a></p>
</li>
<li><p><a href="#heading-step-5-install-easypanel">Step 5: Install EasyPanel</a></p>
</li>
<li><p><a href="#heading-step-6-open-the-easypanel-dashboard">Step 6: Open the EasyPanel Dashboard</a></p>
</li>
<li><p><a href="#heading-step-7-deploy-evolution-api">Step 7: Deploy Evolution API</a></p>
</li>
<li><p><a href="#heading-step-8-connect-whatsapp">Step 8: Connect WhatsApp</a></p>
</li>
<li><p><a href="#heading-step-9-deploy-the-fastapi-bot">Step 9: Deploy the FastAPI Bot</a></p>
</li>
<li><p><a href="#heading-step-10-connect-the-webhook-telling-evolution-api-where-to-send-messages">Step 10: Connect the Webhook - Telling Evolution API Where to Send Messages</a></p>
</li>
<li><p><a href="#heading-step-11-final-test">Step 11: Final Test</a></p>
</li>
<li><p><a href="#heading-production-considerations">Production Considerations</a></p>
</li>
<li><p><a href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-how-the-architecture-works">How the Architecture Works</h2>
<p>Before we start installing anything, let’s understand how the system works.</p>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1770444944919/cbcd4016-c98d-4379-9c7c-2d22ab9e309a.png" alt="This diagram shows how a WhatsApp message flows from the user’s WhatsApp app, through WhatsApp servers, into a GCP VM (via firewall, Docker, and EasyPanel) where Evolution API receives it, triggers a FastAPI bot via webhook, processes the logic, and sends the reply back to the user through WhatsApp." width="600" height="400" loading="lazy">

<h2 id="heading-how-your-whatsapp-bot-works">How Your WhatsApp Bot Works</h2>
<p>Before we continue setting things up, let's make sure you understand what's actually happening behind the scenes. Don't worry – no technical experience needed here.</p>
<h3 id="heading-imagine-a-postal-service">Imagine a postal service</h3>
<p>Think of your WhatsApp bot like a very fast, automated postal service:</p>
<ul>
<li><p>Someone sends you a letter (a WhatsApp message)</p>
</li>
<li><p>A postal worker (Evolution API) picks it up and brings it to your office</p>
</li>
<li><p>Your office manager (FastAPI bot) reads it and writes a reply</p>
</li>
<li><p>The postal worker takes the reply back and delivers it</p>
</li>
</ul>
<p>That's it. That's the whole system.</p>
<h3 id="heading-the-7-steps">The 7 steps</h3>
<ol>
<li><p>Someone sends a message to your WhatsApp number – just like texting a friend.</p>
</li>
<li><p>Evolution API notices the message – it's constantly watching your WhatsApp number for new messages, like a receptionist sitting by the phone.</p>
</li>
<li><p>Evolution API passes the message to your bot – it sends the message content to your app and says <em>"hey, you've got a new message!"</em></p>
</li>
<li><p>Your bot reads the message and decides what to say – this is where your code does its job.</p>
</li>
<li><p>Your bot sends the reply back to Evolution API – <em>"okay, send this response."</em></p>
</li>
<li><p>Evolution API delivers the reply through WhatsApp.</p>
</li>
<li><p>The user sees the reply on their phone – usually within seconds.</p>
</li>
</ol>
<h3 id="heading-one-line-summary">One line summary</h3>
<pre><code class="language-plaintext">User → WhatsApp → Evolution API → Your Bot → Evolution API → WhatsApp → User
</code></pre>
<p>Every step in this guide is just setting up one piece of that chain. Once they're all connected, the whole thing runs on its own automatically.</p>
<p>This architecture allows you to automate replies while keeping full control of your infrastructure.</p>
<h3 id="heading-why-these-tools">Why These Tools?</h3>
<p>Let’s briefly understand why we’re using each tool.</p>
<h4 id="heading-fastapi">FastAPI</h4>
<p>FastAPI is a modern Python framework for building APIs. It is fast, lightweight, and ideal for handling webhook requests from Evolution API.</p>
<h4 id="heading-evolution-api">Evolution API</h4>
<p>Evolution API is a self-hosted WhatsApp automation server built on top of Baileys. It connects your personal WhatsApp account without requiring official WhatsApp Business API approval.</p>
<h4 id="heading-docker">Docker</h4>
<p>Docker allows us to run applications in containers. This makes deployments consistent, portable, and production-ready.</p>
<h4 id="heading-easypanel">EasyPanel</h4>
<p>EasyPanel is a graphical platform for managing Docker services. Instead of writing Docker Compose files manually, we use EasyPanel’s UI to deploy and manage our services easily.</p>
<h4 id="heading-google-cloud-platform-gcp">Google Cloud Platform (GCP)</h4>
<p>GCP provides the virtual machine that hosts our infrastructure. We will use an Ubuntu 22.04 server to run Docker, EasyPanel, Evolution API, and our FastAPI bot.</p>
<p>I chose these tools because they are practical, lightweight, and suitable for real-world production deployments.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before starting, make sure you have:</p>
<ul>
<li><p>A Google Cloud, AWS, or Azure account</p>
</li>
<li><p>Billing enabled</p>
</li>
<li><p>A project selected</p>
</li>
<li><p>Access to Cloud Shell</p>
</li>
<li><p>Basic Linux and Docker knowledge</p>
</li>
</ul>
<h2 id="heading-step-1-create-firewall-rules-on-gcp">Step 1: Create Firewall Rules on GCP</h2>
<p>We need to allow traffic to specific ports on our VM. So, we run this command in GCP Cloud Shell:</p>
<pre><code class="language-bash">gcloud compute firewall-rules create easypanel-whatsapp-fw \
 --network default \
 --direction INGRESS \
 --priority 1000 \
 --action ALLOW \
 --rules tcp:22,tcp:80,tcp:443,tcp:3000,tcp:8080,tcp:9000,tcp:5000-5999 \
 --source-ranges 0.0.0.0/0 \
 --description "SSH, EasyPanel, Evolution API, Bot"
</code></pre>
<p>This command:</p>
<ul>
<li><p>Creates a <strong>firewall rule</strong> named <code>easypanel-whatsapp-fw</code></p>
</li>
<li><p>On the <strong>default network</strong></p>
</li>
<li><p>Allows incoming internet traffic (<code>INGRESS</code>)</p>
</li>
<li><p>Opens these ports:</p>
<ul>
<li><p><code>22</code> → SSH (server access)</p>
</li>
<li><p><code>80</code> → HTTP</p>
</li>
<li><p><code>443</code> → HTTPS</p>
</li>
<li><p><code>3000, 8080, 9000</code> → App panels / APIs</p>
</li>
<li><p><code>5000–5999</code> → Custom app range</p>
</li>
</ul>
</li>
<li><p>Allows access from <strong>any IP address</strong> (<code>0.0.0.0/0</code>)</p>
</li>
</ul>
<p>Basically It opens your server so people (and you) can access your apps and services from the internet. This firewall rule allows external traffic to reach your VM.</p>
<h2 id="heading-step-2-create-a-virtual-machine-ubuntu-2204">Step 2: Create a Virtual Machine (Ubuntu 22.04)</h2>
<p>Now we'll create the server that hosts everything. Run the following command in the GCP Cloud Shell to set up a virtual machine with Ubuntu 22.04.</p>
<pre><code class="language-bash">gcloud compute instances create whatsapp-vm \
  --zone=asia-south1-a \
  --machine-type=e2-medium \
  --image-family=ubuntu-2204-lts \
  --image-project=ubuntu-os-cloud \
  --boot-disk-size=30GB \
  --tags=easypanel
</code></pre>
<p>This command creates a new virtual machine (VM) on Google Cloud:</p>
<ul>
<li><p><strong>Name:</strong> <code>whatsapp-vm</code></p>
</li>
<li><p><strong>Location (zone):</strong> <code>asia-south1-a</code> (India region)</p>
</li>
<li><p><strong>Machine size:</strong> <code>e2-medium</code> (2 vCPU, 4GB RAM)</p>
</li>
<li><p><strong>Operating System:</strong> Ubuntu 22.04 LTS</p>
</li>
<li><p><strong>Disk size:</strong> 30GB</p>
</li>
<li><p><strong>Tag:</strong> <code>easypanel</code> (used to apply firewall rules)</p>
</li>
</ul>
<p>This creates a Linux server in Google Cloud that you can use to host EasyPanel, WhatsApp bot, or your APIs.</p>
<p>Note: Wait about one minute for the instance to start.</p>
<h2 id="heading-step-3-ssh-into-the-vm">Step 3: SSH into the VM</h2>
<p>Connect to your server by using SSH to access the virtual machine you just created on Google Cloud.</p>
<pre><code class="language-bash">gcloud compute ssh whatsapp-vm --zone=asia-south1-a
</code></pre>
<p>This command connects to your virtual machine named <code>whatsapp-vm</code> in the zone <code>asia-south1-a</code> using SSH (secure remote login).</p>
<p>It logs you into your Google Cloud server so you can start installing software and running commands. After running this, you will see a terminal prompt – that means you are now inside your Ubuntu server and ready to go.</p>
<h2 id="heading-step-4-install-docker">Step 4: Install Docker</h2>
<p>Docker is needed to run EasyPanel and the Evolution API.</p>
<p><strong>First update the system:</strong></p>
<pre><code class="language-bash">sudo apt update -y
sudo apt install -y curl
</code></pre>
<p>This does two things:</p>
<ol>
<li><p><code>sudo apt update -y</code>→ Updates your server’s package list (refreshes available software info).</p>
</li>
<li><p><code>sudo apt install -y curl</code>→ Installs <strong>curl</strong>, a tool used to download things from the internet using the terminal.</p>
</li>
</ol>
<p>It prepares your server and installs a tool needed to download and install other software.</p>
<p><strong>Then install Docker:</strong></p>
<pre><code class="language-bash">curl -fsSL https://get.docker.com | sudo sh
</code></pre>
<p>This command uses <code>curl</code> to download Docker’s official installation script. The <code>|</code> (pipe) sends it directly to <code>sudo sh</code>, which runs the script as administrator.</p>
<p>It automatically installs <strong>Docker</strong> on your server.</p>
<p>After this finishes, Docker should be installed.</p>
<p><strong>Enable Docker:</strong></p>
<pre><code class="language-bash">sudo systemctl enable docker
sudo systemctl start docker
</code></pre>
<p>This command does two things:</p>
<ol>
<li><p><code>enable docker</code>→ Makes Docker start automatically every time the server reboots.</p>
</li>
<li><p><code>start docker</code>→ Starts Docker right now.</p>
</li>
</ol>
<p>It turns Docker ON now and makes sure it stays ON after restart.</p>
<p><strong>Allow the Ubuntu user to run Docker:</strong></p>
<pre><code class="language-bash">sudo usermod -aG docker ubuntu
</code></pre>
<p>This command adds the user <code>ubuntu</code> to the Docker group.</p>
<p>This is important: By default, you must use <code>sudo</code> before every Docker command.After running this, the Ubuntu user can run Docker without needing sudo every time.</p>
<p>Note: This command assumes your username is <code>ubuntu</code>, which is the default on Google Cloud VMs. If your username is different, replace Ubuntu with your actual username.</p>
<p><strong>Exit the session and reconnect:</strong></p>
<pre><code class="language-bash">exit
gcloud compute ssh whatsapp-vm --zone=asia-south1-a
</code></pre>
<ol>
<li><p><code>exit</code>→ Logs you out of your current server session.</p>
</li>
<li><p><code>gcloud compute ssh whatsapp-vm --zone=asia-south1-a</code>→ Logs you back into your Google Cloud VM.</p>
</li>
</ol>
<p>Why we do this: After adding the <code>ubuntu</code> user to the Docker group, you must log out and log back in for the permission changes to work.</p>
<p><strong>Test Docker:</strong></p>
<pre><code class="language-bash">docker run hello-world
</code></pre>
<p>This command downloads a small test image called <strong>hello-world</strong>, runs it inside Docker, and prints a success message if Docker is working correctly.</p>
<p>It checks if Docker is installed and working properly. If you see “Hello from Docker!”, Docker is working correctly.</p>
<h2 id="heading-step-5-install-easypanel">Step 5: Install EasyPanel</h2>
<p>EasyPanel provides a user interface for deploying Docker services. Run this command in the VM:</p>
<pre><code class="language-bash">curl -sSL https://get.easypanel.io | sudo bash
</code></pre>
<p>This command:</p>
<ul>
<li><p>Downloads the official <strong>EasyPanel installation script</strong></p>
</li>
<li><p>Runs it with administrator (sudo) permission</p>
</li>
<li><p>Automatically installs and configures EasyPanel on your server</p>
</li>
</ul>
<p>It installs EasyPanel on your VM so you can manage apps using a web dashboard instead of commands. Installation takes about one minute.</p>
<h2 id="heading-step-6-open-the-easypanel-dashboard">Step 6: Open the EasyPanel Dashboard</h2>
<p>Once you have your IP address, open a new tab in your browser and type it in like this:</p>
<pre><code class="language-plaintext">http://&lt;YOUR_PUBLIC_IP&gt;:3000
</code></pre>
<p>For example, if your IP was 34.123.45.67, you would type:</p>
<pre><code class="language-plaintext">http://34.123.45.67:3000
</code></pre>
<p>EasyPanel runs on port 3000 by default – that's why we add :3000 at the end. Without it, your browser won't know which service to open on the server.</p>
<p>Create an admin account and log in; the EasyPanel login page will appear.</p>
<p>Click <strong>“Create Admin Account”</strong>.</p>
<p>Fill in:</p>
<ul>
<li><p><strong>Username</strong> (choose something you’ll remember)</p>
</li>
<li><p><strong>Email</strong></p>
</li>
<li><p><strong>Password</strong> (make it strong!)</p>
</li>
<li><p>Submit the form.</p>
</li>
</ul>
<p>You are now logged in as the admin and can start managing apps, APIs, and bots through the EasyPanel dashboard.</p>
<p>You will see a page like the one below:</p>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771478879926/c222ae8c-8714-4af2-a631-c6fead8185e8.png" alt="easypanel page" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<h2 id="heading-step-7-deploy-evolution-api">Step 7: Deploy Evolution API</h2>
<ol>
<li><p>Create a new project (for example: <code>whatsapp-1</code>)</p>
</li>
<li><p>Go to Services → Templates</p>
</li>
<li><p>Select Evolution API</p>
</li>
<li><p>Deploy the latest version</p>
</li>
</ol>
<p>Wait until all services turn green. You will see a page like the one below.</p>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771479080612/ce8453b2-e20e-4c37-b150-de4e032ba794.png" alt="Deploying evolution-api" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p>Next, open Environment Variables and locate:</p>
<pre><code class="language-plaintext">AUTHENTICATION_API_KEY
</code></pre>
<p>Copy the AUTHENTICATION_API_KEY.</p>
<p>Open the Evolution API dashboard</p>
<p>Inside EasyPanel, find your Evolution API service. You will see a clickable domain link – it usually looks something like:</p>
<pre><code class="language-plaintext">https://evolution-api.easypanel.host
</code></pre>
<p>Click that link to open it in your browser. You will see a JSON response confirming the service is running.</p>
<p>Once you open the link, you’ll see a JSON response confirming success. To proceed with login, copy the <strong>Manager link</strong> displayed in the response. This link opens the management dashboard where you can authenticate and begin using the Evolution API. The screenshot below highlights the manager URL along with version details for easy reference</p>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771480117778/017524df-f8be-41bd-9d6c-0ba04b499fe9.png" alt="manager URL" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p>Copy the manager link and open it in a new tab, then copy the AUTHENTICATION_API_KEY, which you did in the previous step. This is how it looks, as you can see below:</p>
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1771480570638/9e18ca51-1637-4261-be22-7cd89ee0459f.png" alt="Evolution manager" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p>Create a new instance:</p>
<ul>
<li><p>Choose channel: <strong>Baileys</strong></p>
</li>
<li><p>Leave phone number blank</p>
</li>
<li><p>Give your instance a name</p>
</li>
</ul>
<p>Save the instance.</p>
<h2 id="heading-step-8-connect-whatsapp">Step 8: Connect WhatsApp</h2>
<p>Inside your instance dashboard:</p>
<ol>
<li><p>Click <strong>Get QR</strong></p>
</li>
<li><p>Scan it using WhatsApp on your phone</p>
</li>
</ol>
<p>Once connected, your chats and contacts will sync automatically. If syncing fails, disconnect and reconnect the session.</p>
<h2 id="heading-step-9-deploy-the-fastapi-bot">Step 9: Deploy the FastAPI Bot</h2>
<p>Now we’ll deploy the bot service.</p>
<h3 id="heading-1-go-to-easypanel">1: Go to EasyPanel</h3>
<p>You’re opening the EasyPanel dashboard you just installed. This is where you can manage apps, servers, and services using a graphical interface instead of terminal commands.</p>
<h3 id="heading-2-create-a-new-project">2: Create a new project</h3>
<p>A “project” is like a container or folder for your bot service. It organizes all files, settings, and deployments for this app.</p>
<h3 id="heading-3-add-an-app-service">3: Add an App service</h3>
<p>“App service” means a running instance of your application. In this case, it will be the WhatsApp bot.</p>
<h3 id="heading-4-choose-git-deployment">4: Choose Git deployment</h3>
<p>Git deployment lets you connect a code repository to EasyPanel.This will automatically download your code from GitHub and run it inside Docker.</p>
<h3 id="heading-5-paste-your-repository-url">5: Paste your repository URL</h3>
<pre><code class="language-plaintext">https://github.com/rajumanoj333/wabot
</code></pre>
<p>This is the GitHub repository containing the WhatsApp bot code. EasyPanel will clone this repo and prepare the app automatically.</p>
<h3 id="heading-6-domains-in-easypanel">6: Domains in EasyPanel</h3>
<p>This section lets you assign a URL or domain name to your app service. Even if you don’t have a custom domain, you can use your server’s public IP. Your WhatsApp bot app runs on port 9000 inside the server.</p>
<h3 id="heading-7-set-the-port-to-9000">7: Set the port to <code>9000</code></h3>
<p>By setting the domain to use port 9000, EasyPanel knows where to send traffic.</p>
<p>Example URL after this step:</p>
<pre><code class="language-plaintext">https://your-project.easypanel.host
</code></pre>
<p>This is the public address people (and other services) will use to reach your bot.</p>
<p>You’re telling EasyPanel:</p>
<blockquote>
<p>“Whenever someone accesses this project, forward them to the bot service running on port 9000.”</p>
</blockquote>
<p>Without this step, the bot service would run but <strong>you wouldn’t be able to access it from your browser or other apps</strong>.</p>
<h3 id="heading-configure-environment-variables">Configure Environment Variables</h3>
<p>Set the following variables:</p>
<pre><code class="language-plaintext">EVOLUTION_API_URL=http://evolution-api:8080
EVOLUTION_API_KEY=YOUR_AUTHENTICATION_API_KEY
INSTANCE_NAME=your_instance_name
</code></pre>
<p>Note: You might notice two different names here – AUTHENTICATION_API_KEY (used in EasyPanel) and EVOLUTION_API_KEY (used in your bot code). They are the same key. Just copy the value from EasyPanel and paste it into both places.</p>
<h2 id="heading-step-10-connect-the-webhook-telling-evolution-api-where-to-send-messages">Step 10: Connect the Webhook – Telling Evolution API Where to Send Messages</h2>
<p>At this point, you have two separate things running:</p>
<ol>
<li><p><strong>Evolution API</strong>: the service that connects to WhatsApp and handles messages</p>
</li>
<li><p><strong>Your app (fastapi bot)</strong>: the chatbot brain you deployed in the previous steps</p>
</li>
</ol>
<p>Right now, these two don't know each other exists. They're like two people in different rooms with no way to pass notes between them. A <strong>webhook</strong> fixes that.</p>
<h3 id="heading-so-what-exactly-is-a-webhook">So what exactly is a webhook?</h3>
<p>A webhook is simply a URL (a web address) that you hand to one service so it can automatically notify another service when something happens.</p>
<p>You're going to tell Evolution API <em>"whenever a WhatsApp message arrives, forward it to this address."</em> Your app will be sitting at that address, waiting to receive it, read it, and send a reply.</p>
<p>Think of it like a forwarding address at the post office. When mail (a WhatsApp message) arrives, it gets automatically redirected to your app's door.</p>
<h3 id="heading-lets-set-it-up">Let's set it up</h3>
<h4 id="heading-1-open-your-evolution-api-dashboard">1. Open your Evolution API dashboard.</h4>
<p>You should already have this open from earlier steps. In the left sidebar, click on <strong>Events</strong>, then click on <strong>Webhook</strong>. This is where you control how Evolution API sends data to your app.</p>
<h4 id="heading-2-turn-the-webhook-on">2. Turn the webhook on.</h4>
<p>At the top of the page, you'll see a toggle next to the word <strong>"Enabled"</strong>. Click it so it turns green. This tells Evolution API that you want to start using a webhook.</p>
<h4 id="heading-3-enter-your-apps-webhook-url">3. Enter your app's webhook URL.</h4>
<p>In the <strong>URL</strong> field, type your app's address with <code>/webhook</code> added to the end, like this:</p>
<pre><code class="language-plaintext">https://your-domain.easypanel.host/webhook
</code></pre>
<p>Replace <code>your-domain</code> with the actual domain name you set up when you deployed your app. The <code>/webhook</code> part at the end is important: it's a specific page your app has set up just for receiving these messages. Without it, Evolution API would be knocking on the wrong door.</p>
<h4 id="heading-4-leave-webhook-by-events-and-webhook-base64-turned-off-for-now">4. Leave "Webhook by Events" and "Webhook Base64" turned off for now.</h4>
<p>These are advanced options you won't need for a basic chatbot.</p>
<h4 id="heading-5-scroll-down-to-the-events-section-and-enable-these-two-events">5. Scroll down to the Events section and enable these two events:</h4>
<ul>
<li><p><strong>MESSAGES_UPSERT</strong>: This triggers every time someone sends your WhatsApp number a message. Without this, your app would never know a message arrived.</p>
</li>
<li><p><strong>SEND_MESSAGE</strong>: This triggers when a message is sent <em>out</em>. It helps your app confirm that replies are going through correctly.</p>
</li>
</ul>
<p>You can leave all the other events (like <code>APPLICATION_STARTUP</code>) turned off. They handle things like group chats and contact updates, which aren't needed for what we're building.</p>
<p><strong>6. Click Save.</strong></p>
<h3 id="heading-quick-recap-of-what-you-just-did">Quick recap of what you just did</h3>
<p>You created a direct line between Evolution API and your app. Now, the moment someone messages your WhatsApp number, Evolution API will instantly pass that message along to your app. Your app reads it, figures out a response, and sends one back all automatically.</p>
<p>This is the step that brings your chatbot to life. Without it, nothing would happen when someone sent you a message. With it, the whole system clicks into place.</p>
<h2 id="heading-step-11-final-test">Step 11: Final Test</h2>
<p>Send a message from a different WhatsApp number (not the connected one).</p>
<p>Send:</p>
<pre><code class="language-plaintext">Hi
</code></pre>
<p>If everything is configured correctly, your bot should reply:</p>
<pre><code class="language-plaintext">👋 Hello! Bot is working.
</code></pre>
<p>Congratulations! Your WhatsApp bot is now live.</p>
<h2 id="heading-production-considerations">Production Considerations</h2>
<p>For real-world deployments, consider:</p>
<ul>
<li><p>Restricting firewall rules instead of allowing 0.0.0.0/0</p>
</li>
<li><p>Using HTTPS with a custom domain</p>
</li>
<li><p>Securing API keys with a secret manager</p>
</li>
<li><p>Monitoring logs and container health</p>
</li>
<li><p>Setting up automatic backups</p>
</li>
</ul>
<p>This tutorial demonstrates the core working system, but these improvements will make your deployment more secure and scalable.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>You now have a fully self-hosted WhatsApp bot running on a cloud VM using FastAPI, Evolution API, Docker, EasyPanel, and GCP.</p>
<p>This setup gives you:</p>
<ul>
<li><p>Full control over infrastructure</p>
</li>
<li><p>No dependency on expensive SaaS platforms</p>
</li>
<li><p>Production-ready container deployment</p>
</li>
<li><p>Scalable architecture</p>
</li>
</ul>
<p>From here, you can extend your bot with:</p>
<p>AI integrations : connect your bot to ChatGPT or Gemini or Claude so it can answer questions intelligently instead of just sending fixed replies.</p>
<p>Database storage: save incoming messages, user details, or conversation history to a database like PostgreSQL or MongoDB.</p>
<p>Custom automation workflows trigger actions based on keywords, like sending a PDF when someone types "menu" or booking an appointment when they type "schedule".</p>
<p>CRM integrations :connect your bot to tools like HubSpot or Notion to automatically log leads and customer conversations.Building your own infrastructure is one of the best ways to deeply understand how modern backend systems work together.</p>
<p>Happy building!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Deploy a Kubernetes App on AWS EKS ]]>
                </title>
                <description>
                    <![CDATA[ AWS makes it much easier to deploy containerized applications, and running Kubernetes in the cloud is a powerful way to scale and manage these applications. Among the many managed Kubernetes services AWS offers, Amazon EKS (Elastic Kubernetes Service... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-deploy-a-kubernetes-app-on-aws-eks/</link>
                <guid isPermaLink="false">68a85abd010317ca95b5506e</guid>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Kubernetes ]]>
                    </category>
                
                    <category>
                        <![CDATA[ deployment ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Ijeoma Igboagu ]]>
                </dc:creator>
                <pubDate>Fri, 22 Aug 2025 11:55:41 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1755863277691/28937c4d-5862-464d-84a1-dfab01a577bb.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>AWS makes it much easier to deploy containerized applications, and running Kubernetes in the cloud is a powerful way to scale and manage these applications.</p>
<p>Among the many managed Kubernetes services AWS offers, Amazon EKS (Elastic Kubernetes Service) stands out for its seamless integration with the AWS ecosystem, strong reliability, and excellent support.</p>
<p>If you’re ready to move beyond local setups and want to deploy a real-world Kubernetes app on AWS EKS, this guide will walk you through the entire process. Whether you’re working on a microservice, a full-stack app, or just experimenting with Kubernetes in an environment that mimics production, you’ll find this walkthrough useful.</p>
<p>In this article, I’ll guide you through the process of creating your EKS cluster, deploying your application, and making it accessible over the internet, step by step.</p>
<h2 id="heading-what-well-cover">What We’ll Cover:</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-prerequisites">Prerequisites</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-what-is-a-kubernetes-cluster">What is a Kubernetes Cluster?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-what-is-amazon-elastic-kubernetes-service">What is Amazon Elastic Kubernetes Service?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-why-use-amazon-eks-for-kubernetes">Why Use Amazon EKS for Kubernetes?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-create-a-kubernetes-cluster-using-aws">How to Create a Kubernetes Cluster Using AWS</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-resources">Resources</a></p>
</li>
</ul>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>To get started, make sure you have the following installed on your local machine:</p>
<ul>
<li><p>Have a basic understanding of cloud services.</p>
</li>
<li><p>Have a basic understanding of the Linux command line.</p>
</li>
<li><p>Have an <a target="_blank" href="https://aws.amazon.com/free/">AWS account</a>.</p>
</li>
<li><p>Install eksctl, a simple CLI tool to create and manage EKS clusters.</p>
</li>
<li><p>Install kubectl, the standard Kubernetes command-line tool.</p>
</li>
<li><p>Install Docker to build and package your app into a container.</p>
</li>
</ul>
<p>Before setting up a Kubernetes cluster for our application, it’s essential to understand a few basic concepts.</p>
<h2 id="heading-what-is-a-kubernetes-cluster"><strong>What is a Kubernetes Cluster?</strong></h2>
<p>A Kubernetes (also called K8S) cluster consists of machines (called nodes) that run containerized applications. It works alongside container engines like <a target="_blank" href="https://cri-o.io/#what-is-cri-o"><strong>CRI-O</strong></a> or <a target="_blank" href="https://containerd.io/"><strong>containerd</strong></a> to help you deploy and manage your apps more efficiently.</p>
<p>Kubernetes nodes come in two main types:</p>
<ul>
<li><p><strong>Master nodes (control plane):</strong> These handle the brainwork, such as scheduling, scaling, and managing the cluster’s overall state.</p>
</li>
<li><p><strong>Worker nodes (data plane):</strong> They run the actual applications inside the containers.</p>
</li>
</ul>
<p>If you're new to Kubernetes or want to brush up, check out the free course <a target="_blank" href="https://training.linuxfoundation.org/training/introduction-to-kubernetes/?lid=axmt8lvbjbl8"><strong>Introduction to Kubernetes (LFS158)</strong></a> from the Linux Foundation.</p>
<h2 id="heading-what-is-amazon-elastic-kubernetes-service">What is Amazon Elastic Kubernetes Service?</h2>
<p>Amazon Elastic Kubernetes Service (EKS) is a managed service that enables easy Kubernetes deployment on AWS, eliminating the need to set up and maintain your own Kubernetes control plane node.</p>
<p>AWS EKS takes care of the heavy lifting by managing the control plane, handling upgrades, and installing core components, such as the container runtime and essential Kubernetes processes. It also offers built-in tools for scaling, high availability, and backup.</p>
<p>With EKS, you or your team can focus on building and running applications, while AWS handles the underlying infrastructure.</p>
<h2 id="heading-why-use-amazon-eks-for-kubernetes"><strong>Why Use Amazon EKS for Kubernetes?</strong></h2>
<p>Here are some key benefits of using AWS EKS:</p>
<ul>
<li><p>EKS handles upgrades, patching, and high availability for you, giving you a fully managed control plane with minimal manual effort.</p>
</li>
<li><p>You can easily scale your applications, and the infrastructure grows as your needs evolve.</p>
</li>
<li><p>It has built-in support for IAM roles, private networking, and encryption.</p>
</li>
<li><p>AWS EKS runs on highly available infrastructure across multiple AWS Availability Zones, making your application available globally.</p>
</li>
<li><p>With Amazon EKS, you get the power of Kubernetes without managing the underlying setup. So you can stay focused on building and running your apps.</p>
</li>
</ul>
<h2 id="heading-how-to-create-a-kubernetes-cluster-using-aws"><strong>How to Create a Kubernetes Cluster Using AWS</strong></h2>
<p>Now let’s walk through the process of getting a Kubernetes cluster up and running.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754818871609/8b0f622a-af82-4a29-bb22-fbdb1a6279bb.png" alt="lets get started" class="image--center mx-auto" width="225" height="225" loading="lazy"></p>
<h3 id="heading-step-1-how-to-install-the-tools-needed-to-create-a-cluster"><strong>Step 1: How to Install the Tools Needed to Create a Cluster</strong></h3>
<p>The easiest and most developer-friendly way to spin up an Elastic Kubernetes Service that you can use at the production level is by using <strong>eksctl</strong>. It takes care of the manual setup and automatically provisions the necessary AWS resources.</p>
<p>Before we begin, we need to install two essential tools:</p>
<ul>
<li><p><strong>eksctl</strong> – This is used to create and manage your EKS cluster.</p>
</li>
<li><p><strong>kubectl</strong> – This allows you to interact with your cluster, deploy apps, and manage Kubernetes resources.</p>
</li>
</ul>
<p>These tools will make it easy to set up your Kubernetes cluster and work with it directly from your terminal.</p>
<h4 id="heading-how-to-install-eksctl">How to Install eksctl</h4>
<p>Open your browser and go to the official <a target="_blank" href="https://eksctl.io/">eksctl</a> documentation. Scroll down to the <strong>Installation</strong> section.</p>
<p>Scroll to the <strong>Unix</strong> instructions if you're using Ubuntu or a similar system. Then copy the installation command and paste it into your terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754819104540/48310ddc-89fb-49b9-990b-ca425ac81e55.gif" alt="Installing eksctl tool" class="image--center mx-auto" width="1920" height="971" loading="lazy"></p>
<p>Once it’s done, run <code>eksctl version</code> to confirm that the installation was successful.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754819269922/69d18189-f3ea-421b-9666-e37c43d7c077.gif" alt="checking the version" class="image--center mx-auto" width="1920" height="1078" loading="lazy"></p>
<h4 id="heading-how-to-install-kubectl">How to Install kubectl</h4>
<p>The next step is to install <a target="_blank" href="https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/">kubectl</a>. You can find the installation instructions in the official Kubernetes documentation, which provides steps based on your operating system.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754819717619/028418cb-424a-4514-a7a7-dfd17c2c03ce.gif" alt="Installing kubectl" class="image--center mx-auto" width="1920" height="971" loading="lazy"></p>
<h3 id="heading-step-2-how-to-create-the-elastic-kubernetes-service-eks-cluster"><strong>Step 2: How to Create the Elastic Kubernetes Service (EKS) Cluster</strong></h3>
<p>Now that you've installed the tools needed to create and interact with a Kubernetes cluster on AWS, it's time to launch the cluster.</p>
<p>To get started, open your terminal and run the following command:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># Create an EKS cluster named "k8s-example" in eu-west-2 (London)</span>
eksctl create cluster --name k8s-example --region eu-west-2
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754820013644/a763f4f1-4b5f-47c2-9c09-3148cb77f579.gif" alt="Creating a terminal in your cluster" class="image--center mx-auto" width="1920" height="1078" loading="lazy"></p>
<p>One great thing about using AWS EKS is that once your Kubernetes cluster is created, it automatically updates your <code>~/.kube/config</code> file. This means you can start interacting with your cluster right away, using <code>kubectl</code> – no extra setup needed.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754825286662/7b7f68a9-72c1-4306-bc09-a0d5c528b900.png" alt="Cluster ready on AWS" width="1437" height="124" loading="lazy"></p>
<p>After running the command (as shown in the GIF above), your Kubernetes cluster is successfully created.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754825194425/a6c611d4-837f-4106-955f-99bdcbb9cf5d.gif" alt="Kubernetes cluster created" width="1920" height="971" loading="lazy"></p>
<p>Head over to the AWS console, and you’ll see your new cluster listed with a status of <strong>Active</strong>.</p>
<p>With your cluster up and running, it’s time to test the connection. You can do this by running a few <code>kubectl</code> commands in your terminal to list the nodes, pods and namespaces in your cluster.</p>
<p><strong>To test the connection:</strong></p>
<pre><code class="lang-bash">kubectl get nodes
</code></pre>
<p>This command lists all the nodes in your cluster.</p>
<pre><code class="lang-bash">kubectl get pods
</code></pre>
<p>This command lists all the pods currently running.</p>
<pre><code class="lang-bash">kubectl get namespaces
</code></pre>
<p>This command lists all the namespaces currently running.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754825006032/4d2e72ff-8eb9-48be-bd90-efffbb840241.png" alt="testing the cluster" width="1226" height="379" loading="lazy"></p>
<p>If each command returns a list of resources, congratulations! Your connection to the Kubernetes cluster is successful.</p>
<h3 id="heading-step-3-how-to-create-kubernetes-manifests"><strong>Step 3: How to Create Kubernetes Manifests</strong></h3>
<p>Let’s define the application using a YAML file. In this file, you’ll create two key resources: a <strong>Deployment</strong> and a <strong>Service</strong>.</p>
<ul>
<li><p>The <strong>Deployment</strong> ensures your application runs reliably by specifying how many replicas to run, which container image to use, and how to manage updates.</p>
</li>
<li><p>The <strong>Service</strong> makes your application accessible — both within the Kubernetes cluster and, if needed, from the internet, even if the underlying pods change or restart.</p>
</li>
</ul>
<p>Together, these resources orchestrate your application so it can run consistently in different environments and be accessed by others.</p>
<pre><code class="lang-yaml"><span class="hljs-comment">#deployment-example.yaml</span>

<span class="hljs-attr">apiVersion:</span> <span class="hljs-string">apps/v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Deployment</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">amazon-deployment</span>
  <span class="hljs-attr">namespace:</span> <span class="hljs-string">default</span>
  <span class="hljs-attr">labels:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">amazon-app</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">replicas:</span> <span class="hljs-number">5</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">matchLabels:</span>
      <span class="hljs-attr">app:</span> <span class="hljs-string">amazon-app</span>
      <span class="hljs-attr">tier:</span> <span class="hljs-string">frontend</span>
      <span class="hljs-attr">version:</span> <span class="hljs-number">1.0</span><span class="hljs-number">.0</span>
  <span class="hljs-attr">template:</span>
    <span class="hljs-attr">metadata:</span>
      <span class="hljs-attr">labels:</span>
        <span class="hljs-attr">app:</span> <span class="hljs-string">amazon-app</span>
        <span class="hljs-attr">tier:</span> <span class="hljs-string">frontend</span>
        <span class="hljs-attr">version:</span> <span class="hljs-number">1.0</span><span class="hljs-number">.0</span>
    <span class="hljs-attr">spec:</span>
      <span class="hljs-attr">containers:</span>
        <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">amazon-container</span>
          <span class="hljs-attr">image:</span> <span class="hljs-string">ooghenekaro/amazon:2</span>
          <span class="hljs-attr">ports:</span>
            <span class="hljs-bullet">-</span> <span class="hljs-attr">containerPort:</span> <span class="hljs-number">3000</span>
<span class="hljs-meta">---</span>
<span class="hljs-attr">apiVersion:</span> <span class="hljs-string">v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Service</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">amazon-service</span>
  <span class="hljs-attr">labels:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">amazon-app</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">type:</span> <span class="hljs-string">LoadBalancer</span>
  <span class="hljs-attr">ports:</span>
    <span class="hljs-bullet">-</span> <span class="hljs-attr">port:</span> <span class="hljs-number">80</span>
      <span class="hljs-attr">targetPort:</span> <span class="hljs-number">3000</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">amazon-app</span>
</code></pre>
<p>The service uses a <strong>LoadBalancer type,</strong> which tells AWS to provision an <strong>Elastic Load Balancer</strong> (ELB) and route traffic to the pods.</p>
<h3 id="heading-step-4-how-to-deploy-the-app-to-eks"><strong>Step 4: How to Deploy the App to EKS</strong></h3>
<p>Now that your YAML file is defined and the Kubernetes cluster on AWS EKS is ready, it’s time to deploy your application. </p>
<p>To do this, run the following command in your terminal to apply the configuration defined in your manifest file: </p>
<pre><code class="lang-bash">kubectl apply -f deployment-example.yaml
</code></pre>
<p>This command tells Kubernetes to create the necessary pods and services based on what’s specified in the manifest file.</p>
<p>Next, you can check the status of your pods and services:</p>
<pre><code class="lang-bash">kubectl get pods
kubectl get svc or service
kubectl get all
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754824866347/8b48e580-d25f-4965-9c29-3609778365f0.png" alt="checking to see if our application is deployed properly" width="1920" height="1078" loading="lazy"></p>
<h3 id="heading-step-5-how-to-access-your-application"><strong>Step 5: How to Access Your Application</strong></h3>
<p>To view your application in the browser, run the following command to list your services:</p>
<pre><code class="lang-yaml"><span class="hljs-string">kubectl</span> <span class="hljs-string">get</span> <span class="hljs-string">svc</span>
</code></pre>
<p>Look for the <strong>EXTERNAL-IP</strong> of your service.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754824764125/b78b8feb-e5da-4d3c-b467-6ccb88d00373.png" alt="Display of the External IP on the browser" width="1920" height="194" loading="lazy"></p>
<p>Copy the IP address and paste it into your browser. Your app should now be live!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1754824488894/821522c0-186f-48fd-8c64-ed29a2ba4447.png" alt="live site" width="1716" height="908" loading="lazy"></p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Deploying a Kubernetes app on AWS EKS may seem complex at first, but with tools like eksctl and kubectl, the process is surprisingly approachable.</p>
<p>Whether you're a developer experimenting with Kubernetes or a team looking to scale production workloads, EKS provides a strong, scalable foundation that supports your applications as they grow.</p>
<h2 id="heading-resources">Resources</h2>
<ul>
<li><p><a target="_blank" href="https://labs.play-with-k8s.com/">Play with Kubernetes</a></p>
</li>
<li><p><a target="_blank" href="https://www.docker.com/101-tutorial/">Docker 101 Tutorial</a></p>
</li>
<li><p><a target="_blank" href="https://dev.to/ijay/how-to-create-a-cicd-using-aws-elastic-beanstalk-15nh">How to Create a CI/CD Pipeline Using AWS Elastic Beanstalk</a></p>
</li>
</ul>
<p>Thanks for reading!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Beginner’s Guide to Cloud Data Analytics ]]>
                </title>
                <description>
                    <![CDATA[ If you want to transform your career and become a data-driven decision maker, this course is for you. freeCodeCamp.org just published a comprehensive Google Cloud Data Analytics course on our YouTube channel. The course was developed by Google Cloud ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/beginners-guide-to-cloud-data-analytics/</link>
                <guid isPermaLink="false">685162a7b5948514b5ab9308</guid>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ data analytics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Tue, 17 Jun 2025 12:42:15 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1749071398844/dd78731e-80d1-4835-bc2b-cbec1ba9a9d3.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you want to transform your career and become a data-driven decision maker, this course is for you. freeCodeCamp.org just published a comprehensive <a target="_blank" href="https://youtu.be/GAdgTK2Esn4">Google Cloud Data Analytics course</a> on our YouTube channel. The course was developed by Google Cloud and helps people earn the Google Cloud Data Analytics Certificate.</p>
<h3 id="heading-why-learn-data-analytics-with-google-cloud">Why Learn Data Analytics with Google Cloud?</h3>
<p>Turning raw numbers into actionable insights is a skill that sets you apart in the job market. As a Cloud Data Analyst, you’ll be able to unlock the stories hidden within massive datasets, helping organizations make smarter, faster decisions.</p>
<p>This course will help you enter that world. It offers a blend of expert instruction, hands-on labs, and real-world projects that will help you build a portfolio to impress employers.</p>
<h3 id="heading-whats-in-the-course">What’s In the Course?</h3>
<p>This course is a carefully curated program developed by Google Cloud, designed to take you from beginner to job-ready. You’ll learn technical skills like SQL, data visualization, and cloud storage. And you’ll also learn how to communicate your findings and drive business impact.</p>
<p>The course is structured to help you build a portfolio of industry-relevant projects, so you can showcase your expertise to potential employers.</p>
<p>Here’s what you’ll learn:</p>
<p><strong>1. Introduction to Data Analytics in Google Cloud</strong><br>Get a solid foundation in cloud data analysis. You’ll define the field, explore the roles and responsibilities of a cloud data analyst, and understand how data analytics drives business value. This module sets the stage for your journey, introducing you to the tools and concepts you’ll use throughout the program.</p>
<p><strong>2. Data Management and Storage in the Cloud</strong><br>Dive into how data is structured, organized, and stored in the cloud. You’ll get hands-on with data lakehouse architecture and tools like BigQuery, learning how to manage data efficiently and securely. This section is crucial for understanding how to handle large-scale datasets in a modern cloud environment.</p>
<p><strong>3. Data Transformation in the Cloud</strong><br>Follow the journey of data from collection to insight. You’ll learn to use SQL and other tools to clean, transform, and prepare data for analysis. By mastering data transformation, you’ll be able to turn messy, raw data into clean, usable information.</p>
<p><strong>4. The Power of Storytelling: How to Visualize Data in the Cloud</strong><br>Master the art of data visualization. This course teaches you how to turn complex data into clear, compelling stories using cloud-based visualization tools, making your insights accessible to any audience. You’ll learn the five key stages of visualizing data in the cloud, from planning to building impactful dashboards.</p>
<p><strong>5. Put It All Together: Prepare for a Cloud Data Analyst Job</strong><br>Apply everything you’ve learned in a capstone project that simulates real-world challenges. You’ll combine your skills in analysis, visualization, and communication to solve a comprehensive data problem, building a portfolio piece that demonstrates your ability to analyze, visualize, and communicate data insights.</p>
<h3 id="heading-learn-by-doing">Learn by Doing</h3>
<p>The course is designed to be watched alongside <a target="_blank" href="https://www.cloudskillsboost.google/paths/420">the Google Cloud Skills Boost platform</a>, where you’ll find interactive labs and practice environments. You get 35 free credits per month for labs, and if you want to move faster, you can pay for unlimited access. These labs give you the chance to practice your skills in real cloud environments, reinforcing your learning with practical experience. Complete the program and you’ll earn a Google Cloud Data Analytics Certificate.</p>
<h3 id="heading-start-your-journey-today">Start Your Journey Today</h3>
<p>Whether you’re just starting out or looking to advance your career, this course is for anyone who wants to harness the power of data. If you’re interested in technology, business, or problem-solving, this course will give you the tools you need to succeed in the fast-growing field of data analytics.</p>
<p>Watch the <a target="_blank" href="https://youtu.be/GAdgTK2Esn4">full course on the freeCodeCamp.org YouTube channel</a> and begin your journey into cloud data analytics (10-hour watch).</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/GAdgTK2Esn4" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Load Balancing with Azure Application Gateway and Azure Load Balancer – When to Use Each One ]]>
                </title>
                <description>
                    <![CDATA[ You’ve probably heard someone mention load balancing when talking about cloud apps. Maybe even names like Azure Load Balancer, Azure Application Gateway, or something about Virtual Machines and Scale Sets. 😵‍💫 It all sounds important...but also a l... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/load-balancing-with-azure-application-gateway-and-azure-load-balancer/</link>
                <guid isPermaLink="false">6824f10a7d203c180e5ea4b2</guid>
                
                    <category>
                        <![CDATA[ Load Balancing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Azure ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Azure Application Gateway ]]>
                    </category>
                
                    <category>
                        <![CDATA[ virtual machine ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ #virtual machine scale set ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Load Balancer ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Prince Onukwili ]]>
                </dc:creator>
                <pubDate>Wed, 14 May 2025 19:37:46 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1747235455030/cb82bfb4-8d7b-47e5-ab31-126906f60b40.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>You’ve probably heard someone mention load balancing when talking about cloud apps. Maybe even names like Azure Load Balancer, Azure Application Gateway, or something about Virtual Machines and Scale Sets. 😵‍💫</p>
<p>It all sounds important...but also a little confusing. Like, why are there so many moving parts? And what do they actually do?</p>
<p>In this guide, we’re going to break it all down – step by step – using real examples and simple language.</p>
<p>You’ll learn:</p>
<ul>
<li><p>What load balancers are (and why apps even need them)</p>
</li>
<li><p>How apps were deployed before load balancers existed (hint: everything lived on one lonely server)</p>
</li>
<li><p>How Azure Virtual Machines work – and how they let you scale up your apps</p>
</li>
<li><p>What Virtual Machine Scale Sets are, and how they help handle sudden traffic spikes</p>
</li>
<li><p>The differences between Azure Load Balancer and Azure Application Gateway, and when to use each</p>
</li>
</ul>
<p>By the end, you won’t just understand what these tools do – you’ll know <em>when</em> and <em>why</em> to use them in real-world scenarios.</p>
<p>Whether you’re a curious beginner, a hands-on builder, or someone just trying to wrap their head around Azure’s ecosystem, this guide is for you.</p>
<p>Ready to untangle the cloud spaghetti? Let’s go! 🍝🚀</p>
<h2 id="heading-table-of-contents">📚 Table of Contents</h2>
<ol>
<li><p><a class="post-section-overview" href="#heading-what-are-load-balancers">🧊 What Are Load Balancers?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-applications-were-deployed-before-load-balancers">🖥️ How Applications Were Deployed Before Load Balancers</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-azure-virtual-machines-vms-the-building-blocks">⚙️ Azure Virtual Machines (VMs) – The Building Blocks</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-the-need-for-scaling-vertical-vs-horizontal">📈 The Need for Scaling – Vertical vs Horizontal</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-azure-virtual-machine-scale-sets-vmss-scaling-made-simple">🔁 Azure Virtual Machine Scale Sets (VMSS) – Scaling Made Simple</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-azure-load-balancer-spreading-the-traffic">📦 Azure Load Balancer – Spreading the Traffic</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-azure-application-gateway-smart-routing-for-modern-apps">🍴 Azure Application Gateway – Smart Routing for Modern Apps</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-azure-load-balancer-vs-azure-application-gateway">🔍 Azure Load Balancer vs Azure Application Gateway</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-use-cases-when-to-use-what">🧭</a> <a class="post-section-overview" href="#heading-use-cases-when-to-use-each-one">Use Cases: When to Use Each One</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">✅ Conclusion</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-study-further">Study Further 📚</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-about-the-author">About the Author 👨‍💻</a></p>
</li>
</ol>
<h2 id="heading-what-are-load-balancers">🧊 What Are Load Balancers?</h2>
<p>Imagine you're running a small restaurant with just one chef in the kitchen. Everything goes smoothly when you have a few customers – each order is prepared one after the other, and everyone leaves satisfied.</p>
<p>But what happens when 50 people walk in all at once?</p>
<p>🍽️ One chef can’t handle that many orders at the same time.<br>⏳ People start waiting longer.<br>😤 Some customers leave.<br>💥 The chef gets overwhelmed – and eventually burns out.</p>
<p>This is what can happen to a server (the computer running your app) when too many users try to access it at the same time.</p>
<h3 id="heading-so-what-does-a-load-balancer-do">So, What Does a Load Balancer Do?</h3>
<p>A <strong>load balancer</strong> is like a smart restaurant manager. But instead of food orders, it handles user requests – the things people do when they open your app, click buttons, or load data.</p>
<p>Let’s say you now have three chefs (servers) instead of one. The load balancer’s job is to:</p>
<ul>
<li><p>👀 Watch for incoming orders (user requests)</p>
</li>
<li><p>🧠 Decide which chef (server) is available or least busy</p>
</li>
<li><p>🍽️ Send that request to the right one</p>
</li>
<li><p>🔁 Repeat this over and over, making sure things stay fast and smooth</p>
</li>
</ul>
<p>So in simple terms, a load balancer takes all the incoming traffic to your app and distributes it across multiple servers so no single server gets overloaded – cool, right? 🙂</p>
<h3 id="heading-why-were-load-balancers-introduced">Why Were Load Balancers Introduced?</h3>
<p>Back in the early days, many applications were hosted on just one machine – called a Single Server Deployment.</p>
<p>That was okay when you had a small number of users. But once things started to grow – more users, more actions, more data – single servers became a bottleneck:</p>
<ul>
<li><p>They could only handle a limited number of requests.</p>
</li>
<li><p>If they went down, your entire app would stop working.</p>
</li>
<li><p>Scaling (adding more power) was expensive and manual.</p>
</li>
</ul>
<p>💡 Enter <strong>load balancers</strong> – designed to solve this by making it possible to:</p>
<ul>
<li><p>Spread traffic across multiple servers (so no one server crashes under pressure),</p>
</li>
<li><p>Replace or restart servers without downtime,</p>
</li>
<li><p>Add or remove servers as needed, depending on how busy your app is (this is called <strong>scaling</strong>).</p>
</li>
</ul>
<h3 id="heading-a-simple-use-case-scenario">A Simple Use-Case Scenario</h3>
<p>Let’s say you're building an online store — your own mini Amazon. At first, you host your app on one Azure Virtual Machine. Things are great. But one day, you run a huge promo and suddenly…thousands of people flood in to browse, shop, and check out.</p>
<p>Your single VM starts lagging.</p>
<p>Orders fail. People complain. Your dream app? Crashing fast. 💥</p>
<p>So what do you do?</p>
<p>You spin up two more VMs to help out – but now you’ve got another problem: <em>How do you divide the traffic between the three?</em></p>
<p>This is where the load balancer steps in. It:</p>
<ul>
<li><p>Looks at every incoming user request</p>
</li>
<li><p>Figures out which VM is available and least busy</p>
</li>
<li><p>Sends the request there</p>
</li>
<li><p>Keeps rotating requests in real-time</p>
</li>
</ul>
<p>And the result?<br>✅ No single VM gets overwhelmed<br>✅ Your app stays fast and responsive<br>✅ Users are happy (and buying stuff again!)</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746980088916/41be330b-8d5b-4709-b07d-3f1a19d641e7.png" alt="Load balancer illustration" class="image--center mx-auto" width="1204" height="672" loading="lazy"></p>
<h2 id="heading-how-applications-were-deployed-before-load-balancers">🖥️ How Applications Were Deployed Before Load Balancers</h2>
<p>Before cloud tools like load balancers came along, the typical way to run an application was pretty simple: You’d deploy the entire app on a single server, like running a small business from one tiny shop.</p>
<h3 id="heading-first-things-first-whats-a-server">First Things First: What’s a Server?</h3>
<p>Think of a server as a special computer that’s always connected to the internet. Its job is to “serve” your app to people when they visit your website, open your app, or use your service.</p>
<p>In cloud platforms like Azure, we usually call these Virtual Machines (VMs) – basically, software-powered servers you can spin up with a few clicks.</p>
<h3 id="heading-monoliths-vs-microservices">Monoliths vs Microservices</h3>
<p>Now, applications come in different “shapes.” The two most common are:</p>
<ul>
<li><p><strong>Monoliths</strong>: Everything is bundled together into one big app. All the code – from user login to shopping cart to checkout – lives in a single unit.</p>
</li>
<li><p><strong>Microservices</strong>: The app is broken into smaller, independent apps (services). Each service does one job – like login, payments, orders – and runs separately.</p>
</li>
</ul>
<h4 id="heading-how-were-these-apps-deployed">How Were These Apps Deployed?</h4>
<p>Whether it was a monolith or a bunch of microservices, they were all usually deployed on a single server (VM).</p>
<p>For monoliths, you just ran the entire app directly on the server. For microservices: you'd run each service in a separate space on that same server, using <strong>containers</strong>.</p>
<h4 id="heading-wait-whats-a-container">Wait — What’s a Container?</h4>
<p>A container is like a mini-computer <em>inside</em> a computer. It has everything an app needs to run – code, tools, settings – and it keeps each app isolated from the others.</p>
<p>Why use containers?</p>
<ul>
<li><p>You can run multiple services on the same server without their underlying software (software needed for each app to run) interfering with each other.</p>
</li>
<li><p>It’s faster and more efficient than installing everything directly on the server.</p>
</li>
<li><p>They make moving apps between environments (for example, test → production) super smooth (no more “But, it works on my machine…”).</p>
</li>
</ul>
<p>Popular tools like Docker make working with containers easy.</p>
<h4 id="heading-connecting-it-all-together-domains-subdomains-and-reverse-proxies">Connecting It All Together: Domains, Subdomains, and Reverse Proxies</h4>
<p>When your app lives on a server, you want people to be able to reach it. That’s where <strong>domain names</strong> come in.</p>
<ul>
<li><p>Your server has a public IP address – a set of numbers like <code>102.80.1.23</code>, that gives it a unique identifier on the public internet</p>
</li>
<li><p>But instead of asking users to type numbers, you link that IP to a domain name, like <code>mycoolapp.com</code></p>
</li>
</ul>
<p>If your app has microservices, you might even assign <strong>subdomains</strong> like:</p>
<ul>
<li><p><code>api.mycoolapp.com</code> for the backend</p>
</li>
<li><p><code>dashboard.mycoolapp.com</code> for the user interface</p>
</li>
<li><p><code>payments.mycoolapp.com</code> for payments</p>
</li>
</ul>
<p>To manage all this, you’d use a <strong>reverse proxy</strong> (like Nginx or Apache). It listens on the main domain and subdomains, and forwards traffic to the right app or service.</p>
<p>Example:</p>
<ul>
<li><p>Someone visits <code>dashboard.mycoolapp.com</code></p>
</li>
<li><p>The reverse proxy checks the domain and forwards the request to the correct container running the dashboard service</p>
</li>
</ul>
<p>And to help with all of this setup – from deploying containers to configuring reverse proxies – there are developer-friendly tools like <a target="_blank" href="https://coolify.io">Coolify</a>. Coolify is an open-source platform that makes it super easy for developers and DevOps teams to:</p>
<ul>
<li><p>Deploy apps in containers</p>
</li>
<li><p>Set up domains and subdomains</p>
</li>
<li><p>Configure reverse proxies – all from a clean dashboard, no complex terminal commands needed</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746979943646/a6525a09-f44a-4e00-a945-7bded3483b0d.jpeg" alt="Coolify dashboard example" class="image--center mx-auto" width="1788" height="853" loading="lazy"></p>
<p>All this was set up on ONE SERVER/VM. But here’s the catch: when that one server got overloaded or went down…💥 everything stopped.</p>
<p>That’s why we needed a better way. And that's where <strong>scaling</strong> and <strong>load balancing</strong> came in – to keep apps running smoothly, no matter the traffic.</p>
<h2 id="heading-azure-virtual-machines-vms-the-building-blocks">⚙️ Azure Virtual Machines (VMs) – The Building Blocks</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746980948928/eb6a7fb2-7432-42ed-8cbd-bff6c8250d4e.jpeg" alt="Virtual Machine illustration" class="image--center mx-auto" width="1280" height="640" loading="lazy"></p>
<p>When it comes to running apps in the cloud, <strong>Virtual Machines (VMs)</strong> are the basic building blocks – kind of like renting an apartment in a giant digital skyscraper.</p>
<p>You don’t need to buy the whole building (aka physical servers), you just rent the space you need, when you need it.</p>
<h3 id="heading-what-exactly-is-a-virtual-machine">What Exactly Is a Virtual Machine?</h3>
<p>A Virtual Machine is a software-based computer that runs inside a real, physical computer (a server) – hosted in a data center, like those run by Microsoft Azure.</p>
<p>It looks and behaves like a normal computer:</p>
<ul>
<li><p>It has an operating system (Windows, Linux)</p>
</li>
<li><p>You can install apps</p>
</li>
<li><p>It has memory (RAM), storage (disks), and CPU</p>
</li>
</ul>
<p>But the best part? You don’t need to worry about the hardware. Azure takes care of that behind the scenes – all you do is say:</p>
<blockquote>
<p>“Hey Azure, give me a Linux VM with 4GB RAM and 2 CPUs.”</p>
</blockquote>
<p>And boom 💥 — it spins up in minutes.</p>
<h3 id="heading-why-use-a-vm">Why Use a VM?</h3>
<p>Let’s say you’ve built a web app – it’s just a simple blog. You want to deploy it and make it accessible to the world.</p>
<p>Here's what you can do with a VM:</p>
<ul>
<li><p>Set it up with your favorite OS (for example, Ubuntu)</p>
</li>
<li><p>Install web servers like Nginx or Apache</p>
</li>
<li><p>Deploy your app</p>
</li>
<li><p>Bind it to your domain name</p>
</li>
<li><p>Let the world visit your blog at <a target="_blank" href="http://myawesomeblog.com"><code>myawesomeblog.com</code></a></p>
</li>
</ul>
<p>It’s your own personal environment – no sharing, full control.</p>
<h2 id="heading-the-need-for-scaling-vertical-vs-horizontal">📈 The Need for Scaling – Vertical vs Horizontal</h2>
<p>Imagine your app is growing. At first, it’s just a few users. Then a few hundred. Then thousands are logging in, placing orders, chatting, uploading photos – all at once 😮</p>
<p>Suddenly, your server (VM) is under pressure. It’s like trying to pour a flood through a straw.</p>
<h3 id="heading-so-what-do-you-do-when-one-server-isnt-enough">So, What Do You Do When One Server Isn’t Enough?</h3>
<p>This is where scaling comes in – the art of upgrading your app’s infrastructure to keep up with traffic.</p>
<p>There are two main ways to scale:</p>
<h4 id="heading-option-1-vertical-scaling-aka-scaling-up">🧱 Option 1: Vertical Scaling (aka Scaling Up)</h4>
<p>You take your existing VM and give it more power:</p>
<ul>
<li><p>Add more CPUs 🧠</p>
</li>
<li><p>Increase RAM 🧵</p>
</li>
<li><p>Add faster disks ⚡</p>
</li>
</ul>
<p>Think of it like upgrading from a regular car to a sports car. It’s the same vehicle, just faster and stronger.</p>
<p><strong>Pros:</strong></p>
<ul>
<li><p>Simple to do</p>
</li>
<li><p>No major changes to your app setup</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p>There’s a limit to how much you can upgrade</p>
</li>
<li><p>Still a single point of failure: if the VM crashes, everything goes down 😬</p>
</li>
</ul>
<h4 id="heading-option-2-horizontal-scaling-aka-scaling-out">🧩 Option 2: Horizontal Scaling (aka Scaling Out)</h4>
<p>Instead of boosting one server, you add more servers – multiple VMs running copies of your app.</p>
<p>Now:</p>
<ul>
<li><p>Users can be distributed across all these VMs</p>
</li>
<li><p>If one goes down, others keep serving traffic</p>
</li>
<li><p>You can <em>dynamically</em> add or remove VMs based on traffic</p>
</li>
</ul>
<p>It’s like opening more checkout counters in a busy supermarket 🛒</p>
<p><strong>Pros:</strong></p>
<ul>
<li><p>The load is evenly distributed. For example, if one server previously handled 100% of the traffic, adding two more servers would result in the traffic being split into approximately 33% to 34% for each server.</p>
</li>
<li><p>Improves both performance and reliability</p>
</li>
<li><p>You can scale based on real-time demand, that is traffic inflow</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p>Needs something to split traffic between VMs – Load Balancers</p>
</li>
<li><p>More expensive. You end up paying the original amount for 1 VM (for example $30) for the number of VMs you provide – if you provide 3 VMs at $30 each, you end up paying $90 at the end of the month</p>
</li>
</ul>
<h3 id="heading-quick-real-world-example">Quick Real-World Example</h3>
<p>Let’s say you’ve launched an e-commerce site for sneakers 👟 Traffic spikes during a big sale? Your vertical scaling (bigger VM) might choke.</p>
<p>But with horizontal scaling:</p>
<ul>
<li><p>You spin up 5 VMs across different regions</p>
</li>
<li><p>Traffic is shared between them</p>
</li>
<li><p>If one VM slows down, others handle the load</p>
</li>
</ul>
<h4 id="heading-so-remember">So, remember 👇🏾</h4>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Scaling Type</td><td>Description</td><td>Pros</td><td>Cons</td></tr>
</thead>
<tbody>
<tr>
<td>🧱 Vertical Scaling</td><td>Make 1 VM more powerful (adding more CPU power, SSD, RAM, bandwidth, and so on)</td><td>Easy setup, fewer changes</td><td>Hardware limits, 1 point of failure - If that 1 server/VM goes down, so does your app :(</td></tr>
<tr>
<td>🧩 Horizontal Scaling</td><td>Add more VMs to handle traffic</td><td>Flexible, reliable</td><td>Needs traffic distribution logic (Load Balancer). Usually more expensive (the price of 1 VM times the number of VMs)</td></tr>
</tbody>
</table>
</div><h2 id="heading-azure-virtual-machine-scale-sets-vmss-scaling-made-simple">🔁 Azure Virtual Machine Scale Sets (VMSS) – Scaling Made Simple</h2>
<p>Okay – so we’ve talked about <strong>horizontal scaling</strong>: adding multiple VMs to handle growing traffic. Sounds great, right?</p>
<p>But here’s the thing: manually spinning up and configuring 5, 10, or 100 VMs... every time your app gets busy? Yeah, that’s not fun 🙃</p>
<h3 id="heading-enter-virtual-machine-scale-sets-vmss">Enter: Virtual Machine Scale Sets (VMSS)</h3>
<p>VMSS is Azure’s way of automating horizontal scaling. Instead of creating each VM one by one, you define a template, and Azure takes care of the rest:</p>
<ul>
<li><p>How many VMs to start with</p>
</li>
<li><p>How to configure them (OS, apps, settings) ⚙️</p>
</li>
<li><p>When to add or remove VMs based on traffic 📈📉</p>
</li>
</ul>
<h3 id="heading-a-simple-analogy">A Simple Analogy 🧃</h3>
<p>Think of VMSS like a juice dispenser at a party:</p>
<ul>
<li><p>At first, it pours into 2 cups (VMs)</p>
</li>
<li><p>If 10 guests show up? It starts filling 5 cups</p>
</li>
<li><p>Party slows down? Back to 2 cups again</p>
</li>
</ul>
<p>You never have to refill manually – the dispenser adjusts on its own. 🎉</p>
<h3 id="heading-how-it-works-without-the-jargon">How It Works (Without the Jargon 😌)</h3>
<ol>
<li><p><strong>You set the rules:</strong> “If CPU usage goes above 70%, add 2 more VMs.”</p>
</li>
<li><p><strong>Azure watches traffic and adjusts the number of VMs</strong> automatically.</p>
</li>
<li><p><strong>All VMs are identical</strong> – like clones, all running the same app setup.</p>
</li>
<li><p><strong>It works with Azure Load Balancer</strong> to spread traffic across all these VMs smoothly.</p>
</li>
</ol>
<h3 id="heading-real-life-example-food-delivery-app">Real-Life Example: Food Delivery App 🍕📱</h3>
<p>You’ve built an app where users order food. During lunch and dinner, traffic explodes.</p>
<p>💡 With VMSS:</p>
<ul>
<li><p>You start with 3 VMs in the morning</p>
</li>
<li><p>At 12PM, Azure sees high CPU usage, so it spins up 5 more VMs</p>
</li>
<li><p>At 3PM, traffic drops, so Azure removes the extra VMs</p>
</li>
</ul>
<p>You only pay for what you use. And users get a smooth experience – no delays, no crashes 👌🏾</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746982520998/7fe3c997-fc8f-418a-861b-e999905ca43c.png" alt="Auto-scaling illustration" class="image--center mx-auto" width="455" height="176" loading="lazy"></p>
<h2 id="heading-azure-load-balancer-spreading-the-traffic">📦 Azure Load Balancer – Spreading the Traffic</h2>
<p>By now, you know that your app can live on multiple Virtual Machines (VMs), and that you can scale them easily using Virtual Machine Scale Sets (VMSS).</p>
<p>But here's the big question: when users start accessing your app – hundreds, even thousands at once – how do you make sure that all that traffic is fairly and efficiently distributed across those VMs?</p>
<p>You don’t want one VM to be overwhelmed while others are just chilling. You need a middleman – something smart enough to balance the load.</p>
<p>That’s where <strong>Azure Load Balancer</strong> steps in. It’s Azure’s way of saying, “Don’t worry, I got this” when traffic starts rolling in.</p>
<h3 id="heading-so-what-is-azure-load-balancer">🏢 So, What Is Azure Load Balancer?</h3>
<p>Azure Load Balancer is a <strong>traffic director</strong>. It takes incoming traffic from the internet (or even internal sources within your network) and intelligently spreads it across multiple backend machines – usually VMs.</p>
<p>It's like having a well-trained receptionist who routes every customer to the next available agent, so no one waits too long and no one gets overwhelmed 😃.</p>
<p>And the best part? This entire process happens in the background – fast, silent, and seamless. Users visiting your app have no idea a traffic manager is working behind the scenes. They just see a fast, responsive experience.</p>
<h3 id="heading-the-frontend-ip-your-apps-public-face">🌐 The Frontend IP – Your App’s Public Face</h3>
<p>Every Azure Load Balancer is tied to a <strong>Frontend IP</strong>, which is basically the public IP address of your application – the one users connect to when they open <code>www.yourapp.com</code>.</p>
<p>This IP acts as the entry point. All user traffic comes through it first. But the Load Balancer doesn’t actually run your app. Instead, it accepts the traffic and forwards it to one of the VMs in the backend pool (we’ll get to that shortly).</p>
<p>You can configure this Frontend IP to be either public (accessible over the internet) or private (used for internal traffic within your cloud network – say, between microservices or internal tools).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1747055268951/5afbb738-d00d-4f49-9709-2fa1fe7cffdd.png" alt="Frontend IP address illustration" class="image--center mx-auto" width="603" height="245" loading="lazy"></p>
<h3 id="heading-backend-pool-where-the-magic-happens">🗂️ Backend Pool – Where the Magic Happens</h3>
<p>Behind every Azure Load Balancer is a <strong>backend pool</strong> – a group of VMs (or VM Scale Set instances) where your actual app is running. These are the real workers, doing all the heavy lifting.</p>
<p>When traffic hits the Frontend IP, the Load Balancer takes that request and hands it off to one of the VMs in the backend pool.</p>
<p>But it doesn’t just randomly pick one. It checks a few things first – like whether the VM is healthy, whether it's already busy, and what rules you’ve set.</p>
<p>Each VM in the pool typically runs the same app or service. This means any of them can handle any incoming request, which is what makes load balancing possible in the first place.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1747055337014/e831056d-7c0c-49d9-b05a-6d3dbe3edc76.png" alt="Backend pool illustration" class="image--center mx-auto" width="299" height="258" loading="lazy"></p>
<h3 id="heading-health-probes-keeping-tabs-on-the-vms">🩺 Health Probes – Keeping Tabs on the VMs</h3>
<p>Now, how does the Load Balancer know which VM is healthy or not? This is where <strong>health probes</strong> come in. Think of them as regular check-ups.</p>
<p>You configure the Load Balancer to periodically "ping" each VM – maybe by hitting a specific URL (like <code>/health</code>) or a certain port (like 80 for HTTP). If a VM doesn’t respond correctly, Azure marks it as unhealthy and temporarily removes it from the rotation.</p>
<p>This ensures users never get routed to a broken or unresponsive instance of your app. And once the VM becomes healthy again, it's automatically added back to the pool.</p>
<h3 id="heading-load-balancing-rules-who-gets-what">⚖️ Load Balancing Rules – Who Gets What?</h3>
<p>Next, we have <strong>Load Balancing Rules</strong>. These are the instructions that tell Azure Load Balancer exactly how to behave.</p>
<p>You can define rules like:</p>
<ul>
<li><p>“Forward all HTTP (port 80) traffic to backend pool VMs on port 80”</p>
</li>
<li><p>“Forward HTTPS (port 443) traffic to VMs on port 443”</p>
</li>
<li><p>“Only route traffic to healthy VMs”</p>
</li>
</ul>
<p>These rules make Azure Load Balancer highly customizable. You get to decide how traffic flows, which protocols to support, and how to handle backend ports. It's like customizing the rules of a relay race – who gets the baton and when.</p>
<h3 id="heading-real-world-example-sneaker-sale-rush">👟 Real-World Example: Sneaker Sale Rush</h3>
<p>Imagine you're running an online sneaker store at <code>www.sneakerblast.com</code>. You’re launching a flash sale, and thousands of users are hitting your website all at once.</p>
<p>Thanks to your Azure Load Balancer, here’s what happens:</p>
<ol>
<li><p>All those users land on your Frontend IP, the public face of your site.</p>
</li>
<li><p>The Load Balancer accepts the traffic and checks the health probes of all VMs in the backend pool.</p>
</li>
<li><p>Based on its rules, it forwards each user to a healthy, available VM.</p>
</li>
<li><p>One VM might serve a user in Lagos, another in Nairobi, another in Accra – all seamlessly.</p>
</li>
</ol>
<p>If one VM crashes or lags? The Load Balancer detects it instantly and stops routing traffic to it until it’s back online.</p>
<p>That’s smooth traffic management without any manual effort.</p>
<h2 id="heading-azure-application-gateway-smart-routing-for-modern-apps">🍴 Azure Application Gateway – Smart Routing for Modern Apps</h2>
<p>So far, we’ve seen how Azure Load Balancer helps you split traffic across multiple VMs running a single service – like a monolithic app or a web frontend.</p>
<p>Let’s say you have a web application deployed on a VM. It listens on port 80, and you’ve scaled it into 3 instances. The Azure Load Balancer takes requests from the internet and spreads them across all 3 instances of the same service. Easy, right?</p>
<p>You can even link the Load Balancer’s public IP address to your domain – like <code>mydomain.com</code> – so users can visit your site normally.</p>
<h3 id="heading-but-what-if-you-have-multiple-services">🧠 But What If You Have <em>Multiple</em> Services?</h3>
<p>Now imagine you’ve gone beyond just one app. You’re building something more modern, like a set of microservices.</p>
<p>You now have:</p>
<ul>
<li><p>A payment service listening on port 5000</p>
</li>
<li><p>An authentication service on port 6000</p>
</li>
<li><p>A purchase service on port 7000</p>
</li>
</ul>
<p>All deployed across the same VMs (or Virtual Machine Scale Set), just on different ports.</p>
<p>Here’s the problem: an Azure Load Balancer is designed to route traffic to <em>one</em> backend pool – basically one service – on one port. If you tie it to <code>mydomain.com</code>, it can only send traffic to one of your microservices. 😬</p>
<p>So… what do you do?</p>
<p>You might think: “Let me just create a separate Load Balancer for each service!” 🤕</p>
<p>But that means:</p>
<ul>
<li><p>You’ll have to pay for multiple load balancers</p>
</li>
<li><p>You’ll end up managing 3–5 public IP addresses</p>
</li>
<li><p>You might even need to buy multiple domains like <code>mypayment.com</code>, <code>myauth.com</code>, and so on to route users properly</p>
</li>
</ul>
<p>Yikes. That’s impractical, messy, <em>and</em> expensive 😖💸</p>
<h3 id="heading-enter-azure-application-gateway">🎉 Enter Azure Application Gateway</h3>
<p><strong>Azure Application Gateway</strong> solves this problem beautifully. It’s designed to route traffic intelligently – not just to one service, but to multiple services using just one gateway.</p>
<p>It works like this:</p>
<ol>
<li><p>You create one public-facing frontend IP (like <code>52.160.100.5</code>)</p>
</li>
<li><p>You link that IP address to your main domain, for example <code>mydomain.com</code></p>
</li>
<li><p>Then, you define multiple backend pools – one for each service:</p>
<ul>
<li><p>Payment service (port 5000)</p>
</li>
<li><p>Auth service (port 6000)</p>
</li>
<li><p>Purchase service (port 7000)</p>
</li>
</ul>
</li>
<li><p>Next, you set up routing rules that decide how to forward each request.</p>
</li>
</ol>
<h3 id="heading-two-ways-to-route-with-application-gateway">✨ Two Ways to Route with Application Gateway</h3>
<p>You can configure <strong>smart routing</strong> based on:</p>
<ul>
<li><p><strong>URL paths</strong>:</p>
<ul>
<li><p><code>mydomain.com/payment</code> → Payment service</p>
</li>
<li><p><code>mydomain.com/auth</code> → Auth service</p>
</li>
</ul>
</li>
<li><p><strong>Subdomains</strong> (host headers):</p>
<ul>
<li><p><code>payment.mydomain.com</code> → Payment service</p>
</li>
<li><p><code>auth.mydomain.com</code> → Auth service</p>
</li>
</ul>
</li>
</ul>
<p>This way, all your services share one public IP and one domain – super clean, super efficient 🙌🏾</p>
<h3 id="heading-real-life-scenario-lets-break-it-down">🤓 Real-Life Scenario (Let’s Break It Down)</h3>
<p>Let’s say you’re building a startup platform that has three key microservices:</p>
<ul>
<li><p><strong>Payment service</strong> that handles transactions</p>
</li>
<li><p><strong>Authentication service</strong> that handles login and user identity</p>
</li>
<li><p><strong>Purchase service</strong> that manages product ordering</p>
</li>
</ul>
<p>Each service is containerized and deployed on the same VM (or across several VMs using a VM Scale Set). But – and this is key – they all listen on <strong>different ports</strong> inside the VMs:</p>
<ul>
<li><p>Payment → port 3000</p>
</li>
<li><p>Auth → port 6000</p>
</li>
<li><p>Purchase → port 7000</p>
</li>
</ul>
<p>Now, without a smart routing solution, you’d be stuck trying to expose just one of these services using a standard Azure Load Balancer. But you need all three to be accessible from the internet – and you don’t want to pay for or manage 3 different Load Balancers 😅</p>
<p>So, what do you do?</p>
<h3 id="heading-using-azure-application-gateway-to-route-traffic-intelligently">🧠 Using Azure Application Gateway to Route Traffic Intelligently</h3>
<p>Here's how you can fix this using <strong>one</strong> Application Gateway:</p>
<ol>
<li><p>Deploy your microservices inside each VM:</p>
<ul>
<li><p>Each service runs on a specific port</p>
</li>
<li><p>All VMs in your scale set are identical (they contain all three services)</p>
</li>
</ul>
</li>
<li><p>Create backend pools in Application Gateway:</p>
<ul>
<li><p>A backend pool for the payment service (pointing to port 3000 on all VMs)</p>
</li>
<li><p>One for the auth service (port 6000)</p>
</li>
<li><p>Another for the purchase service (port 7000)</p>
</li>
</ul>
</li>
<li><p>Create routing rules:</p>
<ul>
<li><p>Option A (Path-based routing):</p>
<ul>
<li><p>Requests to <code>mydomain.com/payment</code> → go to the payment backend pool</p>
</li>
<li><p>Requests to <code>mydomain.com/auth</code> → go to the auth backend pool</p>
</li>
<li><p>Requests to <code>mydomain.com/purchase</code> → go to the purchase backend pool</p>
</li>
</ul>
</li>
<li><p>Option B (Subdomain-based routing):</p>
<ul>
<li><p><code>payment.mydomain.com</code> → payment service</p>
</li>
<li><p><code>auth.mydomain.com</code> → auth service</p>
</li>
<li><p><code>purchase.mydomain.com</code> → purchase service</p>
</li>
</ul>
</li>
</ul>
</li>
</ol>
<p>You just tell the Application Gateway: “Hey, if a request comes in for this URL or subdomain, send it to this port on these VMs.” And it does just that – consistently and intelligently 🔁</p>
<h3 id="heading-so-whats-really-happening">📦 So, What’s Really Happening?</h3>
<p>Imagine a user visits <code>mydomain.com/auth</code>. Here’s what goes on behind the scenes:</p>
<ol>
<li><p>The DNS translates <code>mydomain.com</code> to your Application Gateway’s public IP</p>
</li>
<li><p>The Gateway receives the request</p>
</li>
<li><p>It checks your routing rules</p>
</li>
<li><p>It sees that <code>/auth</code> should go to the backend pool for port 6000</p>
</li>
<li><p>It forwards the request to one of the VMs running the auth service</p>
</li>
<li><p>The response goes back to the user – fast and seamless ✨</p>
</li>
</ol>
<p>This happens in milliseconds, for every request. And because the Application Gateway is aware of multiple ports and services, it can handle routing logic that a regular Load Balancer just can’t do.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1747056436345/7ea97231-d2ee-4f63-aff1-50595e7c06e0.png" alt="Application Gateway Illustration" class="image--center mx-auto" width="2048" height="1255" loading="lazy"></p>
<h2 id="heading-azure-load-balancer-vs-azure-application-gateway">🔍 Azure Load Balancer vs Azure Application Gateway</h2>
<p>By now, you've seen how both tools help route traffic in Azure – but they solve different problems.</p>
<p>Let’s break down how they compare, and when you should use one over the other 👇🏾</p>
<h3 id="heading-1-routing-logic">🛣️ 1. <strong>Routing Logic</strong></h3>
<p><strong>Azure Load Balancer</strong><br>It simply distributes incoming traffic evenly across a pool of VMs. It doesn’t care <em>what</em> the request is – it just balances the load.  </p>
<p>Imagine a delivery guy who doesn't ask questions – he just drops each package at the next available house.  </p>
<p>That’s what Azure Load Balancer does: it sends traffic to one of your servers without looking inside the request.</p>
<p><strong>Azure Application Gateway</strong><br>This is the smart one. It looks at <em>what’s inside</em> each request (like the URL path or domain) and makes intelligent decisions.</p>
<p>Just like a smarter delivery guy who looks at the address and decides where to go: "Oh! This one is for the payment office, not the main office."  </p>
<p>That’s what Application Gateway does: it reads the request (like the URL or domain name) and sends it to the right place according to the routing rules.</p>
<h3 id="heading-2-protocols-handled">🌐 2. <strong>Protocols Handled</strong></h3>
<p><strong>Load Balancer</strong><br>Works at the transport layer (Layer 4 in the OSI model). It deals with TCP/UDP traffic – raw network traffic, like HTTP, video streaming, games, and so on.</p>
<p><strong>Application Gateway</strong><br>Works at the application layer (Layer 7). It handles web traffic only – like websites and apps (HTTP/HTTPS) – and it can actually read what's being asked, like:</p>
<ul>
<li><p>“Go to /login”</p>
</li>
<li><p>“Go to <a target="_blank" href="http://payment.mydomain.com">payment.mydomain.com</a>”.</p>
</li>
</ul>
<p>TL;DR: Load Balancer just pushes packets. App Gateway actually <em>reads</em> your web requests.</p>
<h3 id="heading-3-use-case-scenarios">🔁 3. <strong>Use Case Scenarios</strong></h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Situation</td><td>Best Choice</td></tr>
</thead>
<tbody>
<tr>
<td>You have one big app and just want to spread users across servers</td><td>✅ Load Balancer</td></tr>
<tr>
<td>You have multiple services (like login, payment, and so on) and need to send users to the right one</td><td>✅ Application Gateway</td></tr>
<tr>
<td>You want to use subdomains (like <a target="_blank" href="http://login.mysite.com">login.mysite.com</a>)</td><td>✅ Application Gateway</td></tr>
<tr>
<td>You want to secure your website with HTTPS and Web Application Firewall (WAF)</td><td>✅ Application Gateway</td></tr>
<tr>
<td>You want the simplest setup and lowest cost</td><td>✅ Load Balancer</td></tr>
</tbody>
</table>
</div><h3 id="heading-4-ssl-termination-amp-security-features">🔐 4. <strong>SSL Termination &amp; Security Features</strong></h3>
<p><strong>Load Balancer</strong> doesn’t handle security stuff. You’ll need to secure each server yourself (for example, set up HTTPS on each one).</p>
<p><strong>Application Gateway</strong> can secure everything in one place – you upload your SSL certificate once and it takes care of HTTPS for all services.</p>
<p>It can also protect you from hackers and bad traffic with something called <strong>WAF (Web Application Firewall)</strong>, which protects your app from threats like SQL injection, XSS, and so on (you need to set this up manually).</p>
<h3 id="heading-5-pricing-and-complexity">💰 5. <strong>Pricing and Complexity</strong></h3>
<p><strong>Load Balancer</strong> is cheaper and easier to set up. Great when you don’t need anything fancy.</p>
<p><strong>Application Gateway</strong> costs more, but gives you more control and less headache when working with complex apps and microservices.</p>
<p>Trying to use Load Balancer for multiple services? You’ll need to create one Load Balancer per service, which becomes costly and impractical.</p>
<h3 id="heading-summary-table">🧠 Summary Table</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Feature</td><td>Load Balancer</td><td>Application Gateway</td></tr>
</thead>
<tbody>
<tr>
<td>Can it understand the request?</td><td>❌ No</td><td>✅ Yes</td></tr>
<tr>
<td>Can it route based on URL or subdomain?</td><td>❌ No</td><td>✅ Yes</td></tr>
<tr>
<td>Can it handle secure HTTPS traffic?</td><td>❌ No</td><td>✅ Yes</td></tr>
<tr>
<td>Is it good for simple apps?</td><td>✅ Yes</td><td>✅ Yes</td></tr>
<tr>
<td>Is it good for complex apps with many services?</td><td>❌ No</td><td>✅ Yes</td></tr>
<tr>
<td>Cost</td><td>💲 Lower</td><td>💰 Higher</td></tr>
</tbody>
</table>
</div><h2 id="heading-use-cases-when-to-use-each-one">🧭 Use Cases: When to Use Each One</h2>
<p>There’s no one-size-fits-all when it comes to hosting apps in the cloud. The right setup depends on what you’re building, how much traffic you expect, and how complex your app is.</p>
<p>Let’s walk through 4 different use-case scenarios, starting from the most basic setup all the way to a fully auto-scaled and smartly routed architecture.</p>
<h3 id="heading-1-single-vm-instance-for-small-projects-or-internal-tools">1️⃣ <strong>Single VM Instance – For Small Projects or Internal Tools</strong></h3>
<p><strong>Use this when:</strong><br>You're just getting started. You’ve built a small app – maybe a portfolio, a blog, or a side project – and you want to make it live, OR You’re a startup that just launched.</p>
<p><strong>How it works:</strong><br>You spin up one Azure VM, install your app on it, and open the port it listens on (for example, port 80 for a web server). You can then attach a public IP to the VM and bind it to a custom domain like <code>myawesomeapp.com</code>.</p>
<p><strong>Real-life examples:</strong></p>
<ul>
<li><p>A developer hosting a portfolio website or blog</p>
</li>
<li><p>A startup testing a new product with only a few users</p>
</li>
<li><p>An internal company tool for a small team</p>
</li>
</ul>
<p><strong>Pros:</strong></p>
<ul>
<li><p>Super simple setup</p>
</li>
<li><p>Low cost</p>
</li>
<li><p>Full control of your environment</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p>If the VM goes down, your app goes down</p>
</li>
<li><p>No auto-scaling – performance may drop with traffic spikes (the only way to adapt to increased CPU/memory usage due to traffic inflow is via manually scaling the VM vertically)</p>
</li>
<li><p>You manually maintain and monitor everything</p>
</li>
</ul>
<h3 id="heading-2-manual-horizontal-scaling-for-apps-with-medium-predictable-traffic">2️⃣ <strong>Manual Horizontal Scaling – For Apps With Medium, Predictable Traffic</strong></h3>
<p><strong>Use this when:</strong><br>Your app is growing – maybe you have a few thousand users now, and performance matters. You want more than one server so your app doesn’t crash during busy hours.</p>
<p><strong>How it works:</strong><br>You manually create 2 or 3 Azure VMs with the same app setup. You then add a Load Balancer in front to split traffic evenly across them.</p>
<p><strong>Real-life examples:</strong></p>
<ul>
<li><p>A business with a customer portal</p>
</li>
<li><p>A school website that handles regular logins, lecture video streaming, and so on during class hours</p>
</li>
<li><p>An app that gets traffic mostly during the day (predictable load)</p>
</li>
</ul>
<p><strong>Pros:</strong></p>
<ul>
<li><p>Better performance and availability</p>
</li>
<li><p>Load is shared across multiple VMs</p>
</li>
<li><p>You can scale manually when needed</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p>You must manually add or remove VMs – which takes effort</p>
</li>
<li><p>Still need to monitor performance manually</p>
</li>
<li><p>No built-in automation or auto-healing</p>
</li>
</ul>
<h3 id="heading-3-auto-scaling-with-vm-scale-sets-azure-load-balancer-for-apps-with-spiky-or-unpredictable-traffic">3️⃣ <strong>Auto-Scaling with VM Scale Sets + Azure Load Balancer – For Apps With Spiky or Unpredictable Traffic</strong></h3>
<p><strong>Use this when:</strong><br>You’re building something more serious – traffic comes in waves (for example, a fitness/coach booking app), and you don’t want to sit around scaling VMs all day. You want Azure to automatically scale your infrastructure for you.</p>
<p><strong>How it works:</strong><br>You set up a Virtual Machine Scale Set (VMSS) that can automatically create more VMs when needed (like during high traffic), and remove them when things are calm — saving money. A Load Balancer distributes traffic across all those VMs.</p>
<p><strong>Real-life examples:</strong></p>
<ul>
<li><p>A media platform where people upload videos or photos</p>
</li>
<li><p>A shopping site that gets surges during promotions, for example Black Fridays</p>
</li>
<li><p>A booking platform with peak traffic in evenings/weekends</p>
</li>
</ul>
<p><strong>Pros:</strong></p>
<ul>
<li><p>Automatic scaling – saves time and money</p>
</li>
<li><p>High availability: VMs can be replaced if one fails</p>
</li>
<li><p>Easy to grow as your user base grows</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p>Works best if your app is monolithic (one big service)</p>
</li>
<li><p>No support for routing traffic to specific services – just spreads traffic across VMs</p>
</li>
<li><p>Load Balancer can’t look at URL paths or subdomains</p>
</li>
</ul>
<h3 id="heading-4-vm-scale-set-azure-application-gateway-for-microservices-or-complex-web-apps">4️⃣ <strong>VM Scale Set + Azure Application Gateway – For Microservices or Complex Web Apps</strong></h3>
<p><strong>Use this when:</strong><br>You have a modern, multi-service app – maybe built with microservices. Each service (like payments, authentication, search, and so on) lives on a different port or even in a container.</p>
<p>You want to route traffic smartly – like <code>/login</code> goes to the auth service, <code>/pay</code> to payments, and <code>/search</code> to the search service – all on the same domain.</p>
<p><strong>How it works:</strong><br>You still use a VM Scale Set for auto-scaling, but instead of a basic Load Balancer, you add an Application Gateway. It can inspect each request and send it to the right service based on things like:</p>
<ul>
<li><p>URL path (for example, <code>/payments</code>, <code>/orders</code>)</p>
</li>
<li><p>Subdomain (for example, <code>payments.mydomain.com</code>, <code>auth.mydomain.com</code>)</p>
</li>
</ul>
<p><strong>Real-life examples:</strong></p>
<ul>
<li><p>A full-blown SaaS product with multiple services</p>
</li>
<li><p>An e-commerce site with checkout, account, orders, and admin dashboards</p>
</li>
<li><p>A business migrating from a monolith to a microservices setup</p>
</li>
</ul>
<p><strong>Pros:</strong></p>
<ul>
<li><p>Smart routing based on path or subdomain</p>
</li>
<li><p>Everything runs under one public IP and one domain</p>
</li>
<li><p>Secure HTTPS handling + optional Web Application Firewall (WAF)</p>
</li>
<li><p>Auto-scaling and high availability</p>
</li>
</ul>
<p><strong>Cons:</strong></p>
<ul>
<li><p>More complex setup</p>
</li>
<li><p>Slightly higher cost due to Application Gateway</p>
</li>
<li><p>Needs planning around port numbers and backend pools</p>
</li>
</ul>
<h3 id="heading-quick-summary-table">🧠 Quick Summary Table</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Setup</td><td>Best For</td><td>Scaling</td><td>Routing Logic</td><td>Cost</td><td>Ease</td></tr>
</thead>
<tbody>
<tr>
<td>☁️ Single VM</td><td>Small sites, personal apps</td><td>❌ (Manual)</td><td>❌ One app only</td><td>💲 (Lowest)</td><td>⭐⭐⭐⭐</td></tr>
<tr>
<td>🧱 Manual Horizontal Scaling + Load Balancer</td><td>Mid-size apps, predictable traffic</td><td>✅ (Manual)</td><td>❌ One app only</td><td>💲💲💲 (due to multiple VMs running at once without down-scaling — even with no traffic)</td><td>⭐⭐ (due to manual scaling)</td></tr>
<tr>
<td>🔁 VMSS + Load Balancer</td><td>Busy apps, spiky traffic</td><td>✅ (Auto)</td><td>❌ One app only</td><td>💲💲</td><td>⭐⭐⭐</td></tr>
<tr>
<td>🍴 VMSS + App Gateway</td><td>Microservices, modern apps</td><td>✅ (Auto)</td><td>✅ Smart routing (involving multiple microservices)</td><td>💲💲💲💲(Highest)</td><td>⭐⭐</td></tr>
</tbody>
</table>
</div><h2 id="heading-conclusion">✅ Conclusion</h2>
<p>By now, you’ve gone from simply hearing the words “load balancer” or “scale set” to understanding exactly how they work, when to use them, and what problems they solve. Whether you’re just launching a small app or scaling up a high-traffic service, Azure gives you flexible, powerful tools to grow with confidence.</p>
<p>We started from the very beginning – a single virtual machine. It’s simple and great for small apps, but it quickly becomes a bottleneck as traffic grows.</p>
<p>That’s where scaling comes in. We explored:</p>
<ul>
<li><p>🧱 <strong>Vertical scaling</strong> – Upgrading the same VM (quick fix, but limited)</p>
</li>
<li><p>🧩 <strong>Horizontal scaling</strong> – Adding more VMs to handle traffic better</p>
</li>
</ul>
<p>Then we introduced Azure Virtual Machine Scale Sets (VMSS) – which bring auto-scaling to life. No more manual intervention – Azure can scale your servers up and down based on demand.</p>
<p>But where things really get smart is with load balancers:</p>
<ul>
<li><p>📦 <strong>Azure Load Balancer</strong> helps spread traffic across your VMs — great for single-service apps</p>
</li>
<li><p>🍴 <strong>Azure Application Gateway</strong> takes it further by routing requests based on URL paths or subdomains — perfect for multi-service or microservice apps</p>
</li>
</ul>
<h3 id="heading-tldr-what-should-you-use">🎯 TL;DR – What Should You Use?</h3>
<ul>
<li><p><strong>Single VM</strong>: For side projects, portfolios, or internal tools</p>
</li>
<li><p><strong>Manual scaling + Load Balancer</strong>: For medium apps with predictable load</p>
</li>
<li><p><strong>VMSS + Load Balancer</strong>: For monolithic apps with auto-scaling needs</p>
</li>
<li><p><strong>VMSS + Application Gateway</strong>: Also includes auto-scaling but for microservices or smart routing needs</p>
</li>
</ul>
<h3 id="heading-final-thoughts">💡 Final Thoughts</h3>
<p>Cloud apps grow – fast. And with growth comes complexity. But with the right Azure setup, you can stay one step ahead of your traffic, serve users better, and keep costs under control.</p>
<p>Remember: you don’t need to start big. Start small, understand your app's traffic patterns, and scale only when you need to. Tools like Azure VM Scale Sets, Load Balancer, and Application Gateway give you the control and power to build scalable, modern applications without over-engineering.</p>
<p>Thanks for sticking with me through this deep dive. I hope this made things clearer, simpler, and maybe even a little fun 😊</p>
<h2 id="heading-study-further"><strong>Study Further 📚</strong></h2>
<p>If you would like to learn more about Azure Virtual Machines, Scale Sets, Load Balancer, and Application Gateway, you can check out the courses below:</p>
<ul>
<li><p><a target="_blank" href="https://www.coursera.org/specializations/microsoft-azure-fundamentals-az900-exam-prep">Microsoft Azure Fundamentals AZ-900 Exam Prep Specialization</a> — Microsoft, Coursera</p>
</li>
<li><p><a target="_blank" href="https://youtu.be/QOv_-xBXkpo?si=kSijmQdev5cQbRKl">Azure Virtual Machine Tutorial | Creating A Virtual Machine In Azure | Azure Training | Simplilearn</a> — YouTube</p>
</li>
<li><p><a target="_blank" href="https://youtu.be/wN4lRWHUHA0?si=kWBGXhXZTnVgzuEj">Virtual machine scale sets</a> — YouTube</p>
</li>
<li><p><a target="_blank" href="https://youtu.be/VqBGjddK5VY?si=diLGQfuW5i0lxbse">Azure Load Balancer | Azure Load Balancer Tutorial | All About Load Balancer | Edureka</a> — YouTube</p>
</li>
<li><p><a target="_blank" href="https://youtu.be/V9EP4jAg4QM?si=t7EqQjw1eNHqOtjK">Azure Application Gateway Deep dive | Step by step explained</a> — YouTube</p>
</li>
</ul>
<h2 id="heading-about-the-author"><strong>About the Author 👨‍💻</strong></h2>
<p>Hi, I’m Prince! I’m a DevOps engineer and Cloud architect passionate about building, deploying, and managing scalable applications and sharing knowledge with the tech community.</p>
<p>If you enjoyed this article, you can learn more about me by exploring more of my blogs and projects on my <a target="_blank" href="https://www.linkedin.com/in/prince-onukwili-a82143233/">LinkedIn profile.</a> You can find my <a target="_blank" href="https://www.linkedin.com/in/prince-onukwili-a82143233/details/publications/">LinkedIn articles here</a>. You can also <a target="_blank" href="https://prince-onuk.vercel.app/achievements#articles">visit my website</a> to read more of my articles as well. Let’s connect and grow together! 😊</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Automate Compliance and Fraud Detection in Finance with MLOps ]]>
                </title>
                <description>
                    <![CDATA[ These days, businesses are under increasing pressure to comply with stringent regulations while also combating fraudulent activities. The high volume of data and the intricate requirements of real-time fraud detection and compliance reporting are fre... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/automate-compliance-and-fraud-detection-in-finance-with-mlops/</link>
                <guid isPermaLink="false">68222009a8daed5c1fbf1692</guid>
                
                    <category>
                        <![CDATA[ mlops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ GCP ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AI ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ #AIOps ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Balajee Asish Brahmandam ]]>
                </dc:creator>
                <pubDate>Mon, 12 May 2025 16:21:29 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1747064311601/923284fd-8584-4ef3-8591-f717b9807148.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>These days, businesses are under increasing pressure to comply with stringent regulations while also combating fraudulent activities. The high volume of data and the intricate requirements of real-time fraud detection and compliance reporting are frequently a challenge for traditional systems to manage.</p>
<p>This is where MLOps (Machine Learning Operations) comes into play. It can help teams streamline these processes and elevate automation to the forefront of financial security and regulatory adherence.</p>
<p>In this article, we will investigate the potential of MLOps for automating compliance and fraud detection in the finance sector.</p>
<p>I’ll show you step by step how financial institutions can deploy a machine learning model for fraud detection and integrate it into their operations to ensure continuous monitoring and automated alerts for compliance. I’ll also demonstrate how to deploy this solution in a cloud-based environment using Google Colab, ensuring that it is both user-friendly and accessible, whether you are a beginner or more advanced.</p>
<h3 id="heading-heres-what-well-cover">Here’s what we’ll cover:</h3>
<ul>
<li><p><a class="post-section-overview" href="#heading-what-is-mlops">What is MLOps?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-what-youll-need">What You’ll Need</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-1-set-up-google-colab-and-prepare-the-data">Step 1: Set Up Google Colab and Prepare the Data</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-2-data-preprocessing">Step 2: Data Preprocessing</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-4-retrain-the-model-with-new-data">Step 4: Retrain the Model with New Data</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-5-automated-alert-system">Step 5: Automated Alert System</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-6-visualize-model-performance">Step 6: Visualize Model Performance</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-key-takeaways">Key Takeaways</a></p>
</li>
</ul>
<h2 id="heading-what-is-mlops"><strong>What is MLOps?</strong></h2>
<p>Machine Learning Operations, or MLOps for short, is a methodology that integrates DevOps with Machine Learning (ML).  The whole machine learning model lifecycle, including development, training, deployment, monitoring, and maintenance, can be automated with its help. </p>
<p>MLOps has several main goals: continuous optimization, scalability, and the delivery of operational value over time.</p>
<p>The financial industry provides great use cases for MLOps processes and techniques, as these can help businesses manage complicated data pipelines, deploy models in real-time, and evaluate their performance – all while making sure they're compliant with regulations.</p>
<h3 id="heading-why-is-mlops-important-in-finance"><strong>Why is MLOps Important in Finance?</strong></h3>
<p>Financial institutions are subject to various rules including Anti-Money Laundering (AML), Know Your Customer (KYC), and Fraud Prevention Regulations – so they have to carefully manage private information. Ignoring these rules might result in severe fines and loss of reputation.</p>
<p>Detecting fraud in financial transactions also calls for advanced systems capable of real-time identification of suspicious activity.</p>
<p>MLOps can help to solve these issues in the following ways:</p>
<ul>
<li><p>MLOps lets financial institutions automatically track transactions for regulatory compliance, guaranteeing they follow changing legislation.</p>
</li>
<li><p>MLOps helps to create and implement machine learning models that can identify fraudulent transactions in real-time.</p>
</li>
<li><p>MLOps runs automated processes, enabling organizations to expand their fraud detection systems with as little human involvement as possible through automation.</p>
</li>
</ul>
<h2 id="heading-what-youll-need"><strong>What You’ll Need:</strong></h2>
<p>To follow along with this tutorial, ensure that you have the following:</p>
<ol>
<li><p><strong>Python</strong> installed, along with basic ML libraries such as scikit-learn, Pandas, and NumPy.</p>
</li>
<li><p>A <strong>sample dataset</strong> of financial transactions, which we will use to train a fraud detection model (You can use this <a target="_blank" href="https://www.datacamp.com/datalab/datasets/dataset-r-credit-card-fraud">sample dataset</a> if you don’t have one on hand).</p>
</li>
<li><p><strong>Google Colab</strong> (for cloud-based execution), which is free to use and doesn't require installation.</p>
</li>
</ol>
<h2 id="heading-step-1-set-up-google-colab-and-prepare-the-data"><strong>Step 1: Set Up Google Colab and Prepare the Data</strong></h2>
<p>Google Colab is an ideal choice for beginners and advanced users alike, because it’s cloud-based and doesn’t require installation. To start get started using it, follow these steps:</p>
<h3 id="heading-access-google-colab"><strong>Access Google Colab</strong>:</h3>
<p>Visit Google Colab and <a target="_blank" href="https://colab.research.google.com/">sign-in</a> with your <strong>Google account</strong>.</p>
<h3 id="heading-create-a-new-notebook"><strong>Create a New Notebook</strong>:</h3>
<p>In the Colab interface, go to <strong>File</strong> and then select <strong>New Notebook</strong> to create a fresh notebook.</p>
<h3 id="heading-import-libraries-and-load-the-dataset"><strong>Import Libraries and Load the Dataset</strong></h3>
<p>Now, let’s import the necessary libraries and load our fraud detection dataset. We'll assume the dataset is available as a CSV file, and we'll upload it to Colab.</p>
<p><strong>Import libraries:</strong></p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-keyword">from</span> sklearn.model_selection <span class="hljs-keyword">import</span> train_test_split
<span class="hljs-keyword">from</span> sklearn.ensemble <span class="hljs-keyword">import</span> RandomForestClassifier
<span class="hljs-keyword">from</span> sklearn.metrics <span class="hljs-keyword">import</span> classification_report, confusion_matrix
<span class="hljs-keyword">import</span> matplotlib.pyplot <span class="hljs-keyword">as</span> plt
</code></pre>
<p><strong>Upload the Dataset</strong>:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> google.colab <span class="hljs-keyword">import</span> files
uploaded = files.upload()

<span class="hljs-comment"># Load dataset into pandas DataFrame</span>
data = pd.read_csv(<span class="hljs-string">'data.csv'</span>)
print(data.head())
</code></pre>
<h2 id="heading-step-2-data-preprocessing"><strong>Step 2: Data Preprocessing</strong></h2>
<p>Data preprocessing is essential to prepare the dataset for model training. This involves handling missing values, encoding categorical variables, and normalizing numerical features.</p>
<h3 id="heading-why-is-preprocessing-important">Why is Preprocessing Important?</h3>
<p>Data preprocessing lets you take care of various data issues that could affect your results. During this process, you’ll:</p>
<ul>
<li><p><strong>Handle missing values</strong>: Financial datasets often have missing values. Filling in these missing values (for example, with the median) ensures that the model doesn’t encounter errors during training.</p>
</li>
<li><p><strong>Convert categorical data</strong>: Machine learning algorithms require numerical input, so categorical features (like transaction type or location) need to be converted into numeric format using one-hot encoding.</p>
</li>
<li><p><strong>Normalize data</strong>: Some machine learning models, like Random Forest, are not sensitive to feature scaling, but normalization helps maintain consistency and allows us to compare the importance of different features. This step is especially critical for models that rely on gradient descent.</p>
</li>
</ul>
<p>Here’s an example:</p>
<pre><code class="lang-python"><span class="hljs-comment"># Handle missing data by filling with the median value for each column</span>
data.fillna(data.median(), inplace=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># Convert categorical columns to numeric using one-hot encoding</span>
data = pd.get_dummies(data, drop_first=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># Normalize numerical columns for scaling</span>
data[<span class="hljs-string">'normalized_amount'</span>] = (data[<span class="hljs-string">'Amount'</span>] - data[<span class="hljs-string">'Amount'</span>].mean()) / data[<span class="hljs-string">'Amount'</span>].std()

<span class="hljs-comment"># Separate features and target variable</span>
X = data.drop(columns=[<span class="hljs-string">'Class'</span>])
y = data[<span class="hljs-string">'Class'</span>]

<span class="hljs-comment"># Split data into training and testing sets (80% train, 20% test)</span>
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=<span class="hljs-number">0.2</span>, random_state=<span class="hljs-number">42</span>)

print(<span class="hljs-string">"Data preprocessing completed."</span>)
</code></pre>
<h2 id="heading-step-3-train-a-fraud-detection-model"><strong>Step 3: Train a Fraud Detection Model</strong></h2>
<p>We'll now train a <strong>RandomForestClassifier</strong> and evaluate its performance.</p>
<h3 id="heading-what-is-a-random-forest-classifier"><strong>What is a Random Forest Classifier?</strong></h3>
<p>A <strong>Random Forest</strong> is an ensemble learning method that creates a collection (forest) of decision trees, typically trained with different parts of the data. It aggregates their predictions to improve accuracy and reduce overfitting.</p>
<p>This method is a popular choice for fraud detection because it can handle high-dimensional data. It’s also quite robust against overfitting.</p>
<p>Here’s how you can implement the Random Forest Classifier:</p>
<pre><code class="lang-python"><span class="hljs-comment"># Initialize the Random Forest Classifier</span>
rf_model = RandomForestClassifier(n_estimators=<span class="hljs-number">150</span>, random_state=<span class="hljs-number">42</span>)

<span class="hljs-comment"># Train the model on the training data</span>
rf_model.fit(X_train, y_train)

<span class="hljs-comment"># Predict on the test data</span>
y_pred = rf_model.predict(X_test)

<span class="hljs-comment"># Evaluate model performance</span>
print(<span class="hljs-string">"Model Evaluation:\n"</span>, classification_report(y_test, y_pred))
print(<span class="hljs-string">"Confusion Matrix:\n"</span>, confusion_matrix(y_test, y_pred))

<span class="hljs-comment"># Plot confusion matrix for visual understanding</span>
cm = confusion_matrix(y_test, y_pred)
fig, ax = plt.subplots()
cax = ax.matshow(cm, cmap=<span class="hljs-string">'Blues'</span>)
fig.colorbar(cax)
plt.title(<span class="hljs-string">"Confusion Matrix"</span>)
plt.xlabel(<span class="hljs-string">"Predicted"</span>)
plt.ylabel(<span class="hljs-string">"Actual"</span>)
plt.show()
</code></pre>
<p>How the model is evaluated:</p>
<ul>
<li><p><strong>Classification report</strong>: Shows metrics like precision, recall, and F1-score for the fraud and non-fraud classes.</p>
</li>
<li><p><strong>Confusion matrix</strong>: Helps visualize the performance of the model by showing the true positives, false positives, true negatives, and false negatives.</p>
</li>
</ul>
<h2 id="heading-step-4-retrain-the-model-with-new-data"><strong>Step 4: Retrain the Model with New Data</strong></h2>
<p>Once you have trained your model, it’s important to retrain it periodically with new data to ensure that it continues to detect emerging fraud patterns.</p>
<h3 id="heading-what-is-retraining"><strong>What is Retraining?</strong></h3>
<p>Retraining the model ensures that it adapts to new, unseen data and improves over time. In the case of fraud detection, retraining is crucial because fraud tactics evolve over time, and your model needs to stay up-to-date to recognize new patterns.</p>
<p>Here’s how you can do this:</p>
<pre><code class="lang-python"><span class="hljs-comment"># Simulate loading new fraud data</span>
new_data = pd.read_csv(<span class="hljs-string">'new_fraud_data.csv'</span>)

<span class="hljs-comment"># Apply preprocessing steps to new data (like filling missing values, encoding, normalization)</span>
new_data.fillna(new_data.median(), inplace=<span class="hljs-literal">True</span>)
new_data = pd.get_dummies(new_data, drop_first=<span class="hljs-literal">True</span>)
new_data[<span class="hljs-string">'normalized_amount'</span>] = (new_data[<span class="hljs-string">'transaction_amount'</span>] - new_data[<span class="hljs-string">'transaction_amount'</span>].mean()) / new_data[<span class="hljs-string">'transaction_amount'</span>].std()

<span class="hljs-comment"># Concatenate old and new data for retraining</span>
X_new = new_data.drop(columns=[<span class="hljs-string">'fraud_label'</span>])
y_new = new_data[<span class="hljs-string">'fraud_label'</span>]

<span class="hljs-comment"># Retrain the model with the updated dataset</span>
X_combined = pd.concat([X_train, X_new], axis=<span class="hljs-number">0</span>)
y_combined = pd.concat([y_train, y_new], axis=<span class="hljs-number">0</span>)

rf_model.fit(X_combined, y_combined)

<span class="hljs-comment"># Re-evaluate the model</span>
y_pred_new = rf_model.predict(X_test)
print(<span class="hljs-string">"Updated Model Evaluation:\n"</span>, classification_report(y_test, y_pred_new))
</code></pre>
<h2 id="heading-step-5-automated-alert-system"><strong>Step 5: Automated Alert System</strong></h2>
<p>To automate fraud detection, we’ll send an email whenever a suspicious transaction is detected.</p>
<h3 id="heading-how-the-alert-system-works"><strong>How the Alert System Works</strong></h3>
<p>The email alert system uses <a target="_blank" href="https://www.freecodecamp.org/news/send-emails-in-python-using-mailtrap-smtp-and-the-email-api/"><strong>SMTP</strong> to send an email</a> whenever fraud is detected. When the model identifies a suspicious transaction, it triggers an automated alert to notify the compliance team for further investigation.</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> smtplib
<span class="hljs-keyword">from</span> email.mime.text <span class="hljs-keyword">import</span> MIMEText
<span class="hljs-keyword">from</span> email.mime.multipart <span class="hljs-keyword">import</span> MIMEMultipart

<span class="hljs-comment"># Function to send an email alert</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">send_alert</span>(<span class="hljs-params">email_subject, email_body</span>):</span>
    sender_email = <span class="hljs-string">"your_email@example.com"</span>
    receiver_email = <span class="hljs-string">"compliance_team@example.com"</span>
    password = <span class="hljs-string">"your_password"</span>

    msg = MIMEMultipart()
    msg[<span class="hljs-string">'From'</span>] = sender_email
    msg[<span class="hljs-string">'To'</span>] = receiver_email
    msg[<span class="hljs-string">'Subject'</span>] = email_subject

    msg.attach(MIMEText(email_body, <span class="hljs-string">'plain'</span>))

    <span class="hljs-comment"># Send email using SMTP</span>
    <span class="hljs-keyword">try</span>:
        server = smtplib.SMTP_SSL(<span class="hljs-string">'smtp.example.com'</span>, <span class="hljs-number">465</span>)
        server.login(sender_email, password)
        text = msg.as_string()
        server.sendmail(sender_email, receiver_email, text)
        server.quit()
        print(<span class="hljs-string">"Fraud alert email sent successfully."</span>)
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        print(<span class="hljs-string">f"Failed to send email: <span class="hljs-subst">{str(e)}</span>"</span>)

<span class="hljs-comment"># Example: Check for fraud and trigger an alert</span>
suspicious_transaction_details = <span class="hljs-string">"Transaction ID: 12345, Amount: $5000, Suspicious Activity Detected."</span>
send_alert(<span class="hljs-string">"Fraud Detection Alert"</span>, <span class="hljs-string">f"A suspicious transaction has been detected: <span class="hljs-subst">{suspicious_transaction_details}</span>"</span>)
</code></pre>
<h2 id="heading-step-6-visualize-model-performance"><strong>Step 6: Visualize Model Performance</strong></h2>
<p>Finally, we will visualize the performance of the model using an <strong>ROC curve</strong> (Receiver Operating Characteristic Curve), which helps evaluate the trade-off between the true positive rate and false positive rate.</p>
<p>Visualizing the performance of a machine learning model is an essential step in understanding how well the model is doing, especially when it comes to evaluating its ability to detect fraudulent transactions.</p>
<h3 id="heading-what-is-an-roc-curve"><strong>What is an ROC curve?</strong></h3>
<p>An ROC curve shows how well a model performs across all classification thresholds. It plots the True Positive Rate (TPR) versus the False Positive Rate (FPR). The area under the ROC curve (AUC) provides a summary measure of model performance.</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> sklearn.metrics <span class="hljs-keyword">import</span> roc_curve, auc

<span class="hljs-comment"># Calculate ROC curve</span>
fpr, tpr, thresholds = roc_curve(y_test, rf_model.predict_proba(X_test)[:,<span class="hljs-number">1</span>])
roc_auc = auc(fpr, tpr)

<span class="hljs-comment"># Plot ROC curve</span>
plt.figure(figsize=(<span class="hljs-number">8</span>,<span class="hljs-number">6</span>))
plt.plot(fpr, tpr, color=<span class="hljs-string">'blue'</span>, label=<span class="hljs-string">f'ROC curve (area = <span class="hljs-subst">{roc_auc:<span class="hljs-number">.2</span>f}</span>)'</span>)
plt.plot([<span class="hljs-number">0</span>, <span class="hljs-number">1</span>], [<span class="hljs-number">0</span>, <span class="hljs-number">1</span>], color=<span class="hljs-string">'gray'</span>, linestyle=<span class="hljs-string">'--'</span>)
plt.xlim([<span class="hljs-number">0.0</span>, <span class="hljs-number">1.0</span>])
plt.ylim([<span class="hljs-number">0.0</span>, <span class="hljs-number">1.05</span>])
plt.xlabel(<span class="hljs-string">'False Positive Rate'</span>)
plt.ylabel(<span class="hljs-string">'True Positive Rate'</span>)
plt.title(<span class="hljs-string">'Receiver Operating Characteristic (ROC) Curve'</span>)
plt.legend(loc=<span class="hljs-string">'lower right'</span>)
plt.show()
</code></pre>
<p>The ROC curve gives us a comprehensive picture of how well our model is distinguishing between the two classes across various thresholds. By evaluating this curve, we can make decisions on how to tune the model’s threshold to find the best balance between detecting fraud and minimizing false alarms (that is, minimizing false positives).</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>By following this guide, you’ve learned how to leverage MLOps to automate fraud detection and ensure compliance in the financial industry using Google Colab. This cloud-based environment makes it easy to work with machine learning models without the hassle of local setups or configurations.</p>
<p>From automating data preprocessing to deploying models in production, MLOps offers an end-to-end solution that improves efficiency, scalability, and accuracy in detecting fraudulent activities.</p>
<p>By integrating real-time monitoring and continuous updates, financial institutions can stay ahead of fraud threats while ensuring regulatory compliance with minimal manual effort.</p>
<h2 id="heading-key-takeaways"><strong>Key Takeaways</strong></h2>
<ul>
<li><p>MLOps automates the whole machine learning model lifecycle by integrating machine learning with DevOps.</p>
</li>
<li><p>Simplifies regulatory compliance and fraud detection, letting banks spot fraudulent transactions automatically.</p>
</li>
<li><p>Maintains fraud detection systems current with fresh data through constant monitoring and model retraining.</p>
</li>
<li><p>Machine learning model development and testing may be done on Google Colab, a free cloud-based platform that provides access to GPUs and TPUs. No local installation is required.</p>
</li>
<li><p>Allows for automated workflows to detect suspicious behavior and send out alerts in real-time, allowing for fraud detection and alerting.</p>
</li>
<li><p>Continuous integration/continuous delivery pipelines guarantee continuous system improvement by automating the testing and deployment of new fraud detection models.</p>
</li>
<li><p>Financial organizations may save money using MLOps because cloud-based systems like Google Colab lower infrastructure expenses.</p>
</li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Learn Kubernetes – Full Handbook for Developers, Startups, and Businesses ]]>
                </title>
                <description>
                    <![CDATA[ You’ve probably heard the word Kubernetes floating around, or it’s cooler nickname k8s (pronounced “kates“). Maybe in a job post, a tech podcast, or from that one DevOps friend who always brings it up like it’s the secret sauce to everything 😅. It s... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/learn-kubernetes-handbook-devs-startups-businesses/</link>
                <guid isPermaLink="false">68150214fd424d0874293171</guid>
                
                    <category>
                        <![CDATA[ Kubernetes ]]>
                    </category>
                
                    <category>
                        <![CDATA[ containers ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Docker ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud Computing ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Prince Onukwili ]]>
                </dc:creator>
                <pubDate>Fri, 02 May 2025 17:34:12 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1746205417767/d9d6b0d3-f2a5-44eb-83b5-d1a614bead9f.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>You’ve probably heard the word Kubernetes floating around, or it’s cooler nickname k8s (pronounced “kates“). Maybe in a job post, a tech podcast, or from that one DevOps friend who always brings it up like it’s the secret sauce to everything 😅. It sounds important, but also... kinda mysterious.</p>
<p>So what is Kubernetes, really? Why is it everywhere? And should you care?</p>
<p>In this handbook, we’ll unpack Kubernetes in a way that actually makes sense. No buzzwords. No overwhelming tech-speak. Just straight talk. You’ll learn what Kubernetes is, how it came about, and why it became such a big deal – especially for teams building and running huge apps with millions of users.</p>
<p>We’ll rewind a bit to see how things were done before Kubernetes showed up (spoiler: it wasn’t pretty), and walk through the real problems it was designed to solve.</p>
<p>By the end, you’ll not only understand the purpose of Kubernetes, but you’ll also know how to deploy a simple app on a Kubernetes cluster – even if you’re just getting started.</p>
<p>Yep, by the time we’re done, you’ll go from <em>“I keep hearing about Kubernetes”</em> to <em>“Hey, I kinda get it now!”</em> 😄</p>
<h2 id="heading-table-of-contents">📚 Table of Contents</h2>
<ol>
<li><p><a class="post-section-overview" href="#heading-what-is-kubernetes">What is Kubernetes?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-applications-were-deployed-before-kubernetes">How Applications Were Deployed Before Kubernetes</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-the-problem-kubernetes-solves">The Problem Kubernetes Solves 🧠</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-kubernetes-works-components-of-a-kubernetes-environment">How Kubernetes Works – Components of a Kubernetes Environment 🧑‍🔧</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-kubernetes-workloads-pods-deployments-services-amp-more">Kubernetes Workloads 🛠️ – Pods, Deployments, Services, &amp; More</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to=create-a-kubernetes-cluster-in-a-demo-environment-with-play-with-k8s">How to Create a Kubernetes Cluster in a Demo Environment with play-with-k8s</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-sign-in-to-play-with-kubernetes">Sign in to Play with Kubernetes</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-create-your-kubernetes-cluster">Create Your Kubernetes Cluster</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-deploy-your-application-on-a-kubernetes-cluster">How to Deploy an Application on Your Kubernetes Cluster</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-advantages-of-using-kubernetes-in-business">✅ Advantages of Using Kubernetes in Business</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-disadvantages-of-using-kubernetes">😬 Disadvantages of Using Kubernetes</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-use-cases-when-and-when-not-to-use-kubernetes">Use Cases: When (and When Not) to Use Kubernetes</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-study-further">Study Further 📚</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-about-the-author">About the Author 👨‍💻</a></p>
</li>
</ol>
<h2 id="heading-what-is-kubernetes"><strong>What is Kubernetes?</strong></h2>
<p>Imagine you're building a huge software platform, like a banking app. This app needs many features, like user onboarding, depositing money, withdrawals, payments, and so on. These features are so big and complex that it’s easier to split them into separate applications. These individual applications are called microservices.</p>
<p><strong>So what are Microservices</strong>? Think of them like little building blocks that work together to create a bigger platform. So, you might have:</p>
<ul>
<li><p>One microservice for user onboarding</p>
</li>
<li><p>Another for processing deposits</p>
</li>
<li><p>Another for handling payments</p>
</li>
<li><p>And many, many more!</p>
</li>
</ul>
<p>To the user, it still looks like they’re using one smooth, unified banking app. But behind the scenes, it’s like a bunch of little apps working together to make everything run.</p>
<h3 id="heading-but-heres-where-things-get-tricky">But here’s where things get tricky...</h3>
<p>When you have dozens (or even hundreds) of these microservices, managing them becomes a nightmare. You might need to:</p>
<ul>
<li><p><strong>Deploy</strong> each one separately</p>
</li>
<li><p><strong>Monitor</strong> them individually (to ensure they don’t crash/become slow due to too much load)</p>
</li>
<li><p><strong>Scale</strong> them (make them bigger to handle more users) as traffic surges, one by one</p>
</li>
</ul>
<p>So, if your banking app suddenly gets millions of users, you'd have to manually tweak and update each microservice to keep it running smoothly. 😖 It’s a lot of work, and if something goes wrong, you’re in deep trouble.</p>
<h3 id="heading-this-is-where-kubernetes-comes-to-the-rescue">This is where Kubernetes comes to the rescue! 🚀</h3>
<p>Kubernetes is like a super-efficient manager for all these microservices. It’s a platform that helps you:</p>
<ul>
<li><p><strong>Automate</strong> the deployment (getting the apps up and running)</p>
</li>
<li><p><strong>Scale</strong> the microservices (making them bigger or smaller as needed based on the inflow of traffic – your customers)</p>
</li>
<li><p><strong>Monitor</strong> them (keeping an eye on their health)</p>
</li>
<li><p><strong>Ensure reliability</strong> (so if one microservice breaks/fails, k8s replaces it immediately)</p>
</li>
</ul>
<p>In simple terms, Kubernetes takes all your little microservices and organizes them, ensuring they run smoothly together, no matter how much traffic your app gets. It handles everything behind the scenes, like a conductor leading an orchestra, so your microservices work together without chaos.</p>
<h2 id="heading-how-applications-were-deployed-before-kubernetes"><strong>How Applications Were Deployed Before Kubernetes</strong></h2>
<p>Before Kubernetes came into the picture, software teams had quite the juggling act when it came to deploying applications – especially when they were made up of lots of microservices.</p>
<p>One popular method was using a <strong>distributed system</strong> setup. Here’s what that looked like:</p>
<p>Imagine each microservice (like your user onboarding, payments, deposits, and so on) being installed on separate servers (physical computers or virtual machines). Each of these servers had to be carefully prepared:</p>
<ul>
<li><p>The microservice itself needed to be installed.</p>
</li>
<li><p>The software dependencies it needed (like programming languages, libraries, tools) also had to be installed.</p>
</li>
<li><p>Everything had to be configured manually ON EACH server.</p>
</li>
</ul>
<p>And all of these servers had to talk to each other – sometimes over the public internet, or via private networks like VPNs.</p>
<p>Sounds like a lot of work, right? 😮 It was! Managing updates, fixing bugs, scaling up during traffic spikes, and keeping things from crashing could turn into a full-time headache for developers and system admins. 😖</p>
<h3 id="heading-then-came-containers">Then Came Containers 🚢</h3>
<p>A more modern solution that eased the pain (a little) was using containers.</p>
<p><strong>So, what are containers?</strong></p>
<p>Think of a container like a lunchbox for your microservice. Instead of installing the microservice and its supporting tools directly on a server, you pack everything it needs – code, settings, software libraries – into this single, neat container. Wherever the container goes, the microservice runs exactly the same way. No surprises!</p>
<p>Tools like <a target="_blank" href="https://www.docker.com/">Docker</a> made this super easy. Once your microservice was packed into a container, you could deploy it on:</p>
<ul>
<li><p>A single server</p>
</li>
<li><p>Multiple servers</p>
</li>
<li><p>Or cloud platforms like AWS Elastic Beanstalk, Azure App Service, or Google Cloud Run.</p>
</li>
</ul>
<h2 id="heading-the-problem-kubernetes-solves"><strong>The Problem Kubernetes Solves</strong> 🧠</h2>
<p>At first, when containers arrived on the scene, it felt like developers had struck gold.</p>
<p>You could package a microservice into a neat little container and run it anywhere – no more installing the same software on every server again and again. Tools like Docker and Docker Compose made this smooth for small projects.</p>
<p>But the real world? That’s where it got messy.</p>
<h3 id="heading-the-growing-headache-of-managing-containers">The Growing Headache of Managing Containers 💡</h3>
<p>When you have just a few microservices, you can manually deploy and manage their containers without much stress. But when your app grows – and you suddenly have dozens or even hundreds of microservices – managing them becomes an uphill battle:</p>
<ul>
<li><p>You had to deploy each container manually.</p>
</li>
<li><p>You had to restart them if one crashed.</p>
</li>
<li><p>You had to scale them one by one when more users started flooding in.</p>
</li>
</ul>
<p>Docker and Docker Compose were great for a small playground or startups, but not for an enterprise application with high traffic inflow.</p>
<h3 id="heading-cloud-managed-services-helped-but-only-up-to-a-point">Cloud-Managed Services Helped... But Only Up To a Point 🧑‍💻</h3>
<p>Cloud services like AWS Elastic Beanstalk, Azure App Service, and Google Code Engine offered a shortcut. They let you deploy containers without worrying about setting up servers.</p>
<p>You could:</p>
<ul>
<li><p>Deploy each container on its own managed cloud instance.</p>
</li>
<li><p>Scale them automatically based on traffic.</p>
</li>
</ul>
<p>BUT there were still some big headaches:</p>
<h4 id="heading-grouping-microservices-was-awkward-and-expensive">📦 Grouping microservices was awkward and expensive</h4>
<p>Sure, you could organize containers by environment (like “testing” or “production”) or even by team (like “Finance” or “HR”). But each new microservice usually needed its own cloud instance – for example, a separate Azure App Service or Elastic Beanstalk environment FOR EVERY SINGLE CONTAINER.</p>
<p>Imagine this:</p>
<ul>
<li><p>Each App Service instance costs ~$50 per month.</p>
</li>
<li><p>You’ve got 10 microservices.</p>
</li>
<li><p>That’s $500/month... even if they’re barely used. 💸 Yikes!</p>
</li>
</ul>
<h3 id="heading-kubernetes-smarter-leaner-and-more-flexible">Kubernetes: Smarter, Leaner, and More Flexible 💪</h3>
<p>With Kubernetes, you don’t need to spin up a separate server for each microservice. You can start with just one or two servers (VMs) – and Kubernetes will automatically decide which container goes where based on available space and resources.</p>
<p>No stress, no waste! 💡</p>
<h3 id="heading-kubernetes-lets-you-customize-everything">🧑‍🍳 <strong>Kubernetes Lets You Customize Everything</strong></h3>
<ol>
<li><p>You can assign resources to each microservice container.<br> 👉 Example: If you have a "Payment" microservice that’s lightweight, you might give it 0.5 vCPUs and 512MB of memory. If you have a "Data Analytics" microservice that’s resource-hungry, you could give it 2 vCPUs and 4GB of memory.</p>
</li>
<li><p>You can set a minimum number of instances for each microservice.<br> 👉 Example: If you want at least 2 copies of your "Login" service always running (so your app doesn’t break if one fails), Kubernetes makes sure you always have 2 live copies at all times.</p>
</li>
<li><p>You can group your containers however you like:<br> 👉 By teams (Finance, HR, DevOps) or by environments (Testing, Staging, Production). Kubernetes makes this grouping super clean and logical.</p>
</li>
<li><p>You can automatically scale individual containers.<br> 👉 When more users flood your app, Kubernetes can create extra copies (called “replicas”) of only the containers that are under pressure. No more wasting resources on containers that don’t need it.</p>
</li>
<li><p>You can even scale your servers!<br> 👉 Kubernetes can automatically increase the number of servers (VMs) in your environment – called a <strong>Cluster</strong> – when traffic grows. So you could start with 2 VMs at $30 each ($60/month) and let Kubernetes add more servers only when necessary, rather than locking yourself into high fixed costs like $500/month for cloud-managed services.</p>
</li>
</ol>
<p>Also, Kubernetes works <strong>the same way everywhere</strong>. Whether you deploy your containers on AWS, Google Cloud, Azure, or even your own laptop – Kubernetes doesn’t care. Your setup stays the same.</p>
<p>Compare that to managed services like Elastic Beanstalk or Azure App Service – which tie you to their platform, making it super hard to switch later.</p>
<p>✅ <strong>In short:</strong> Kubernetes saves you money, time, and a whole lot of headaches. It lets you run, scale, and organize your microservices without being chained to a single cloud provider — and without drowning in manual work.</p>
<h2 id="heading-how-kubernetes-works-components-of-a-kubernetes-environment"><strong>How Kubernetes Works — Components of a Kubernetes Environment</strong> 🧑‍🔧</h2>
<p>So by now you’ve seen the problem: running dozens (or hundreds!) of microservices manually is like juggling too many balls – you’re bound to drop some.</p>
<p>That’s why Kubernetes was created. But... how does it actually do all this magic? Let’s first break it down with the technical definition (simple but sharp – perfect for interviews) and then the layperson’s analogy (so it sticks in your head!).</p>
<h3 id="heading-1-cluster">1️⃣ <strong>Cluster 🏰</strong></h3>
<p>A Kubernetes Cluster is the entire setup of machines (physical or cloud-based) where Kubernetes runs. It’s made of one or more Master Nodes and Worker Nodes, working together to deploy and manage containerized applications.</p>
<p>Think of a Kubernetes Cluster as your entire playground. This is the environment where all your microservices live, grow, and play together.</p>
<p>A cluster is made up of two types of computers (called nodes):</p>
<ul>
<li><p>Master Node (nowadays often called the Control Plane)</p>
</li>
<li><p>Worker Nodes</p>
</li>
</ul>
<h3 id="heading-2-master-node-control-plane">2️⃣ <strong>Master Node (Control Plane) 👑</strong></h3>
<p>The Master Node is like the brain of Kubernetes. It manages and coordinates the whole cluster – deciding which applications run where, monitoring health, and scaling things up or down as needed.</p>
<p>It’s like the boss of the entire cluster. It doesn’t run your applications directly. Instead, it:</p>
<ul>
<li><p>Watches over the worker nodes</p>
</li>
<li><p>Decides which microservice (container) goes where</p>
</li>
<li><p>Makes sure everything runs smoothly and fairly</p>
</li>
</ul>
<p>Think of it like a factory manager who tells machines what to do, when to start, when to stop, and where to send the next package.</p>
<p>Inside the Master Node are a few clever mini-components that handle the real work.</p>
<h3 id="heading-3-api-server">3️⃣ <strong>API Server 💌</strong></h3>
<p>The API Server is the front door to Kubernetes. It handles communication between users and the system, taking commands and feeding them into the cluster.</p>
<p>This is where you (or your team) give Kubernetes instructions. Whether you're deploying a new app or scaling an existing one, you "talk" to the API Server first. It's like submitting a request at the front desk – the API server passes it on to the right people (or machines).</p>
<h3 id="heading-4-scheduler">4️⃣ <strong>Scheduler 📅</strong></h3>
<p>The Scheduler assigns Pods (applications) to Worker Nodes based on available resources and needs.</p>
<p>Imagine you’ve asked Kubernetes to launch a new microservice. The Scheduler checks:</p>
<ul>
<li><p>Which worker node has enough space?</p>
</li>
<li><p>Which node has enough memory and CPU?</p>
</li>
<li><p>Where would this service run best?</p>
</li>
</ul>
<p>It makes the decision and assigns the microservice to the perfect spot. Smart, huh?</p>
<h3 id="heading-5-controller-manager">5️⃣ <strong>Controller Manager 🎛️</strong></h3>
<p>The Controller Manager runs controllers that watch over the cluster and ensures that the system’s actual state matches the desired state.</p>
<p>This component watches over the system like a hawk. Let’s say you told Kubernetes:<br><em>"Hey, I want 3 copies of my payment microservice running at all times."</em></p>
<p>If one of them crashes, the Controller Manager sees that and spins up a new one to replace it automatically. It makes sure the reality always matches the plan.</p>
<h3 id="heading-6-etcd">6️⃣ <strong>etcd 📚</strong></h3>
<p>etcd is Kubernetes' memory – a distributed key-value store where cluster data is saved: config files, state, and metadata.</p>
<p>Imagine a notebook where all rules, records, and plans are written down. Without etcd, Kubernetes would forget everything.</p>
<h3 id="heading-7-worker-nodes">7️⃣ <strong>Worker Nodes 💪</strong></h3>
<p>Worker Nodes are the servers that run the actual application containers, doing the heavy lifting in the cluster.</p>
<p>These are the machines where your microservices actually live and run. The Master Node gives orders, but the Worker Nodes do the heavy lifting – they run your containers!</p>
<p>Each worker node has a few helpers to manage its microservices:</p>
<ul>
<li><p>The Kubelet</p>
</li>
<li><p>The Kube Proxy</p>
</li>
</ul>
<h3 id="heading-8-kubelet">8️⃣ <strong>Kubelet 📢</strong></h3>
<p>The Kubelet is the agent which lives on each Worker Node that makes sure containers are healthy and running as expected.</p>
<p>It listens to the Master Node’s instructions. If the Master Node says:<em>"Hey, run this container!",</em> the Kubelet makes it happen and keeps it running. If something goes wrong, the Kubelet reports back to the Master Node</p>
<h3 id="heading-9-kube-proxy">9️⃣ <strong>Kube Proxy 🚦</strong></h3>
<p>Kube Proxy handles network traffic, ensuring that Pods can talk to each other and to the outside world.</p>
<p>Imagine your banking app’s login service needs to talk to the payments service. The Kube Proxy handles the routing so the request reaches the right place. It also handles load balancing, so no single microservice gets overwhelmed.</p>
<p>So, to summarize:</p>
<ul>
<li><p>The Master Node is the boss – it plans, watches, and assigns tasks.</p>
</li>
<li><p>The Worker Nodes do the actual work – running your microservices.</p>
</li>
<li><p>Components like etcd, Kubelet, Scheduler, Controller Manager, and Kube Proxy all work together like parts of a well-oiled machine.</p>
</li>
</ul>
<p>Kubernetes is designed to handle your microservices automatically – keeping them alive, scaling them up, moving them around, and restarting them if they crash – so you don’t have to babysit them yourself.</p>
<h2 id="heading-kubernetes-workloads-pods-deployments-services-amp-more">Kubernetes Workloads 🛠️ — Pods, Deployments, Services, &amp; More</h2>
<p>Kubernetes workloads are the objects you use to manage and run your applications. Think of them as blueprints 📐 that tell Kubernetes <strong>what</strong> to run and <strong>how</strong> to run it – whether it’s a single app container, a group of containers, a database, or a batch job. Here are some of the workloads in Kubernetes:</p>
<h3 id="heading-1-pods">1️⃣ <strong>Pods</strong></h3>
<p>A <strong>Pod</strong> is the smallest and simplest unit in the Kubernetes object model. It represents a single instance of a running process in your cluster and can contain one or more containers that share storage and network resources. ​</p>
<p>Think of a Pod as a wrapper around one or more containers that need to work together. They share the same network IP and storage, allowing them to communicate easily and share data. Pods are ephemeral (live for a short time, they can be replaced very easily). If a Pod dies, Kubernetes can create a new one to replace it almost instantly.​</p>
<p>Say you have an application which is split into 2 distributed monoliths – a frontend and a backend. The frontend will run in a container in Pod A, while the backend app will run in a container in another Pod B.</p>
<h3 id="heading-2-deployments">2️⃣ <strong>Deployments</strong></h3>
<p>A <strong>Deployment</strong> provides declarative updates for Pods and ReplicaSets. You describe a desired state in a Deployment, and the Deployment Controller changes the actual state to the desired state at a controlled rate.</p>
<p>Deployments manage the lifecycle of your application Pods. They ensure that the specified number of Pods are running and can handle updates, rollbacks, and scaling. If a Pod fails, the Deployment automatically replaces it to maintain the desired state.​</p>
<p>Imagine you're managing a store. A Deployment is like the store manager – you tell it how many workers (Pods) you want, and it makes sure they’re always present. If one doesn't show up for work, the manager finds a replacement automatically. You can also tell it to hire more workers or fire some when needed.</p>
<h3 id="heading-3-services">3️⃣ <strong>Services</strong></h3>
<p>A <strong>Service</strong> in Kubernetes defines a way to access/communicate with Pods. Services enable communication between different Pods (for example, your frontend Pod A can communicate with your backend Pod B via a service) and can expose your application to external traffic (for example the public internet). ​</p>
<p>Services act as a stable endpoint to access a set of Pods. Even if the underlying Pods change, the Service's IP and DNS name remain constant, ensuring communication between the Pods within the cluster or with the internet.</p>
<p>A Service is like the front door to your app. No matter which worker (Pod) is behind it, people always use the same entrance to access it. It hides the messy stuff happening behind the scenes and gives users a simple way to connect to your app.</p>
<h3 id="heading-4-replicasets">4️⃣ <strong>ReplicaSets</strong></h3>
<p>A <strong>ReplicaSet</strong> ensures that a specified number of identical Pods are running at any given time. It is often used to guarantee the availability of a specified number of Pods (horizontal scaling). ​</p>
<p>ReplicaSets maintain a stable set of running Pods. If a Pod crashes or is deleted, the ReplicaSet automatically creates a new one to replace it, ensuring your application remains available.​</p>
<p>Think of a ReplicaSet like a robot that counts how many copies of your app are running. If one goes missing, it automatically makes a new one. It keeps the number steady, just like you told it to.</p>
<h3 id="heading-5-daemonsets">5️⃣ <strong>DaemonSets</strong></h3>
<p>A <strong>DaemonSet</strong> ensures that all (or some) Nodes run an instance (a copy) of a specific Pod. As nodes are added to the cluster, Pods are added to them. As nodes are removed from the cluster, those Pods are also removed. ​</p>
<p>DaemonSets are used to deploy a Pod on every node in the cluster. This is useful for running background tasks like log collection or monitoring agents on all nodes (for example to get the CPU, memory, and disk usage of each node).​</p>
<p>A DaemonSet is like saying, “I want this helper app to run on <strong>every single computer</strong> we have.” As mentioned earlier, it’s great for things like log collectors or security checkers – small helpers that every machine should have.</p>
<h3 id="heading-6-statefulsets">6️⃣ <strong>StatefulSets</strong></h3>
<p>A <strong>StatefulSet</strong> is the workload API object used to manage stateful applications (applications that store data, for example in their filesystem – databases). It manages the deployment and scaling of a set of Pods and provides guarantees about the ordering and uniqueness of these Pods.</p>
<p>StatefulSets are designed for applications that require persistent storage and stable network identities, like databases.</p>
<p>Let’s say you’re running a database or anything that needs to save info. A StatefulSet is like giving each app a name tag and a personal drawer to store their stuff. Even if you restart them, they come back with the same name and same drawer.</p>
<h3 id="heading-7-jobs">7️⃣ <strong>Jobs</strong></h3>
<p>A <strong>Job</strong> creates one or more Pods and ensures that a specified number of them successfully terminate. As Pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the Job is complete. ​</p>
<p>A Job is like a one-time task. Imagine sending out a batch of emails or processing a report. You want the task to run, finish, and then stop. That’s exactly what a Job does.</p>
<h3 id="heading-8-cronjobs">8️⃣ <strong>CronJobs</strong></h3>
<p>A <strong>CronJob</strong> creates Jobs on a time-based schedule. It runs a Job periodically on a given schedule, written in Cron format.</p>
<p>A CronJob is like setting a reminder or alarm. It tells your app (in this case the Job) to do something every night at 2 AM, every Monday morning, or once a month – whatever schedule you give it.</p>
<h2 id="heading-how-to-create-a-kubernetes-cluster-in-a-demo-environment-with-play-with-k8s">🛠️ How to Create a Kubernetes Cluster in a Demo Environment with <code>play-with-k8s</code></h2>
<p>As we've discussed earlier, a Kubernetes cluster is a set of machines (called nodes) that run containerized applications.</p>
<p>Setting up a Kubernetes cluster locally or in the cloud can be complex and expensive. To simplify the learning process, Docker provides a free, browser-based platform called <a target="_blank" href="https://labs.play-with-k8s.com/">Play with Kubernetes</a>. This environment allows you to create and interact with a Kubernetes cluster without installing anything on your local machine. It's an excellent tool for beginners to get hands-on experience with Kubernetes.​</p>
<h3 id="heading-sign-in-to-play-with-kubernetes">🔐 Sign in to Play with Kubernetes</h3>
<ol>
<li><p><strong>Visit the platform</strong> at <a target="_blank" href="https://labs.play-with-k8s.com/">https://labs.play-with-k8s.com/</a>.​</p>
</li>
<li><p><strong>Authenticate:</strong></p>
<ul>
<li><p>Click on the "Login" button.</p>
</li>
<li><p>You can sign in using your Docker Hub or GitHub account.</p>
</li>
<li><p>If you don't have an account, you can create one for free on <a target="_blank" href="https://hub.docker.com/">Docker Hub</a> or <a target="_blank" href="https://github.com/">GitHub</a>.​</p>
</li>
</ul>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746083007442/a038ee6c-b471-4880-ba17-2e8927678780.png" alt="Sign in to Play with k8s" class="image--center mx-auto" width="770" height="848" loading="lazy"></p>
<h3 id="heading-create-your-kubernetes-cluster">🚀 Create Your Kubernetes Cluster</h3>
<p>Once signed in, follow these steps to set up your cluster:</p>
<h4 id="heading-step-1-start-a-new-session">Step 1: Start a New Session:</h4>
<p>Click on the <strong>"Start"</strong> button to initiate a new session.​ This will create a new session giving you about 4 hours of play time, after which the cluster and it’s resources will be automatically terminated.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746083204331/8410e18b-4ed4-4374-8d4f-44f0fefa1623.png" alt="Play with k8s timed session" class="image--center mx-auto" width="1590" height="254" loading="lazy"></p>
<h4 id="heading-step-2-add-instances">Step 2: Add Instances:</h4>
<p>Then click on <strong>"+ Add New Instance"</strong> to create a new node (Virtual Machine).  </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746083280594/740d963a-c70f-43c6-8354-e6ea0c3d7f41.png" alt="Create new master node (VM)" class="image--center mx-auto" width="332" height="254" loading="lazy"></p>
<p>This will open a terminal window where you can run commands.​  </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746083304493/ffd34d73-e5cd-41d0-908a-2240924e7ad0.png" alt="Terminal of newly created node" class="image--center mx-auto" width="1912" height="966" loading="lazy"></p>
<h4 id="heading-step-3-initialize-the-master-node">Step 3: Initialize the Master Node:</h4>
<p>In the terminal, run the following command to initialize the master node:​</p>
<pre><code class="lang-bash">kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr &lt;SPECIFIED_IP_ADDRESS&gt;
</code></pre>
<p>You can find the command in the terminal. In my case, the IP address is <code>10.5.0.0/16</code>. Replace the <code>&lt;SPECIFIED_IP_ADDRESS&gt;</code> placeholder with the IP address specified in your terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746083865451/fdf18710-c987-4221-bc02-369cd709a849.png" alt="Initialize the master node and the control plane" class="image--center mx-auto" width="1124" height="389" loading="lazy"></p>
<p>This process will set up the control plane of your Kubernetes cluster.​</p>
<h4 id="heading-step-4-add-worker-nodes">Step 4: Add Worker Nodes:</h4>
<p>If you want to add worker nodes, in the master node terminal, you'll find a <code>kubeadm join...</code> command after running the <code>kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr &lt;SPECIFIED_IP_ADDRESS&gt;</code> command.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746084559142/6e539ef6-0219-40da-95e7-42abc9f1af8c.png" alt="Command to add worker node to control plane" class="image--center mx-auto" width="1571" height="627" loading="lazy"></p>
<p>Click on <strong>"+ Add New Instance"</strong> to create another node just as you did earlier.</p>
<p>Run this command in the new node's terminal to join it to the cluster:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746084666411/78f07ba1-7f1f-402e-9ed8-c4d6054bdcab.png" alt="Add worker node to control plane" class="image--center mx-auto" width="1912" height="966" loading="lazy"></p>
<h4 id="heading-step-5-configure-the-clusters-networking">Step 5: Configure the Cluster’s networking:</h4>
<p>Navigate to the master node, and run the command below to configure the cluster’s networking.</p>
<pre><code class="lang-bash">kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746085296963/ba35966c-5dd1-4e17-b4b5-85639cb3a80d.png" alt="Configure networking in the cluster" class="image--center mx-auto" width="1532" height="467" loading="lazy"></p>
<h4 id="heading-step-6-verify-the-cluster">Step 6: Verify the Cluster:</h4>
<p>In the master node terminal (the first node with the highlighted user profile), run:​</p>
<pre><code class="lang-bash">kubectl get nodes
</code></pre>
<p>You should see a list of nodes in your cluster, including the master and any worker nodes you've added.​</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746085583418/45e55418-4b0f-461f-98d8-3b0c8f19b839.png" alt="Nodes in the cluster" class="image--center mx-auto" width="466" height="138" loading="lazy"></p>
<p>Congratulations! You just created your very own Kubernetes cluster with 2 VMs: the master node (where the control plane resides), and the worker nodes (where the Kubernetes workloads, for example Pods, will be deployed).</p>
<h2 id="heading-how-to-deploy-an-application-on-your-kubernetes-cluster">🚀 How to Deploy an Application on Your Kubernetes Cluster</h2>
<p>Now that we've set up our Kubernetes cluster using Play with Kubernetes, it's time to deploy the application and make it accessible over the internet.</p>
<h3 id="heading-understanding-imperative-vs-declarative-approaches-in-kubernetes">🧠 Understanding Imperative vs. Declarative Approaches in Kubernetes</h3>
<p>Before we proceed, it's essential to grasp the two primary methods for managing resources in Kubernetes: <strong>Imperative</strong> and <strong>Declarative</strong>.</p>
<h3 id="heading-imperative-approach">🖋️ Imperative Approach</h3>
<p>In the imperative approach, you directly issue commands to the Kubernetes API to create or modify resources. Each command specifies the desired action, and Kubernetes executes it immediately.​</p>
<p>Imagine telling someone, "Turn on the light." You're giving a direct command, and the action happens right away. Similarly, with imperative commands, you instruct Kubernetes step-by-step on what to do.</p>
<p><strong>Example:</strong><br>To create a pod running an NGINX container, run the below command in the terminal of the master node:​</p>
<pre><code class="lang-bash">kubectl run nginx-pod --image=nginx
</code></pre>
<p>Now wait a few seconds and run the command below to check the status of the pod:</p>
<pre><code class="lang-bash">kubectl get pods
</code></pre>
<p>You should get a response similar to this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746087463204/52ef26e5-96df-4d91-8a2d-7527a38786d2.png" alt="Get pods running in the cluster" class="image--center mx-auto" width="465" height="118" loading="lazy"></p>
<p>Now let’s expose our Pod to the internet by creating a <strong>Service.</strong> Run the command below to expose the Pod:</p>
<pre><code class="lang-bash">kubectl expose pod nginx-pod --<span class="hljs-built_in">type</span>=NodePort --port=80
</code></pre>
<p>To get the IP address of the Cluster so we can access our Pod, run the command below:</p>
<pre><code class="lang-bash">kubectl get svc
</code></pre>
<p>The command displays the IP address from which we can access our service. You should get an output similar to this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746088678881/a4f3bdbc-c7eb-4696-ba6e-587637be5792.png" alt="Get service IP address" class="image--center mx-auto" width="712" height="140" loading="lazy"></p>
<p>Now, copy the IP address for the <code>nginx-pod</code> service and run the command below to make a request to your Pod:</p>
<pre><code class="lang-bash">curl &lt;YOUR-SERVICE-IP-ADDRESS&gt;
</code></pre>
<p>Replace the <code>&lt;YOUR-SERVICE-IP-ADDRESS&gt;</code> placeholder with the IP address of your <code>nginx-pod</code> service. In my case, it’s <code>10.98.108.173</code>.</p>
<p>You should get a response from your <code>nginx-pod</code> Pod:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746088937046/8b86cd63-21f0-45d3-9ab5-59bd630fb37c.png" alt="Make a request to the Nginx Pod running in the Cluster" class="image--center mx-auto" width="730" height="465" loading="lazy"></p>
<p>We couldn’t access the Pod from the internet, that is our browser, because our Cluster isn’t connected to a cloud service like AWS or Google Cloud which can provide us with an external load balancer.</p>
<p>Now let’s try doing the same thing but using the Declarative method.</p>
<h3 id="heading-declarative-approach">🚀 Declarative Approach</h3>
<p>So far, we used the imperative approach, where we typed commands like <code>kubectl run</code> or <code>kubectl expose</code> directly into the terminal to make Kubernetes do something immediately.</p>
<p>But Kubernetes has another (and often better) way to do things: the declarative approach.</p>
<h4 id="heading-what-is-the-declarative-approach">🧾 What Is the Declarative Approach?</h4>
<p>Instead of giving Kubernetes instructions step-by-step like a chef in a kitchen, you give it a full recipe – a file that describes exactly what you want (for example, what app to run, how many copies of it, how to expose it, and so on).</p>
<p>This recipe is written in a file called a <strong>manifest</strong>.</p>
<h4 id="heading-whats-a-manifest">📘 What’s a Manifest?</h4>
<p>A manifest is a file (usually written in YAML format) that describes a Kubernetes object – like a Pod, a Deployment, or a Service.</p>
<p>It’s like writing down what you want, handing it over to Kubernetes, and saying: “Hey, please make sure this exists exactly how I described it.”</p>
<p>We’ll use two manifests:</p>
<ol>
<li><p>One to deploy our application</p>
</li>
<li><p>Another to expose it to the internet</p>
</li>
</ol>
<p>Let’s walk through it!</p>
<h4 id="heading-step-1-clone-the-github-repo">📁 Step 1: Clone the GitHub Repo</h4>
<p>We already have a GitHub repo that contains the two manifest files we need. Let’s clone it into our Kubernetes environment.</p>
<p>Run this in the terminal (on your master node):</p>
<pre><code class="lang-bash">git <span class="hljs-built_in">clone</span> https://github.com/onukwilip/simple-kubernetes-app
</code></pre>
<p>Now, let’s go into the folder:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> simple-kubernetes-app
</code></pre>
<p>You should see two files:</p>
<ul>
<li><p><code>deployment.yaml</code></p>
</li>
<li><p><code>service.yaml</code></p>
</li>
</ul>
<h4 id="heading-step-2-understanding-the-deployment-manifest-deploymentyaml">📦 Step 2: Understanding the Deployment Manifest (<code>deployment.yaml</code>)</h4>
<p>This manifest will tell Kubernetes to deploy our app and ensure it’s always running.</p>
<p>Here’s what’s inside:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">apps/v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Deployment</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">nginx-deployment</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">replicas:</span> <span class="hljs-number">3</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">matchLabels:</span>
      <span class="hljs-attr">app:</span> <span class="hljs-string">nginx</span>
  <span class="hljs-attr">template:</span>
    <span class="hljs-attr">metadata:</span>
      <span class="hljs-attr">labels:</span>
        <span class="hljs-attr">app:</span> <span class="hljs-string">nginx</span>
    <span class="hljs-attr">spec:</span>
      <span class="hljs-attr">containers:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">nginx</span>
        <span class="hljs-attr">image:</span> <span class="hljs-string">nginx</span>
</code></pre>
<p>Now, let’s break this down:</p>
<ul>
<li><p><code>apiVersion: apps/v1</code>: This tells Kubernetes which version of the API we’re using to define this object.</p>
</li>
<li><p><code>kind: Deployment</code>: This means we’re creating a Deployment (a controller that manages Pods).</p>
</li>
<li><p><code>metadata.name</code>: We’re giving our Deployment a name: <code>nginx-deployment</code>.</p>
</li>
<li><p><code>spec.replicas: 3</code>: We’re telling Kubernetes: “Please run 3 copies (replicas) of this app.”</p>
</li>
<li><p><code>selector.matchLabels</code>: Kubernetes will use this label to find which Pods this Deployment is managing.</p>
</li>
<li><p><code>template.metadata.labels</code> &amp; <code>spec.containers</code>: This section describes the Pods that the Deployment should create – each Pod will run a container using the official <code>nginx</code> image.</p>
</li>
</ul>
<p>✅ In plain terms: We're asking Kubernetes to create and maintain 3 copies of an app that runs NGINX, and automatically restart them if any fails.</p>
<h4 id="heading-step-3-understanding-the-service-manifest-serviceyaml">🌐 Step 3: Understanding the Service Manifest (<code>service.yaml</code>)</h4>
<p>This file tells Kubernetes to expose our NGINX app to the outside world using a Service.</p>
<p>Here’s the file – let’s break this down, too:</p>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">v1</span>
<span class="hljs-attr">kind:</span> <span class="hljs-string">Service</span>
<span class="hljs-attr">metadata:</span>
  <span class="hljs-attr">name:</span> <span class="hljs-string">nginx-service</span>
<span class="hljs-attr">spec:</span>
  <span class="hljs-attr">type:</span> <span class="hljs-string">NodePort</span>
  <span class="hljs-attr">selector:</span>
    <span class="hljs-attr">app:</span> <span class="hljs-string">nginx</span>
  <span class="hljs-attr">ports:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">protocol:</span> <span class="hljs-string">TCP</span>
    <span class="hljs-attr">port:</span> <span class="hljs-number">80</span>
    <span class="hljs-attr">targetPort:</span> <span class="hljs-number">80</span>
</code></pre>
<ul>
<li><p><code>apiVersion: v1</code>: We’re using version 1 of the Kubernetes API.</p>
</li>
<li><p><code>kind: Service</code>: We’re creating a Service object.</p>
</li>
<li><p><code>metadata.name: nginx-service</code>: Giving it a name.</p>
</li>
<li><p><code>spec.type: NodePort</code>: We’re exposing it through a port on the node (so we can access it via the node's IP address).</p>
</li>
<li><p><code>selector.app: nginx</code>: This tells Kubernetes to connect this Service to Pods with the label <code>app: nginx</code>.</p>
</li>
<li><p><code>ports.port</code> and <code>targetPort</code>: The Service will listen on port 80 and forward traffic to port 80 on the Pod.</p>
</li>
</ul>
<p>✅ In plain terms: This file says, “Expose our NGINX app through the cluster’s network so we can access it from the outside world.”</p>
<h4 id="heading-step-4-clean-up-previous-resources">🧹 Step 4: Clean Up Previous Resources</h4>
<p>If you’re still running the Pod and Service we created using the imperative approach, let’s delete them to avoid conflicts:</p>
<pre><code class="lang-bash">kubectl delete pod nginx-pod
kubectl delete service nginx-pod
</code></pre>
<h4 id="heading-step-5-apply-the-manifests">📥 Step 5: Apply the Manifests</h4>
<p>Now let’s deploy the NGINX app and expose it – this time using the <strong>declarative</strong> way.</p>
<p>From inside the <code>simple-kubernetes-app</code> folder, run:</p>
<pre><code class="lang-bash">kubectl apply -f deployment.yaml
</code></pre>
<p>Then:</p>
<pre><code class="lang-bash">kubectl apply -f service.yaml
</code></pre>
<p>This will create the Deployment and the Service described in the files. 🎉</p>
<h4 id="heading-step-6-check-that-its-running">🔍 Step 6: Check That It’s Running</h4>
<p>Let’s see if the Pods were created:</p>
<pre><code class="lang-bash">kubectl get pods
</code></pre>
<p>You should see 3 Pods running!</p>
<p>And let’s check the service:</p>
<pre><code class="lang-bash">kubectl get svc
</code></pre>
<p>Look for the <code>nginx-service</code>. You’ll see something like:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746092825896/617084f1-3a71-4cfd-a287-9f7a9ac08810.png" alt="Access service NodePort" class="image--center mx-auto" width="736" height="181" loading="lazy"></p>
<p>Note the <strong>NodePort</strong> (for example, <code>30001</code>) as we’ll use it to access the app.</p>
<h4 id="heading-step-7-access-the-app">🌍 Step 7: Access the App</h4>
<p>You can now send a request to your app like this:</p>
<pre><code class="lang-bash">curl http://&lt;YOUR-NODE-IP&gt;:&lt;NODE-PORT&gt;
</code></pre>
<blockquote>
<p>Replace <code>&lt;YOUR-NODE-IP&gt;</code> with the IP of your master node (you’ll usually find this in Play With Kubernetes at the top of your terminal), and <code>&lt;NODE-PORT&gt;</code> with the NodePort shown in the <code>kubectl get svc</code> command.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746092570586/b33cabc0-ea1e-4a70-ab55-9f3a0761bec0.png" alt="Get master node IP address" class="image--center mx-auto" width="897" height="501" loading="lazy"></p>
<p>You should see the HTML content of the NGINX welcome page printed out.</p>
<p>Now terminate the cluster environment by clicking the <strong>CLOSE SESSION</strong> button:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1746093081895/79139f75-5e6b-4991-be74-38ecbbf2ef66.png" alt="79139f75-5e6b-4991-be74-38ecbbf2ef66" class="image--center mx-auto" width="336" height="407" loading="lazy"></p>
<h3 id="heading-why-declarative-is-better-in-most-cases">🆚 Why Declarative Is Better (In Most Cases)</h3>
<ul>
<li><p>🔁 <strong>Reusable</strong>: You can use the same files again and again.</p>
</li>
<li><p>📦 <strong>Version-controlled</strong>: You can push these files to GitHub and track changes over time.</p>
</li>
<li><p>🛠️ <strong>Fixes mistakes easily</strong>: Want to change 3 replicas to 5? Just update the file and re-apply!</p>
</li>
<li><p>🧠 <strong>Easier to maintain</strong>: Especially when you have many resources to manage.</p>
</li>
</ul>
<h2 id="heading-advantages-of-using-kubernetes-in-business">💼 Advantages of Using Kubernetes in Business</h2>
<p>Kubernetes isn’t just a developer tool—it’s a business enabler as well. It helps companies deliver products faster, more reliably, and with reduced operational overhead.</p>
<p>Let’s break down how Kubernetes translates to real-world business benefits:</p>
<h3 id="heading-1-better-use-of-cloud-resources-cost-savings">1️⃣ <strong>Better Use of Cloud Resources = Cost Savings</strong></h3>
<p>Before Kubernetes, deploying many microservices for a single application often meant creating separate cloud resources (like one Azure App Service per microservice), which could rack up huge costs quickly. Imagine $50/month per service × 10 services = $500/month 😬.</p>
<p><strong>With Kubernetes:</strong><br>You can run multiple microservices on fewer virtual machines (VMs) while Kubernetes automatically decides the most efficient way to use the available servers. That means you pay for fewer servers and get more out of them 💸.</p>
<h3 id="heading-2-high-availability-and-uptime-happy-customers">2️⃣ <strong>High Availability and Uptime = Happy Customers</strong></h3>
<p>Kubernetes watches your apps like a hawk 👀. If one of them crashes or fails, Kubernetes restarts or replaces it <em>immediately</em> – automatically.</p>
<p><strong>For your business:</strong><br>This means less downtime, fewer support tickets, and happier customers who don’t even notice when things go wrong in the background.</p>
<h3 id="heading-3-easy-scaling-during-high-demand">3️⃣ <strong>Easy Scaling During High Demand</strong></h3>
<p>Manually scaling apps during high traffic (like Black Friday) can be a nightmare 😰. And if you don't act fast, customers experience slowness or crashes.</p>
<p><strong>With Kubernetes:</strong><br>You can configure each microservice to automatically scale — meaning it adds more instances of that service <em>only when needed</em> (too many users on your site trying to purchase different products) and scales back down when traffic drops. This ensures your app is always responsive and you only pay for what you use.</p>
<h3 id="heading-4-faster-deployment-faster-time-to-market">4️⃣ <strong>Faster Deployment = Faster Time to Market</strong></h3>
<p>Kubernetes supports automation and repeatability. Teams can deploy new features or microservices faster without worrying about infrastructure setup every time.</p>
<p><strong>For business:</strong><br>This means faster product updates, quicker response to market demands, and competitive advantage 🚀.</p>
<h3 id="heading-5-consistent-environments-fewer-bugs">5️⃣ <strong>Consistent Environments = Fewer Bugs</strong></h3>
<p>Each microservice in Kubernetes is containerized, meaning it runs with all its dependencies in a self-contained package. You can run the exact same app setup in:</p>
<ul>
<li><p>Development</p>
</li>
<li><p>Testing</p>
</li>
<li><p>Production</p>
</li>
</ul>
<p>This reduces bugs caused by "it works on my machine" issues 🤦‍♂️ and helps teams build with confidence.</p>
<h3 id="heading-6-vendor-independence-bye-bye-to-vendor-lock-in">6️⃣ <strong>Vendor Independence (Bye-bye to Vendor lock-in)</strong></h3>
<p>When you use cloud-managed services (like AWS Elastic Beanstalk or Azure App Service), it’s often hard to move to another provider because everything is tailored to that specific platform.</p>
<p><strong>With Kubernetes:</strong><br>It works the same way on AWS, Azure, GCP, or even your own data center. This means you can switch cloud providers easily and avoid being locked into one vendor – aka cloud freedom! ☁️🕊️</p>
<h3 id="heading-7-organizational-clarity">7️⃣ <strong>Organizational Clarity</strong></h3>
<p>Kubernetes lets you organize your apps clearly. You can group workloads by:</p>
<ul>
<li><p>Team (for example, Finance, HR)</p>
</li>
<li><p>Environment (for example, testing, staging, production)</p>
</li>
</ul>
<p>This structure helps large teams collaborate better, stay organized, and manage resources efficiently.</p>
<h2 id="heading-disadvantages-of-using-kubernetes">😬 Disadvantages of Using Kubernetes</h2>
<p>Like everything in tech, Kubernetes isn’t all rainbows and rockets 🚀. Just like any other tool, it has its pros and its cons. And it's super important for startup founders, product managers, or even CEOs to know when Kubernetes is the right fit – and when it’s just overkill.</p>
<p>Let’s break down the main disadvantages in a simple, honest way:</p>
<h3 id="heading-1-youll-likely-need-a-devops-engineer-or-team">👨‍🔧 1. You’ll Likely Need a DevOps Engineer or Team</h3>
<p>Kubernetes is powerful, yes. But that power comes with great responsibility 😅.</p>
<p>In simple terms:</p>
<ul>
<li><p>You don't just "click a button" and your app is magically running.</p>
</li>
<li><p>Kubernetes needs someone who understands how to set it up, keep it running, and fix issues when they pop up. This person (or team) is usually called a DevOps Engineer, SIte Relability Engineer or Cloud Engineer.</p>
</li>
</ul>
<p>Here’s what they’ll typically handle:</p>
<ul>
<li><p>Creating the cluster (the environment where your apps will run)</p>
</li>
<li><p>Defining how your app containers should behave (how many should run, how much memory they need, when they should restart, and so on)</p>
</li>
<li><p>Monitoring the apps and making sure they’re healthy</p>
</li>
<li><p>Ensuring security rules are followed</p>
</li>
<li><p>Handling automated scaling, deployment rollouts, backups, and so on.</p>
</li>
</ul>
<p>💡 <strong>In short:</strong> You’ll need someone skilled to manage this tool. If you’re a solo founder or a small team with no DevOps experience, Kubernetes might be too much upfront.</p>
<h3 id="heading-2-kubernetes-can-be-expensive-if-used-prematurely">💰 2. Kubernetes Can Be Expensive (If Used Prematurely)</h3>
<p>Kubernetes saves money at scale – but can cost more if you adopt it too early or for the wrong use case.</p>
<p>Here's why:</p>
<ul>
<li><p>Kubernetes is meant for managing multiple applications or microservices. If your business only has one small app, you’re using a rocket to deliver a pizza 🍕 – it’s just not necessary.</p>
</li>
<li><p>Kubernetes is also best when you have high or unpredictable traffic. It can automatically scale up your services when traffic spikes...but if your traffic is steady and small, you won’t benefit much from that power.</p>
</li>
</ul>
<p>Let’s say:</p>
<ul>
<li><p>You have one app with moderate traffic.</p>
</li>
<li><p>You deploy it on Kubernetes (which requires at least 1–2 VMs + setup).</p>
</li>
<li><p>You hire a DevOps engineer to manage it.</p>
</li>
<li><p>You pay for cloud compute + storage + monitoring.</p>
</li>
</ul>
<p>You could end up spending $300–$800/month or more... for something that could’ve been hosted on a simple service like <a target="_blank" href="https://render.com">Render</a>, <a target="_blank" href="https://www.heroku.com">Heroku</a>, or a basic VM for a fraction of the cost.</p>
<p>So when <strong>should</strong> you consider Kubernetes?</p>
<ul>
<li><p>When your platform is made up of multiple services (For example, separate services for user auth, payments, analytics, notifications, and so on)</p>
</li>
<li><p>When you’re expecting traffic spikes (for example, launching in new countries, going viral, seasonal demand like black Friday)</p>
</li>
<li><p>When you want flexibility in managing your infrastructure across cloud providers (AWS, GCP, Azure) or even on-premises</p>
</li>
</ul>
<h2 id="heading-use-cases-when-and-when-not-to-use-kubernetes">🧭 Use Cases: When (and When Not) to Use Kubernetes</h2>
<p>Kubernetes is an incredibly powerful tool – but it’s not always the right solution from day one.</p>
<p>Let’s break down when it makes sense to use Kubernetes and when it might be overkill 👇</p>
<h3 id="heading-when-you-should-use-kubernetes">✅ When You Should Use Kubernetes</h3>
<p>Kubernetes becomes essential in these scenarios:</p>
<h4 id="heading-1-your-application-is-made-of-many-microservices">1. Your Application Is Made of Many Microservices</h4>
<p>If your app is broken down into multiple microservices – like user authentication, payments, orders, notifications, and more – it’s a good sign that Kubernetes might eventually help.</p>
<p>Kubernetes can:</p>
<ul>
<li><p>Help manage each microservice independently</p>
</li>
<li><p>Automatically scale each one based on demand</p>
</li>
<li><p>Restart failed services automatically</p>
</li>
<li><p>Make it easier to roll out updates to specific parts of the application</p>
</li>
</ul>
<h4 id="heading-2-youre-getting-steady-and-high-traffic">2. You’re Getting <em>Steady and High</em> Traffic</h4>
<p>It’s not just about complexity – it’s about demand.</p>
<p>If your app receives a consistent, high volume of users (like hundreds or thousands every day), and you start seeing signs that your servers are getting overloaded, Kubernetes shines here. It can:</p>
<ul>
<li><p>Automatically increase resources when traffic surges</p>
</li>
<li><p>Balance the load across multiple servers</p>
</li>
<li><p>Prevent downtime due to traffic spikes</p>
</li>
</ul>
<h4 id="heading-3-you-want-portability-and-cloud-independence">3. You Want Portability and Cloud Independence</h4>
<p>If your business doesn’t want to be locked into just one cloud provider (for example, only AWS), Kubernetes gives you flexibility. You can move your application between AWS, GCP, Azure – or even to your own data center – with fewer changes.</p>
<h4 id="heading-4-your-devops-team-is-growing">4. Your DevOps Team Is Growing</h4>
<p>When you have multiple developers or teams working on different parts of the app, Kubernetes helps:</p>
<ul>
<li><p>Organize and isolate workloads per team</p>
</li>
<li><p>Improve collaboration and consistency</p>
</li>
<li><p>Provide easy access control and monitoring</p>
</li>
</ul>
<h3 id="heading-when-you-should-not-use-kubernetes">❌ When You Should Not Use Kubernetes</h3>
<p>Let’s be honest: Kubernetes is not for everyone, especially not at the beginning.</p>
<h4 id="heading-1-you-just-launched-your-app">1. You Just Launched Your App</h4>
<p>In the early days of your product, when you’ve just launched and traffic is still low, Kubernetes is <em>overkill</em>. You don’t need its complexity (yet).</p>
<p>👉 Instead, deploy your app or each microservice on a simple virtual machine (VM). It’s cheaper and faster to get started.</p>
<h4 id="heading-2-you-dont-need-auto-scaling-yet">2. You Don’t Need Auto-scaling (Yet)</h4>
<p>If traffic to your app is still small and manageable, a single server (or a few of them) can easily handle the load. In that case, it’s better to:</p>
<ul>
<li><p>Deploy your microservices manually or with Docker Compose</p>
</li>
<li><p>Monitor and scale manually when needed</p>
</li>
<li><p>Keep things simple until the need for automation becomes obvious</p>
</li>
</ul>
<h4 id="heading-3-you-dont-have-a-devops-team">3. You Don’t Have a DevOps Team</h4>
<p>Kubernetes is powerful – but it needs expertise to set up and maintain. If you don’t have a DevOps engineer or someone who understands Kubernetes, it may cause more problems than it solves.</p>
<p>Hiring a DevOps team can be expensive, and setting up Kubernetes incorrectly can lead to outages, security risks, or wasted resources 💸</p>
<h3 id="heading-when-to-move-to-kubernetes">📈 When to Move to Kubernetes</h3>
<p>So, what’s the best path forward?</p>
<p>Here’s a simple roadmap:</p>
<ol>
<li><p><strong>Start small</strong>: Deploy your app (or microservices) on one or a few VMs</p>
</li>
<li><p><strong>Watch traffic</strong>: As user demand grows, increase VM size or replicate the app manually</p>
</li>
<li><p><strong>Track pain points</strong>: If scaling becomes too manual, or if services crash under load...</p>
</li>
<li><p><strong>Then adopt Kubernetes</strong> 🧠</p>
</li>
</ol>
<p>It’s not about how complex your app is – it’s about when the traffic and growth demand an upgrade in how you manage things.</p>
<h3 id="heading-tldr-for-founders-and-devops-teams">🎯 TL;DR for Founders and DevOps Teams</h3>
<ul>
<li><p>Don’t jump to Kubernetes just because it’s trendy</p>
</li>
<li><p>Use it only when traffic grows steadily and auto-scaling becomes necessary</p>
</li>
<li><p>Kubernetes is most valuable when you want to scale reliably and efficiently</p>
</li>
<li><p>Before that point, stick to simple deployments – it’ll save you time, money, and stress</p>
</li>
</ul>
<h2 id="heading-conclusion">🎉 Conclusion</h2>
<p>Wow! What a journey we’ve been on 😄</p>
<p>We started by answering the big question — <strong>What is Kubernetes?</strong> We discovered that it’s not some mythical beast, but a powerful orchestration tool that helps us manage, deploy, scale, and maintain containerized applications in a smarter way.</p>
<p>Then, we took a step back in time to see how applications were deployed before Kubernetes — the headaches of manually installing software on servers, spinning up separate cloud instances for every microservice, and racking up huge cloud bills just to stay afloat. We also saw how containers simplified things, but even they had their own limitations when managed at scale.</p>
<p>That’s where Kubernetes came to the rescue</p>
<p>We explored:</p>
<ul>
<li><p><strong>The problems Kubernetes solves</strong> – like auto-scaling, efficient resource management, cost savings, and seamless container grouping.</p>
</li>
<li><p><strong>Kubernetes architecture and components</strong> – breaking down complex terms like the cluster, master node, worker nodes, Pods, Services, Kubelet, and more, into simple, easy-to-digest ideas.</p>
</li>
<li><p><strong>Kubernetes workloads</strong> like Deployments, Pods, Services, DaemonSets, and StatefulSets, and what they do behind the scenes to keep our apps running reliably.</p>
</li>
</ul>
<p>From theory to practice, we even got our hands dirty:</p>
<ul>
<li><p>We created a free Kubernetes cluster using Play with Kubernetes 🧪</p>
</li>
<li><p>Deployed a real application using both imperative (direct command) and declarative (manifest file) approaches</p>
</li>
<li><p>Understood why the declarative method makes our infrastructure easier to manage, especially when our systems grow.</p>
</li>
</ul>
<p>Then we took a business lens 🔍 and looked at:</p>
<ul>
<li><p>The advantages of Kubernetes – from auto-scaling during traffic surges, to cost efficiency, and cloud-agnostic deployment.</p>
</li>
<li><p>And also the disadvantages – like needing experienced DevOps engineers and not being ideal for every stage of a product's lifecycle.</p>
</li>
</ul>
<p>Finally, we wrapped up with real-life use cases, highlighting when Kubernetes is a must-have, and when it’s better to wait – especially for early-stage startups still trying to find their audience.</p>
<p>So, whether you're a DevOps newbie, a startup founder, or just someone curious about how modern tech keeps your favorite apps online – you now have a strong foundational understanding of Kubernetes 🙌</p>
<p>Kubernetes is powerful, but it doesn't have to be overwhelming. With a solid grasp of the basics (which you now have 💪), you're well on your way to managing scalable applications like a pro.</p>
<p>Start simple. Grow smart. And when the time is right – Kubernetes will be your best friend.</p>
<h2 id="heading-study-further"><strong>Study Further 📚</strong></h2>
<p>If you would like to learn more about Kubernetes, you can check out the courses below:</p>
<ul>
<li><p><a target="_blank" href="https://www.udemy.com/course/docker-kubernetes-the-practical-guide/">Docker &amp; Kubernetes: The Practical Guide (Academind - Udemy)</a></p>
</li>
<li><p><a target="_blank" href="https://www.coursera.org/specializations/certified-kubernetes-application-developer-ckad-course">Certified Kubernetes Application Developer (CKAD) Specialization (Coursera)</a></p>
</li>
</ul>
<h2 id="heading-about-the-author"><strong>About the Author 👨‍💻</strong></h2>
<p>Hi, I’m Prince! I’m a DevOps engineer and Cloud architect passionate about building, deploying, and managing scalable applications and sharing knowledge with the tech community<a target="_blank" href="https://www.udemy.com/course/github-actions-the-complete-guide/?couponCode=CMCPSALE24">.</a></p>
<p>If you enjoyed this article, you can learn more about me by exploring more of my blogs and projects on my <a target="_blank" href="https://www.linkedin.com/in/prince-onukwili-a82143233/">LinkedIn profile.</a> You can find my <a target="_blank" href="https://www.linkedin.com/in/prince-onukwili-a82143233/details/publications/">LinkedIn articles here</a>. You can also <a target="_blank" href="https://prince-onuk.vercel.app/achievements#articles">visit my website</a> to read more of my articles as well. Let’s connect and grow together! 😊</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Deploy a Restful Web Service on Microsoft Azure App Service ]]>
                </title>
                <description>
                    <![CDATA[ Hey there! 👋, How’s it going? I hope you're doing well. Whether you're a seasoned coder, a curious learner, or just someone browsing through, welcome to my little corner of the internet. In this tutorial, we’ll dive into how you can deploy a web ser... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/deploy-a-restful-web-service-on-microsoft-azure-app-service/</link>
                <guid isPermaLink="false">67e6c180423cd4f90a6350b5</guid>
                
                    <category>
                        <![CDATA[ Azure ]]>
                    </category>
                
                    <category>
                        <![CDATA[ azure-devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud Computing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ REST API ]]>
                    </category>
                
                    <category>
                        <![CDATA[ deployment ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Azure App Service ]]>
                    </category>
                
                    <category>
                        <![CDATA[ azure-app-services ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Alaran Ayobami ]]>
                </dc:creator>
                <pubDate>Fri, 28 Mar 2025 15:34:24 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1743176028047/61eba7a3-5505-4152-9df5-59a1cb8c61ac.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Hey there! 👋, How’s it going?</p>
<p>I hope you're doing well. Whether you're a seasoned coder, a curious learner, or just someone browsing through, welcome to my little corner of the internet.</p>
<p>In this tutorial, we’ll dive into how you can deploy a web service on Microsoft Azure app service. It’s a topic I’ve been excited to explore, and I hope you’ll find it insightful and helpful. So grab a coffee, sit back, and let’s get started.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<ul>
<li><p>Basic understanding of RESTful web services</p>
</li>
<li><p>Programming knowledge</p>
</li>
<li><p>Docker basics</p>
</li>
<li><p>Docker Hub account</p>
</li>
<li><p>Command Line Interface (CLI) skills</p>
</li>
</ul>
<h3 id="heading-what-well-cover">What we’ll cover:</h3>
<ul>
<li><p><a class="post-section-overview" href="#heading-key-terminologies">Key Terminologies</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-install-docker-and-docker-compose">How to Install Docker and Docker Compose</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-create-a-simple-get-client-info-web-service">How to Create a Simple Get Client Info Web Service</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-build-the-apps-docker-image">How to Build the App’s Docker Image</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-run-the-app-in-the-container">How to Run the App in the Container</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-create-an-azure-resource-group-on-azure-portal">How to Create an Azure Resource Group on Azure Portal.</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-deploy-to-azure-app-service">How to Deploy to Azure App Service</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<p>Before we actually get started, I’d like to go over some key terminologies that I'll be using throughout this tutorial. Understanding these terms will make it easier to follow along and get the most out of what we're discussing. Let’s dive in!</p>
<h2 id="heading-key-terminologies">Key Terminologies</h2>
<h3 id="heading-1-docker"><strong>1. Docker</strong></h3>
<p>Docker is an open-source platform that simplifies application development, shipping, and deployment by using containers. With Docker, there are three key things you can do:</p>
<ul>
<li><p>build once and run anywhere</p>
</li>
<li><p>keep environment consistent, and</p>
</li>
<li><p>easily scale your application with container orchestration tools like Kubernetes.</p>
</li>
</ul>
<h3 id="heading-2-docker-hub"><strong>2. Docker Hub</strong></h3>
<p>Docker Hub is a cloud-based repository where developers can store, share, and manage Docker images. You can think of it as the GitHub for Docker images 😉.</p>
<h3 id="heading-3-docker-image"><strong>3. Docker Image</strong></h3>
<p>A Docker image is a lightweight<strong>,</strong> standalone, and executable package that includes everything needed to run a piece of software. You can also think of it as a blueprint for creating and running a container.</p>
<p>Once built, an image is immutable, meaning it cannot change after creation. Instead, you create a new version when updates are needed. This means that you’ll need to rebuild if you update the code that’s being run in the container.</p>
<h3 id="heading-4-container"><strong>4. Container</strong></h3>
<p>A container is a running instance of a Docker image. It provides an isolated environment where an application runs with all its dependencies, without interfering with the host system or other containers.</p>
<p>Wait, what?! <strong>😕</strong> Well, simply put, a container is like a tiny virtual machine that runs the built Docker image. But unlike traditional VMs, it has no init process (PID 1), meaning it always runs on a host system rather than being fully independent. By now, you should be getting the idea: no image, no container. A container depends on an image to exist. You have to cook before you serve, right? 🍽️</p>
<h3 id="heading-5-azure-resource-group"><strong>5. Azure Resource Group</strong></h3>
<p>An Azure resource group refers to a store or folder containing all related resources for an application you want to deploy to production using MS Azure Cloud. For example, if I want to deploy an eCommerce web app with MS Azure, I could create a resource group called EcommWebAppRG. I’d use this to create all the resources I needed for the web app to go live and be accessible – like VMs, DBs, caches, and other services.</p>
<p>Alrighty, now that all the terms are out of the way, lets get started with the tutorial so you can learn how to deploy a web service on Azure App Service.</p>
<p>Since we are deploying an app, let’s start by creating simple REST API app. I’ll be using Golang for the API development, but you can use any programming language/framework of your choice. If you’d like to follow along with the app for this tutorial, I’ve provided the source code <a target="_blank" href="https://github.com/Ayobami6/client_info_webservice">here</a>.</p>
<h2 id="heading-how-to-install-docker-and-docker-compose">How to Install Docker and Docker Compose</h2>
<p>To install Docker and Docker compose on your PC, for Mac and Windows you’ll need to download Docker desktop for your Operating System <a target="_blank" href="https://hub.docker.com/welcome">here</a>.</p>
<p>For Linux, you can run the following command:</p>
<pre><code class="lang-bash">sudo apt update <span class="hljs-comment"># update apt registry</span>
sudo apt install docker.io <span class="hljs-comment"># for docker engine</span>
sudo apt install docker-compose-plugin
</code></pre>
<p>After downloading the Docker desktop for your application, open your terminal and enter the following command to verify that Docker and Docker Compose have been successfully installed on your machine:</p>
<pre><code class="lang-bash">docker-compose -v <span class="hljs-comment"># this should show the version of docker compose cli you have on your PC</span>
</code></pre>
<p>My Docker Compose version is:</p>
<pre><code class="lang-bash">Docker Compose version v2.31.0-desktop.2
</code></pre>
<pre><code class="lang-bash">docker -v
</code></pre>
<p>You should see something similar if Docker has successfully been installed on your machine:</p>
<pre><code class="lang-bash">Docker version 27.4.0, build bde2b89
</code></pre>
<h2 id="heading-how-to-create-a-simple-get-client-info-web-service">How to Create a Simple Get Client Info Web Service</h2>
<p>Alright, I’ll use this handy tool called <code>sparky_generate</code> to generate the app code template. <code>sparky_generate</code> is a command line tool used to generate boilerplate code for backend development using various backend languages and frameworks.</p>
<p>Use this command to install and setup the tool on your Mac or Linux machine. If you are on Windows, you can use WSL.</p>
<pre><code class="lang-bash">wget https://raw.githubusercontent.com/Ayobami6/sparky_generate/refs/heads/main/install.sh
</code></pre>
<pre><code class="lang-bash">chmod 711 install.sh
./install.sh <span class="hljs-comment"># run the install command like so</span>
</code></pre>
<pre><code class="lang-bash">sparky <span class="hljs-comment"># run the sparky command like so</span>
</code></pre>
<p>You should see something similar to the below. Select whatever framework you want to use for your backend service.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741520002226/b696a376-527b-412a-a8c7-967aca35217a.png" alt="Choose a project type in sparky" class="image--center mx-auto" width="1458" height="1408" loading="lazy"></p>
<p>I will select Go, because I’m using Go for this tutorial. You should have your project template ready once you’ve selected your framework. I won’t go through how to code the web service since it’s out of scope for this tutorial. The goal here is to deploy on Azure using Azure App Service.</p>
<h2 id="heading-how-to-build-the-apps-docker-image">How to Build the App’s Docker Image</h2>
<p>To build the Docker image for our app, we first need to create a Docker file that will include all the steps needed to build the image.</p>
<pre><code class="lang-bash">touch Dockerfile
</code></pre>
<p>We will be using a multistage Docker build to reduce the size of our Docker image. We need something as light as possible.</p>
<p>The multistage Docker build helps reduce size because we use different stages for different concerns. This helps ensure that only what’s needed runs the application in the final stage. For example, we might need certain artifacts to build the application, but we don’t need them to run the application. This is why we have the builder and runner stages in the Docker file below.</p>
<p>Our first stage (build) is concerned with building and bundling the application. The second stage (runner) is just used to run the executable we built in the first stage. So basically all files, modules, and so on used in the build process will be discarded in the runner since they’ve already served their purposes.</p>
<pre><code class="lang-dockerfile"><span class="hljs-comment"># using the first stage as build</span>
<span class="hljs-keyword">FROM</span> golang:<span class="hljs-number">1.23</span>-alpine AS build <span class="hljs-comment"># using alpine base image to reduce size</span>

<span class="hljs-comment"># install git on the machine</span>
<span class="hljs-keyword">RUN</span><span class="bash"> apk add --no-cache git</span>

<span class="hljs-comment"># setting the current work directory on the vm to be /app</span>
<span class="hljs-keyword">WORKDIR</span><span class="bash"> /app</span>

<span class="hljs-comment"># Copying all go dependency files to the working directory</span>
<span class="hljs-keyword">COPY</span><span class="bash"> go.mod go.sum ./</span>

<span class="hljs-comment"># Install go dependencies</span>
<span class="hljs-keyword">RUN</span><span class="bash"> go mod download</span>

<span class="hljs-comment"># copy all remaining files to the working directory</span>
<span class="hljs-keyword">COPY</span><span class="bash"> . .</span>
<span class="hljs-comment"># build the execuatable</span>

<span class="hljs-comment"># build the go program</span>
<span class="hljs-keyword">RUN</span><span class="bash"> go build -o api cmd/main.go</span>

<span class="hljs-comment"># stage 2 AKA the runner</span>
<span class="hljs-keyword">FROM</span> alpine:<span class="hljs-number">3.18</span>

<span class="hljs-keyword">RUN</span><span class="bash">  apk add --no-cache ca-certificates</span>

<span class="hljs-comment"># copy the go executable to the working directory</span>
<span class="hljs-keyword">COPY</span><span class="bash"> --from=build /app/api .</span>

<span class="hljs-comment"># expose the service running port</span>
<span class="hljs-keyword">EXPOSE</span> <span class="hljs-number">6080</span>
</code></pre>
<p>This Dockerfile outlines all the steps for building a Docker image for our app. Lets go through all these steps line by line. Because we are using a multistage build here, our stages are <code>build</code> and <code>runner</code>.</p>
<ul>
<li><p>The first stage build starts from the first <code>FROM golang:1.23-alpine AS build</code>. It initializes a stage with all the steps in the stage. It states that the base image to be used for all the steps in this stage should use a pre-existing golang:1.23 image using an Alpine Linux distro to run all the steps in the stage.</p>
</li>
<li><p>Next, we have <code>RUN</code>, which is used to run the command <code>apk add git</code>, followed by setting the working directory to the /app folder.</p>
</li>
<li><p>Then we have the <code>COPY</code> command that copies all the Go dependencies that will run the Go program.</p>
</li>
<li><p>Following that is <code>RUN go mod download</code> which is used to install all the dependencies.</p>
</li>
<li><p>We then have the command <code>COPY . .</code> to copy all the files to the working directory /app of the image</p>
</li>
<li><p>Then the last step in the build stage, <code>RUN go build -o api cmd/main.go</code>, builds the app code main.go to an executable API. The second stage “runner“ uses an <code>alpine:3.18</code> base image, and also uses the <code>RUN</code> directive to add ca-certificates to the Alpine base image. The <code>COPY</code> is used here to copy just the built executable file from the builder image to the runner image.</p>
</li>
<li><p>We then expose port 6080 so our built container can accept an HTTP connection from port 6080.</p>
</li>
</ul>
<p>Now, let’s write our <code>docker-compose.yml</code> file to define and run our containerized service::</p>
<pre><code class="lang-yaml"><span class="hljs-attr">services:</span>

  <span class="hljs-attr">client_info_app:</span>
    <span class="hljs-attr">build:</span> 
      <span class="hljs-attr">context:</span> <span class="hljs-string">.</span>
      <span class="hljs-attr">dockerfile:</span> <span class="hljs-string">Dockerfile</span>
    <span class="hljs-attr">container_name:</span> <span class="hljs-string">info_app</span>

    <span class="hljs-attr">ports:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-string">"6080:6080"</span>

    <span class="hljs-attr">command:</span> <span class="hljs-string">"./api"</span>
</code></pre>
<h3 id="heading-understanding-the-yaml-structure">Understanding the YAML Structure</h3>
<p>YAML follows a key-value structure similar to a dictionary or hashmap. In our file, the top-level key is <code>services</code>, which acts as the parent key. Within <code>services</code>, we define individual service configurations.</p>
<p>In this case, we have a single service named <code>client_info_app</code>, which contains the necessary properties for Docker to build and run it.</p>
<ul>
<li><p><code>build</code>: This specifies how to build the Docker image for the service. The <code>context: .</code> tells Docker to look for the <code>Dockerfile</code> in the same directory as the <code>docker-compose.yml</code> file.</p>
</li>
<li><p><code>container_name</code>: This assigns a custom name (<code>info_app</code>) to the running container, making it easier to reference.</p>
</li>
<li><p><code>ports</code>: Defines the port mappings between the host and the container. The <code>-</code> before <code>"6080:6080"</code> indicates that multiple mappings could be listed. Here, port <code>6080</code> on the host is mapped to port <code>6080</code> inside the container.</p>
</li>
<li><p><code>command</code>: Specifies the command to execute inside the container once it starts. In this case, it runs <code>./api</code>.</p>
</li>
</ul>
<p>This structure allows us to define and configure multiple services within the <code>services</code> key if needed, but for now, we are only defining <code>client_info_app</code>.</p>
<h2 id="heading-how-to-run-the-app-in-the-container">How to Run the App in the Container</h2>
<p>You can use this command to start the container:</p>
<pre><code class="lang-bash">docker-compose up client_info_app
</code></pre>
<p>The above command will first build the image if it doesn’t exist. Then it runs it, because remember: <strong>no image, no container.</strong></p>
<p>If all looks good, you should have something similar to this, depending on your application framework:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741708248802/0c0e25a0-fa8c-4eea-adaa-5f4986b5fda6.png" alt="Go running webserver" class="image--center mx-auto" width="2424" height="658" loading="lazy"></p>
<p>You should also verify that your Docker image has been built as well. To do that, run the following:</p>
<pre><code class="lang-bash">docker images
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741708480967/dbb033eb-d336-4f22-934b-8d50333b6344.png" alt="Verify that Docker is successfully built" class="image--center mx-auto" width="2386" height="122" loading="lazy"></p>
<p>Voilà! You now have your Docker image built and ready for deployment on Azure App Service.</p>
<p>Let’s go on to the Azure Portal to deploy the app.</p>
<p><strong>Note:</strong> if you don’t have an active Azure Subscription, that’s fine – you can still follow along. If you want to get a trial account, you can <a target="_blank" href="https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account">get one here</a>.</p>
<h2 id="heading-how-to-create-an-azure-resource-group-on-azure-portal">How to Create an Azure Resource Group on Azure Portal.</h2>
<p>As a reminder, an Azure resource group refers to a store or folder containing all related resources for an application you want to deploy to production using MS Azure Cloud. Now let’s go about creating one.</p>
<p>When you login to the Azure portal, you should see some like this, the dashboard:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741709173044/1ab78dd4-97ac-43da-8599-d7b1d790eb13.png" alt="Azure dashboard" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p>Search for Resource group using the search bar:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741709263175/7946270b-11c6-4fef-9abc-996b1efc6f52.png" alt="Search for resource group" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741709619363/5cfce825-0af6-4d64-ae4e-e929ba03d919.png" alt="Resource group control pane" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p>Click on Create to create a new resource group:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741709715096/e519fe55-0ac3-4e9f-8b98-3f34cecfcd43.png" alt="Create a resource group" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p>Give your resource group a name and select a region for it. Here I will use the default East US 2, but you can use any you want. Then click on Review + create.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741770354937/253c33d2-d7b2-44b5-84df-9cb4977aec3b.png" alt="Review resource group creation" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741770386424/0a97c949-5c31-466b-be7f-a43f0783e125.png" alt="Resource group overview" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p>You should see something like the above after creating the resource group.</p>
<h2 id="heading-how-to-deploy-to-azure-app-service">How to Deploy to Azure App Service</h2>
<p>Ok now that we’ve created the resource group, let’s go ahead and create the Azure App Service. To do this, navigate back to the dashboard and click on Create a resource.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741772709338/2c353749-7e0a-42b0-894e-25b1f08cad15.png" alt="Azure dashboard" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741773327784/536358ff-241b-4ea1-876d-575abf12a27b.png" alt="Azure resources view" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p>You can search for Web App if you don’t see it in the list there. Then click on the Create Web App option:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741855971071/8c120d54-1df1-41f3-85b2-c03d9fd709f1.png" alt="Create a web app" class="image--center mx-auto" width="2398" height="1464" loading="lazy"></p>
<p>Here, select the resource group you created earlier, give the app a name, then select Container for the Publish option.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741882867790/bed19e70-726d-4696-b88f-754e36511f0a.png" alt="Web app creation configuration" class="image--center mx-auto" width="2384" height="1476" loading="lazy"></p>
<p>Before you click on Create, go back to your dev workspace (VS Code or whatever IDE you are using) to push your Docker image to Docker Hub so you can add it there before proceeding to the next steps.</p>
<p>But why do you need to push to Docker Hub? Well, first of all, for accessibility – so we can easily share it with others or have other services access it (which is what we need here).</p>
<p>Remember how I compared Docker Hub with Github earlier? Docker Hub helps you host your Docker image on the internet and make it available for others or for various services on the internet to access if you make it public. Otherwise it’s limited to only authorized services.</p>
<p>To push the Docker image to Docker Hub, you first need to tag the Docker image with your Docker Hub username. Go to Docker <a target="_blank" href="https://hub.docker.com/">Docker Hub</a> to register and get your username if you don’t have one.</p>
<p>Run the following:</p>
<pre><code class="lang-bash">docker tag client_info_webservice-client_info_app:latest ayobami6/client_info_webservice-client_info_app:latest
<span class="hljs-comment"># this adds the latest tag to your docker image</span>
</code></pre>
<p>This shows that you successfully tagged your image with the latest tag.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741941521765/f624e0d1-2380-41cc-8bbf-f05e55d0b0ad.png" alt="Tagged Docker images" class="image--center mx-auto" width="2340" height="78" loading="lazy"></p>
<p>Before you actually push the image to Docker Hub, go ahead and login to it with the Docker CLI.</p>
<pre><code class="lang-bash">docker login <span class="hljs-comment"># this will prompt for browser authetication, for the prompt and login your account with your usernam and password</span>
</code></pre>
<p>Push the image to Docker Hub like this:</p>
<pre><code class="lang-bash">docker push ayobami6/client_info_webservice-client_info_app:latest
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741941723747/5947d1eb-82fe-4bf3-a0d7-e20bbc9d7de4.png" alt="Push Docker image to Docker Hub" class="image--center mx-auto" width="2358" height="130" loading="lazy"></p>
<p>You should see something like the below once you enter the push command on Docker Hub.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741941947561/7050ed8b-b7bf-4e07-91a6-765549b5d715.png" alt="Verify Docker image on Docker Hub" class="image--center mx-auto" width="2146" height="544" loading="lazy"></p>
<p>Alright, now that you have the Docker image on Docker Hub, you can go ahead and deploy it using Microsoft Azure App Service.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741944017329/32080357-e214-4864-b5cb-0fc8ad77a71f.png" alt="Create web container selection for publish" class="image--right mx-auto mr-0" width="2448" height="1722" loading="lazy"></p>
<p>Click on the container on the top menu bar to configure the container settings.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741944418747/6f9092e9-e6fc-4098-86d0-ba79eda37a58.png" alt="Container section of Azure web app" class="image--center mx-auto" width="2428" height="1284" loading="lazy"></p>
<p>Here, select Other container registries.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741944507676/d4c3d17e-e3fa-4c43-99b5-b768fd900309.png" alt="Other registry selection for Azure web app" class="image--center mx-auto" width="2418" height="1634" loading="lazy"></p>
<p>Select public, because your pushed image is public (meaning it’s publicly accessible over the internet).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743071959687/48cc5a78-4b72-4c8f-9ffb-d32c065e1a63.jpeg" alt="Docker image access type selection" class="image--center mx-auto" width="1080" height="729" loading="lazy"></p>
<p>Add your Docker image and tag. You can get this when you run the command <code>docker images</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743072606918/d17f7a31-bee3-41b9-a685-d7de0c0f6b39.jpeg" alt="Image and tag selection" class="image--center mx-auto" width="1080" height="729" loading="lazy"></p>
<pre><code class="lang-bash">λ MACs-MacBook-Pro ~ → docker images
REPOSITORY                                        TAG         IMAGE ID       CREATED         SIZE
ayobami6/client_info_webservice-client_info_app   latest      a14f2a5b3bd4   2 weeks ago     30.8MB
postgres                                          13-alpine   236985828131   4 weeks ago     383MB
glint_pm_frontend-nextjs                          latest      424233ceaa4b   4 weeks ago     1.72GB
flask_app-flask_app                               latest      ff6ecfc4ba5a   5 weeks ago     203MB
nginx                                             latest      124b44bfc9cc   7 weeks ago     279MB
encoredotdev/postgres                             15          58b55b0e1fc7   10 months ago   878MB
λ MACs-MacBook-Pro ~ →
</code></pre>
<p>Copy the repository name and tag – in my case I have <code>ayobami6/client_info_webservice-client_info_app</code> and tag <code>latest</code> → <code>ayobami6/client_info_webservice-client_info_app:latest</code>.</p>
<p>Then add your startup command. If you are not using Go for the development like I am, your startup command will be different – so just use the command you added to your Docker compose command key, like so <code>command: "./api"</code>. Copy just the value (mine is .<code>/api</code>) don’t add the double quotes, and add it to the startup command.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1743072910308/a208c0a1-718b-4725-99b5-47bf33691fca.jpeg" alt="Add startup command to the web app container configuration" class="image--center mx-auto" width="1080" height="729" loading="lazy"></p>
<p>This start up command is the command that will start the application from the container and get the container running.</p>
<p>Click on review and create to create the service.</p>
<p>Once the deployment is complete you’ll be redirected here:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741944994364/31e051a6-2da1-46fa-a748-c2bdd20528be.png" alt="Web app overview" class="image--center mx-auto" width="2880" height="1634" loading="lazy"></p>
<p>Congratulations! You’ve successfully deployed your web service to Azure App Service. You can visit your app using the default domain from the overview. Mine is <a target="_blank" href="http://clientinfoapp-hdgcdmgjdyd5ecfy.canadacentral-01.azurewebsites.net">here</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741945313388/19c73507-0b48-49ef-9885-515784cb0f9b.png" alt="Deployed service test on Postman" class="image--center mx-auto" width="1686" height="1376" loading="lazy"></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741945461019/30a668c7-0552-4905-bbb0-c9db0b587387.png" alt="Deployed service test on web browser" class="image--center mx-auto" width="1674" height="1514" loading="lazy"></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Deploying a RESTful web service on Microsoft Azure App Service is a powerful way to leverage cloud technology for scalable and efficient application hosting.</p>
<p>Understanding key terms like Docker, Docker Hub, and Azure Resource Groups will help you streamline the deployment process.</p>
<p>This guide walked you through creating a simple web service, building a Docker image, and deploying it on Azure. By following these steps, you can confidently deploy your applications, ensuring they are accessible and performant.</p>
<p>Thank you for following along, and I hope this tutorial has been insightful and helpful in your cloud deployment journey. If you found it useful, feel free to share it with others who might benefit from it. Happy coding and deploying!</p>
<p>Stay tuned for more insightful content, and let's continue learning and growing together. Cheers to building smarter, more efficient solutions with Azure.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is SRE? A Beginner's Guide to Site Reliability Engineering ]]>
                </title>
                <description>
                    <![CDATA[ In today’s digital age, we expect our online experiences to be fast, reliable, and always available. But what happens behind the scenes to make our expectations a reality? The answer is Site Reliability Engineering (SRE). SRE is a discipline that ens... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-site-reliability-engineering/</link>
                <guid isPermaLink="false">67e4265f7281ac30028843e1</guid>
                
                    <category>
                        <![CDATA[ SRE ]]>
                    </category>
                
                    <category>
                        <![CDATA[ SRE devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Site Reliability Engineering ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Technical Support ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Omolade Ekpeni ]]>
                </dc:creator>
                <pubDate>Wed, 26 Mar 2025 16:07:59 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1743005263079/95dfe528-a274-4172-8a06-46187c1668eb.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>In today’s digital age, we expect our online experiences to be fast, reliable, and always available. But what happens behind the scenes to make our expectations a reality?</p>
<p>The answer is Site Reliability Engineering (SRE). SRE is a discipline that ensures that your favorite online services keep running smoothly, even when things go wrong.</p>
<p>In this guide, you’ll learn about the core principles behind SRE, how automation can help you in this process, how to handle failure, and more.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-sre-is-more-than-just-fixing-problems">SRE: More Than Just Fixing Problems</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-bridging-the-gap-between-development-and-operations">Bridging the Gap Between Development and Operations</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-the-core-principles-of-sre">The Core Principles of SRE</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-focus-on-availability-and-reliability">Focus on Availability and Reliability</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-embrace-automation">Embrace Automation</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-measure-everything">Measure Everything</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-work-with-developers">Work with Developers</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-learn-from-failure">Learn from Failure</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-the-sre-role-a-balancing-act">The SRE Role: A Balancing Act</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-why-automation-matters">Why Automation Matters</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-key-takeaways-for-anyone-involved-in-digital-services">Key Takeaways for Anyone Involved in Digital Services</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-wrapping-up">Wrapping Up</a></p>
</li>
</ul>
<h2 id="heading-sre-more-than-just-fixing-problems">SRE: More Than Just Fixing Problems</h2>
<p>SRE goes beyond reacting to outages. It is a proactive approach to building and maintaining reliable systems. You can think of it as a blend of traditional IT operations, software engineering, and a relentless drive or pursuit for automation.</p>
<p>You might have heard of SRE being discussed alongside DevOps, so let’s differentiate them. DevOps is a broader set of principles that aims to improve collaboration and automation across the entire software development lifecycle. Site Reliability Engineering (SRE), on the other hand, is a specific implementation of these DevOps principles, with a strong focus on the operational aspects of running large-scale, highly reliable systems.  </p>
<p>Let’s imagine a software company that wants to embrace DevOps. They might start the process by fostering better communication and shared goals between their development teams (who write the code) and their operations teams (who run the code in production). Also, they might implement continuous integration and continuous delivery (CI/CD) pipelines to automate the process of building, testing, and deploying software. This aligns with DevOps' focus on faster release cycles and improved collaboration.</p>
<p>Within this DevOps-oriented company, the SRE team might be specifically tasked with ensuring the reliability of their e-commerce platform. They would take the general DevOps principles and apply them to the operational challenges being experienced with a software engineering view.</p>
<p>For example, they would:</p>
<ul>
<li><p>define and measure Service Level Objectives (SLOs)</p>
</li>
<li><p>develop and implement automated monitoring and alerting systems</p>
</li>
<li><p>create self-healing infrastructure and automated incident response playbooks</p>
</li>
<li><p>collaborate with development teams early in the software development lifecycle to ensure reliability</p>
</li>
<li><p>conduct blameless post-incident reviews to learn from failures</p>
</li>
<li><p>and track and automate away 'toil'.</p>
</li>
</ul>
<h3 id="heading-bridging-the-gap-between-development-and-operations">Bridging the Gap Between Development and Operations</h3>
<p>So as you can see, SRE is closely related to DevOps. One of the ways SRE implements DevOps principles is by bridging the gap between development and operations. SREs can do this in several ways.</p>
<p>First, SREs share responsibility with development teams for the reliability and performance of applications in production. This helps foster a collaborative environment and ensures that operational concerns are considered throughout the software development lifecycle.</p>
<p>SREs also provide valuable feedback to development teams based on their operational experience. They understand how software is designed and how it actually runs in production. This unique perspective allows them to identify potential issues early on and suggest improvements to the code, architecture, or deployment process.</p>
<p>And finally, SREs and development teams work together towards common goals, such as improving system reliability, increasing deployment frequency, and reducing time to recovery. This alignment ensures that everyone is working towards the same objectives.</p>
<h2 id="heading-the-core-principles-of-sre">The Core Principles of SRE:</h2>
<h3 id="heading-focus-on-availability-and-reliability"><strong>Focus on Availability and Reliability</strong></h3>
<p>SREs aim to achieve specific service level objectives (SLOs), which are measurable targets for uptime and performance.  </p>
<p><strong>Scenario</strong>: A popular e-commerce website, used heavily during Nigerian business hours, sets an SLO of 99.9% uptime for its product catalog service. This high standard means the service is expected to be available almost all the time.  </p>
<p>To understand just how little downtime this allows, let's break it down:</p>
<ol>
<li><p><strong>Downtime Percentage</strong>: An uptime of 99.9% means the allowed downtime is 100% - 99.9% = 0.1%.</p>
<ul>
<li><p><strong>Minutes in a day</strong>: There are 24 hours in a day, and each hour has 60 minutes, so there are 24 x 60 = 1440 minutes in a day.</p>
</li>
<li><p><strong>Minutes in an average month*</strong>:* Assuming an average month of 30 days, there are approximately 30 x 1440 = 43,200 minutes in a month.</p>
</li>
<li><p><strong>Allowed downtime in minutes</strong>: To find 0.1% of the minutes in a month, we calculate (0.1 / 100) x 43,200 minutes = 0.001 x 43,200 minutes = 43.2 minutes.</p>
</li>
</ul>
</li>
</ol>
<p>Therefore, a 99.9% uptime SLO for the product catalog service means it can be unavailable for a maximum of about 43 minutes per month. The SRE team constantly monitors the service's availability using tools that track request success rates and latency. If the availability drops below 99.95% (a leading indicator), the SRE team is alerted to investigate and remediate before the SLO is breached.  </p>
<p><strong>Example</strong>: An online banking platform in Nigeria has an SLO for transaction processing latency: 99% of transactions must be completed within 500 milliseconds. SRE dashboards track this metric in real time. If the latency starts to increase, indicating a potential performance issue, SREs investigate whether it's due to database bottlenecks, network congestion within Nigeria, or application code inefficiencies.</p>
<h3 id="heading-embrace-automation"><strong>Embrace Automation</strong></h3>
<p>Automation is the heart of SRE. It reduces manual labor, improves consistency, and speeds up issue resolution.  </p>
<p><strong>Scenario</strong>: When a new server is provisioned for an application, an SRE has automated the entire process using infrastructure-as-code tools (like Terraform or Ansible). This includes configuring the operating system, installing necessary software, setting up monitoring agents, and deploying the application code.</p>
<p>Previously, this involved multiple manual steps taking hours and was prone to human error. Now, it's completed consistently in minutes.  </p>
<p><strong>Example</strong>: During peak traffic hours (for example, around lunchtime in Nigeria when many people are online), the load on a web server cluster increases. An SRE has implemented auto-scaling rules that automatically add more servers to the cluster when CPU utilization exceeds a certain threshold and remove them when the load decreases. This automated scaling ensures the service remains responsive without manual intervention.</p>
<h3 id="heading-measure-everything"><strong>Measure Everything</strong></h3>
<p>SREs rely on data and metrics to understand system behavior and identify various areas for improvement.  </p>
<p><strong>Scenario</strong>: For a ride-hailing app popular in Lagos, SREs track a wide range of metrics beyond just uptime. These metrics are often referred to as Service Level Indicators (SLIs), which are quantitative measures of a service's performance.</p>
<p>Examples include:</p>
<ol>
<li><p><strong>Request latency</strong>: How long it takes for a user to request a ride and get a confirmation.</p>
</li>
<li><p><strong>Error rates:</strong> The percentage of ride requests or payment transactions that fail.</p>
</li>
<li><p><strong>Resource utilization:</strong> CPU, memory, and disk usage of the servers.</p>
</li>
<li><p><strong>Database query performance:</strong> The time it takes for database operations.</p>
</li>
<li><p><strong>User engagement metrics:</strong> How often key features are used.</p>
</li>
</ol>
<p>These SLIs are crucial for determining if the service is meeting its Service Level Objectives (SLOs) – the target values or ranges for these indicators (for example, 99% of ride requests should have a latency under 200ms). The metrics are visualized on dashboards, allowing SREs to understand the system's health and identify correlations between different indicators, ultimately helping them determine if the SLOs are being met or are at risk.  </p>
<p><strong>Example</strong>: After deploying a new version of their mobile app, SREs closely monitor key performance indicators (KPIs) like the number of active users in Lagos, the average time to complete a booking, and the frequency of crashes reported by users in Nigeria. This data helps them quickly identify if the new release has introduced any performance or stability regressions.</p>
<h3 id="heading-work-with-developers"><strong>Work with Developers</strong></h3>
<p>SREs collaborate closely with development teams to ensure that applications are designed for reliability.  </p>
<p><strong>Scenario</strong>: When developers are designing a new feature for their Nigerian user base that involves significant data processing, SREs are involved early in the design phase.</p>
<p>They provide guidance on how to build the feature in a reliable and scalable way, suggesting patterns like circuit breakers, retries, and proper error handling.</p>
<p>This proactive collaboration helps prevent reliability issues from being baked into the application. SREs can also participate in design reviews, providing operational insights and raising concerns about potential failure points.  </p>
<p><strong>Example</strong>: Before a major marketing campaign is launched in Nigeria, which is expected to significantly increase traffic, SREs work with the development team to perform load testing on the application. This helps identify potential bottlenecks and areas for optimization before the actual surge in users occurs.</p>
<p>SREs provide insights into the system's capacity and suggest code changes or infrastructure adjustments to handle the anticipated load. SREs can analyze the load test results with developers, providing insights into the system's capacity and suggesting code changes, database optimizations, or infrastructure adjustments to handle the expected load. They can also jointly develop monitoring and alerting rules specific to the campaign's expected traffic.</p>
<h3 id="heading-learn-from-failure"><strong>Learn from Failure</strong></h3>
<p>Failure is inevitable. SREs use post-incident reviews to analyze failures, identify root causes, and implement preventative measures.  </p>
<p><strong>Scenario:</strong> A critical outage occurred on a payment gateway used by many Nigerian businesses. After the service is restored, the SRE team conducts a blameless post-incident review. They gather all relevant data (logs, metrics, timelines, communication records) and collaboratively analyze the sequence of events, the underlying causes (which might involve a combination of software bugs, configuration errors, and insufficient monitoring), and the impact on users.</p>
<p>The outcome of the review is a detailed document outlining the root causes and a list of actionable items with owners and deadlines to prevent similar incidents in the future (for example, improving monitoring for a specific metric, implementing a new rollback strategy, fixing a configuration management issue).  </p>
<p><strong>Example:</strong> A minor incident occurred where a specific API endpoint became slow for a short period during peak hours in Lagos. Even though the impact was minimal, the SRE team still conducts a lightweight post-incident review.</p>
<p>They analyze the logs and metrics to understand why the slowdown happened (perhaps a temporary spike in database load) and identify potential preventative measures, such as optimizing the database query or adjusting resource limits.</p>
<p>The actionable item might be to create a new dashboard specifically for this API endpoint's performance, with a target completion date and assigned to a specific SRE (owner). Afterward, the team will follow up and ensure the dashboard is serving its purpose.</p>
<p>SREs acknowledge that systems will fail, and the goal is not to prevent all failures but to minimize their impact. SREs can achieve this through:</p>
<ol>
<li><p><strong>Monitoring</strong>: SREs implement real-time tracking of system health and performance, which allows them to detect issues early on.</p>
</li>
<li><p><strong>Logging</strong>: They use detailed records of system events for analysis, investigation, debugging, and troubleshooting, which is essential for understanding the root cause of failures.</p>
</li>
<li><p><strong>Alerting</strong>: SREs set up automated notifications when system metrics deviate from expected thresholds, enabling them to respond quickly to potential problems.</p>
</li>
<li><p>I<strong>ncident response</strong>: They establish structured and documented procedures for responding to and resolving incidents, ensuring a coordinated and efficient approach.</p>
</li>
<li><p><strong>Post-incident reviews</strong>: SREs conduct in-depth analysis of incidents to identify root causes and prevent recurrence, treating every incident as a learning opportunity. This is a crucial aspect of continuous improvement.</p>
</li>
</ol>
<h2 id="heading-the-sre-role-a-balancing-act">The SRE Role: A Balancing Act</h2>
<p>SREs face the challenge of balancing day-to-day operational needs with longer-term engineering initiatives. This "balancing act" is crucial for maintaining a system's stability and its ability to evolve and improve.</p>
<p>SREs typically spend their time in two key areas, each requiring a different skillset and focus:</p>
<h3 id="heading-operational-responsibilities-50"><strong>Operational Responsibilities (50%):</strong></h3>
<p>An SRE’s operational responsibilities are pretty wide-ranging. They typically involve responding to incidents and outages, which is a core part of any operations role. SREs are often on-call, meaning they are available to address urgent issues outside of regular work hours.</p>
<p>They also handle escalations, which means taking over complex or critical issues that other teams can't resolve.</p>
<p>SREs also provide support to internal and external customers, which can involve troubleshooting problems, answering questions, and providing guidance.</p>
<p>These responsibilities require strong problem-solving skills, quick thinking, and the ability to remain calm under pressure.</p>
<h3 id="heading-engineering-responsibilities-50"><strong>Engineering Responsibilities (50%):</strong></h3>
<p>Engineering responsibilities are what truly distinguish SREs. SREs are responsible for automating manual tasks, which is crucial for increasing efficiency and reducing errors.</p>
<p>They also develop monitoring and alerting systems, which involve designing and implementing tools to track system health and notify teams of potential problems.</p>
<p>SREs contribute to improving system reliability and performance by identifying and addressing bottlenecks, optimizing code, and implementing best practices.</p>
<p>They contribute to software development with a focus on operational concerns, which means they work with developers to ensure that applications are designed for scalability, maintainability, and resilience.</p>
<p>These responsibilities require strong programming skills, a deep understanding of system architecture, and a proactive approach to problem-solving.</p>
<h2 id="heading-why-automation-matters">Why Automation Matters</h2>
<p>Automation is an important tool that SREs use to achieve both their operational and engineering goals. It's not about replacing human engineers, but about empowering them to work more effectively.</p>
<p>There are several key areas where automation is really important:</p>
<ol>
<li><p><strong>Reducing toil</strong>: SREs use automation to eliminate repetitive, manual tasks, often referred to as "toil." This frees up their time to focus on more strategic work, such as improving system design and implementing new features.</p>
</li>
<li><p><strong>Improving efficiency</strong>: Automation can significantly speed up processes like deployments, rollbacks, and incident response, which leads to faster recovery times and reduced downtime.</p>
</li>
<li><p><strong>Enhancing reliability</strong>: By automating critical processes, SREs can reduce the risk of human error, which is a common cause of outages and other issues.</p>
</li>
<li><p><strong>Gaining deeper understanding</strong>: Every time an SRE automates a process, they gain a deeper understanding of the system, leading to further improvements or enhancements. This iterative process of automation and learning is central to the SRE approach.</p>
</li>
</ol>
<h2 id="heading-key-takeaways-for-anyone-involved-in-digital-services">Key Takeaways for Anyone Involved in Digital Services:</h2>
<ol>
<li><p><strong>Reliability is a feature:</strong> Treat reliability as a major requirement, not an option.</p>
</li>
<li><p><strong>Automation is essential:</strong> Embrace automation to reduce toil and improve efficiency.</p>
</li>
<li><p><strong>Make data-driven decisions:</strong> Use metrics to understand system behavior and in turn guide improvements.</p>
</li>
<li><p><strong>Collaboration is key:</strong> Foster close collaboration between development and operations teams.</p>
</li>
<li><p><strong>Focus on continuous improvement:</strong> Adopt a culture of continuous learning and improvement.</p>
</li>
</ol>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>You've now gained a foundational understanding of Site Reliability Engineering and its core principles centered around availability, automation, measurement, collaboration, and learning from failure. You’ve also learned how it plays a crucial role in ensuring the smooth operation of the digital services we rely on every day.</p>
<p>If you found this tutorial helpful and want to stay connected for more insights on Site Reliability Engineering, you can follow me on <a target="_blank" href="https://x.com/OmoladeEkpeni">Twitter</a>, connect on <a target="_blank" href="https://www.linkedin.com/in/omolade-ekpeni-b7b431188/">LinkedIn</a>, or reach out via email at omolade.ekp@gmail.com.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Connect Your AWS EC2 Instance to VS Code ]]>
                </title>
                <description>
                    <![CDATA[ As a DevOps engineer, it is crucial to master at least one cloud provider. Cloud services simplify storage, data migration, and CI/CD workflows and help make these tasks easier and more efficient. If you need a basic introduction to cloud computing, ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-connect-your-aws-ec2-instance-to-vs-code/</link>
                <guid isPermaLink="false">67e2ec52cd467794ee79d63e</guid>
                
                    <category>
                        <![CDATA[ ec2 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ssh ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ server ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Ijeoma Igboagu ]]>
                </dc:creator>
                <pubDate>Tue, 25 Mar 2025 17:48:02 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1742397603245/c1ca0496-dbab-4570-8b6b-cb4bac5f72c1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>As a DevOps engineer, it is crucial to master at least one cloud provider. Cloud services simplify storage, data migration, and CI/CD workflows and help make these tasks easier and more efficient.</p>
<p>If you need a basic introduction to cloud computing, here’s a beginner-friendly tutorial for you: <a target="_blank" href="https://www.freecodecamp.org/news/cloud-computing-guide-for-beginners/"><strong>What is Cloud Computing? A Guide for Beginners.</strong></a></p>
<p>In this guide, I’ll show you how to create an AWS EC2 instance. This is one of AWS’s top services for building applications. By the end of this guide, you'll know how to launch an AWS EC2 instance and connect it to VS Code.</p>
<h2 id="heading-table-of-contents"><strong>Table of Contents</strong></h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-prerequisites">Prerequisites</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-what-is-an-aws-ec2-instance">What is an AWS EC2 Instance?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-why-connect-your-aws-ec2-instance-to-vs-code">Why Connect Your AWS EC2 Instance to VS Code?</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-launch-and-connect-your-aws-ec2-instance-to-vs-code">How to Launch and Connect Your AWS EC2 Instance to VS Code</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-step-1-create-an-aws-ec2-instance">Step 1: Create an AWS EC2 Instance</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-2-connect-the-aws-ec2-instance-to-your-code-editor">Step 2: Connect the AWS EC2 Instance to Your Code Editor</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-3-install-the-programming-language">Step 3: Install the Programming Language</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-open-a-remote-window">Step 4: Open a Remote Window</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-5-access-your-project-folder">Step 5: Access Your Project Folder</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before you start, make sure you have:</p>
<ul>
<li><p>An AWS account. If you do not have one, <a target="_blank" href="https://aws.amazon.com/free/?gclid=Cj0KCQiAvvO7BhC-ARIsAGFyToVguvjmSCa99VkB7XsHepginSELSYCCYnVzZXeZSKFpRRTC8DKyh98aAkZkEALw_wcB&amp;trk=2d3e6bee-b4a1-42e0-8600-6f2bb4fcb10c&amp;sc_channel=ps&amp;ef_id=Cj0KCQiAvvO7BhC-ARIsAGFyToVguvjmSCa99VkB7XsHepginSELSYCCYnVzZXeZSKFpRRTC8DKyh98aAkZkEALw_wcB:G:s&amp;s_kwcid=AL!4422!3!645125273261!e!!g!!aws!19574556887!145779846712&amp;all-free-tier.sort-by=item.additionalFields.SortRank&amp;all-free-tier.sort-order=asc&amp;awsf.Free%20Tier%20Types=*all&amp;awsf.Free%20Tier%20Categories=*all">sign up here</a>.</p>
</li>
<li><p>A GitHub repository with your source code. If you don’t have a GitHub account, <a target="_blank" href="https://github.com/">sign up here</a>.</p>
</li>
<li><p>Basic knowledge of web development and version control.</p>
</li>
<li><p>A code editor. For this tutorial, I’m using VS Code.</p>
</li>
</ul>
<p>Let’s jump right in!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1735997217784/fdb3b399-7a07-4cf2-8577-10859bf5542d.gif" alt="fdb3b399-7a07-4cf2-8577-10859bf5542d" class="image--center mx-auto" width="220" height="220" loading="lazy"></p>
<h2 id="heading-what-is-an-aws-ec2-instance">What is an AWS EC2 Instance?</h2>
<p>AWS EC2 (Elastic Compute Cloud) allows you to run virtual machines in the cloud. These computers allow you to run your applications without needing physical hardware.</p>
<p>There are a number of things you can you do with AWS EC2, such as hosting websites or apps, running big data or machine-learning tasks, creating testing environments, and handling tasks that need flexible, scalable computing power.</p>
<h2 id="heading-why-connect-your-aws-ec2-instance-to-vs-code">Why Connect Your AWS EC2 Instance to VS Code?</h2>
<p>Connecting your AWS EC2 instance to VS Code is helpful for several reasons. Before we start the setup process, it’s important to learn why it’s beneficial.</p>
<ol>
<li><p>Using VS Code provides a familiar and efficient development space. It feels like coding on your own machine.</p>
</li>
<li><p>You don’t have to log into your AWS EC2 instance each time. You can edit files, run commands, and debug code from a distance.</p>
</li>
<li><p>You can streamline your workflow with built-in terminal access and extensions. This way, you won't have to switch between SSH clients all the time.</p>
</li>
<li><p>You can push changes to GitHub. This makes working together and deploying much smoother.</p>
</li>
<li><p>VS Code works well with Java, Node.js, and Python. It supports many languages and frameworks, so it's great for cloud development.</p>
</li>
</ol>
<p>Now that you understand the benefits, let’s move on to setting up the connection.</p>
<h2 id="heading-how-to-launch-and-connect-your-aws-ec2-instance-to-vs-code"><strong>How to Launch and Connect Your AWS EC2 Instance to VS Code</strong></h2>
<p>To launch an EC2 instance on AWS, just follow these steps:</p>
<h3 id="heading-step-1-create-an-aws-ec2-instance"><strong>Step 1: Create an AWS EC2 Instance</strong></h3>
<p>First, log into your AWS account. Then, use the search bar to find EC2 and select it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736016609765/f784db8e-46cc-4e03-abc0-7bdea9b1c668.png" alt="Searching for EC2 on AWS Console" class="image--center mx-auto" width="1920" height="970" loading="lazy"></p>
<p>Click EC2 and follow the on-screen instructions to create a new instance.</p>
<ol>
<li><p><strong>Choose an AMI (Amazon Machine Image):</strong> This is a pre-configured template that includes an operating system and may come with additional software.</p>
</li>
<li><p><strong>Select an instance type:</strong> Pick the right size for your needs. For example, <code>t2.micro</code> is a good option for beginners and small workloads.</p>
</li>
<li><p><strong>Configure Your EC2 Instance:</strong> Set up networking, storage, security groups, and other options based on your requirements.</p>
</li>
<li><p><strong>Launch Your Instance:</strong> Start your virtual server and access it remotely to begin using it.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736174305817/e8d9d8dd-f09d-4bca-a838-42ee55607fa5.gif" alt="creating an EC2 instance" class="image--center mx-auto" width="1920" height="971" loading="lazy"></p>
<p>Launched instance running:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736174700999/b729de98-bd8f-496f-9486-3079d87fb4de.png" alt="Launched Instance" class="image--center mx-auto" width="1553" height="209" loading="lazy"></p>
<p>So what’s happening in Step 1?</p>
<p>By launching an AWS EC2 instance, you are setting up a remote server in the cloud. AWS offers different AMIs that serve as pre-configured environments.</p>
<h3 id="heading-step-2-connect-the-aws-ec2-instance-to-your-code-editor">Step 2: <strong>Connect the AWS EC2 Instance to Your Code Editor</strong></h3>
<p>To connect your EC2 instance created in AWS to your VS Code, you need SSH.</p>
<h4 id="heading-what-is-ssh">What is SSH?</h4>
<p>SSH (Secure Shell) is a secure way to connect and communicate with other devices. It keeps your connection safe. This is important when you access servers or repositories. In Git, you can use SSH instead of HTTPS to clone repositories with a secure connection.</p>
<h4 id="heading-why-is-ssh-important-here">Why is SSH important here?</h4>
<p>With SSH, you can link your local code editor (like VS Code) to your AWS EC2 instance. This allows you to work on files stored on the EC2 instance directly from your editor as if on your local computer.</p>
<p><strong>To connect your AWS EC2 instance to your local editor using SSH, follow these steps:</strong></p>
<ul>
<li><p>Open your terminal.</p>
</li>
<li><p>Go to the folder where your <code>.pem</code> key file is. The key file (.pem) downloads automatically when you create your EC2 instance (usually in the Downloads folder).</p>
</li>
<li><p>Update the file permissions to keep your key secure and ensure proper authentication.</p>
</li>
</ul>
<p>For Linux users, use this command to update the file permissions:</p>
<pre><code class="lang-bash">chmod 400 codebuild-keypair.pem
</code></pre>
<p>For Windows users, first you’ll need to find the username of your laptop, as you’ll need it to update the file permissions.</p>
<p>To do this, open your terminal and type:</p>
<pre><code class="lang-powershell">whoami
</code></pre>
<p>This will display your current username.</p>
<p>Once you have your username, use the following command to update the file permissions:</p>
<pre><code class="lang-powershell">icacls <span class="hljs-string">"codebuild-keypair.pem"</span> /reset
icacls <span class="hljs-string">"codbuild-keypair.pem"</span> /grant:<span class="hljs-built_in">r</span> <span class="hljs-string">"%USERNAME%:R"</span>
icacls <span class="hljs-string">"codebuld-keypair.pem"</span> /inheritance:<span class="hljs-built_in">r</span>
</code></pre>
<p>Here's what I mean: My username is <strong>ijeon</strong>, so you should replace it with <strong>your laptop's username</strong> and <strong>own</strong> key, which ends with <code>.pem</code> extension.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736021541861/048a9411-2348-48dc-8a6e-04d51dbd347d.png" alt="pasting the command on the terminal" class="image--center mx-auto" width="1096" height="102" loading="lazy"></p>
<p>Running this command above updates the file permissions. So with this, you can work with your remote server.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736021649692/118c75cf-30b4-474c-b726-142c2b4326e9.png" alt="the output of the command pasted" width="722" height="153" loading="lazy"></p>
<p>Now that you have set the correct file permissions, you can use the SSH command along with the IPv4 address to connect to our EC2 instance. Type the following command:</p>
<pre><code class="lang-powershell">ssh <span class="hljs-literal">-i</span> [<span class="hljs-type">PATH</span> <span class="hljs-type">TO</span> <span class="hljs-type">YOUR</span> <span class="hljs-type">.PEM</span> <span class="hljs-type">FILE</span>] ec2<span class="hljs-literal">-user</span><span class="hljs-selector-tag">@</span>[<span class="hljs-type">YOUR</span> <span class="hljs-type">PUBLIC</span> <span class="hljs-type">IPV4</span> <span class="hljs-type">DNS</span>]
</code></pre>
<p>Example:</p>
<pre><code class="lang-powershell">ssh <span class="hljs-literal">-i</span> <span class="hljs-string">"C:\Users\ijeon\OneDrive\Desktop\devops-series-nextwork\codebuild-keypair.pem"</span> ec2<span class="hljs-literal">-user</span>@ec2<span class="hljs-literal">-35</span><span class="hljs-literal">-178</span><span class="hljs-literal">-142</span><span class="hljs-literal">-201</span>.eu<span class="hljs-literal">-west</span><span class="hljs-literal">-2</span>.compute.amazonaws.
</code></pre>
<p>Breaking it down:</p>
<ol>
<li><p><code>ssh</code>: This starts a secure remote connection.</p>
</li>
<li><p><code>-i "C:\Users\ijeon\...\codebuild-keypair.pem"</code>: This tells SSH to use the <code>.pem</code> key file for secure access.</p>
</li>
<li><p><a target="_blank" href="mailto:ec2-user@ec2-35-178-142-201.eu-west-2.compute.amazonaws.com"><code>ec2-user@ec2-35-178-142-201.eu-west-2.compute.amazonaws.com</code></a>:</p>
<ul>
<li><p><code>ec2-user</code> is the default username for EC2 instances.</p>
</li>
<li><p><code>@ec2-35-178-142-201...</code> is the public address of your EC2 instance.</p>
</li>
</ul>
</li>
</ol>
<p>This command logs you into your EC2 instance remotely from your computer. It then uses the key (<code>.pem</code> file) instead of a password for security. It also lets you control the EC2 instance from your terminal as if you were using it directly.</p>
<p>If everything is set up correctly, a “success message” will appear. This confirms that you've logged in and can access the remote server.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1742153348953/a68f32fc-7578-4904-9b2e-e63a353e84a0.gif" alt="connecting via ssh" class="image--center mx-auto" width="1920" height="1079" loading="lazy"></p>
<h3 id="heading-step-3-install-the-programming-language"><strong>Step 3: Install the Programming Language</strong></h3>
<p>Now that you’ve linked your instance to the editor, you can install the packages needed to build your web app. You can use any programming language you're comfortable with, but we’ll use Java for this tutorial. This will be a simple web application – we don’t need to go into advanced details.</p>
<h4 id="heading-1-install-java"><strong>1. Install Java</strong></h4>
<p>In your terminal, run the following commands to install <strong>Java</strong>:</p>
<pre><code class="lang-powershell">sudo dnf install <span class="hljs-literal">-y</span> java<span class="hljs-literal">-1</span>.<span class="hljs-number">8.0</span><span class="hljs-literal">-amazon</span><span class="hljs-literal">-corretto</span><span class="hljs-literal">-devel</span>

export JAVA_HOME=/usr/lib/jvm/java<span class="hljs-literal">-1</span>.<span class="hljs-number">8.0</span><span class="hljs-literal">-amazon</span><span class="hljs-literal">-corretto</span>.x86_64

export PATH=/usr/lib/jvm/java<span class="hljs-literal">-1</span>.<span class="hljs-number">8.0</span><span class="hljs-literal">-amazon</span><span class="hljs-literal">-corretto</span>.x86_64/jre/bin/:<span class="hljs-variable">$PATH</span>
</code></pre>
<p>This installs Java on your system. You also need Maven. It helps manage Java projects and create templates for web applications.</p>
<h4 id="heading-2-install-maven"><strong>2. Install Maven</strong></h4>
<p>Maven helps you organize Java projects. It also lets you create templates for web applications. Run these commands to install Maven:</p>
<pre><code class="lang-powershell"><span class="hljs-built_in">wget</span> https://archive.apache.org/dist/maven/maven<span class="hljs-literal">-3</span>/<span class="hljs-number">3.5</span>.<span class="hljs-number">2</span>/binaries/apache<span class="hljs-literal">-maven</span><span class="hljs-literal">-3</span>.<span class="hljs-number">5.2</span><span class="hljs-literal">-bin</span>.tar.gz

sudo tar <span class="hljs-literal">-xzf</span> apache<span class="hljs-literal">-maven</span><span class="hljs-literal">-3</span>.<span class="hljs-number">5.2</span><span class="hljs-literal">-bin</span>.tar.gz <span class="hljs-literal">-C</span> /opt

<span class="hljs-built_in">echo</span> <span class="hljs-string">"export PATH=/opt/apache-maven-3.5.2/bin:<span class="hljs-variable">$PATH</span>"</span> &gt;&gt; ~/.bashrc

source ~/.bashrc
</code></pre>
<p>To confirm Maven's correct installation, run this command:</p>
<pre><code class="lang-powershell">mvn <span class="hljs-literal">-v</span>
</code></pre>
<p>Also, run the following command to check whether you have Java installed:</p>
<pre><code class="lang-powershell">java <span class="hljs-literal">-version</span>
</code></pre>
<p>Now that you have installed Maven, you can use it to create a Java web app with the following command:</p>
<pre><code class="lang-powershell">mvn archetype:generate \
  <span class="hljs-literal">-DgroupId</span>=com.nextwork.app \
  <span class="hljs-literal">-DartifactId</span>=nextwork<span class="hljs-literal">-web</span><span class="hljs-literal">-project</span> \
  <span class="hljs-literal">-Dpackage</span>=com.nextwork.app \
  <span class="hljs-literal">-DarchetypeArtifactId</span>=maven<span class="hljs-literal">-archetype</span><span class="hljs-literal">-webapp</span> \
  <span class="hljs-literal">-DarchetypeVersion</span>=<span class="hljs-number">1.4</span> \
  <span class="hljs-literal">-DinteractiveMode</span>=false
</code></pre>
<p>Running the command above generates a template for your application. In the terminal, it should show a "Build Success" message. This means the setup worked.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1742122446716/7c51b3a2-6a8c-463d-817c-9630488a803d.png" alt="Installing the template" class="image--center mx-auto" width="1410" height="854" loading="lazy"></p>
<h3 id="heading-step-4-open-a-remote-window"><strong>Step 4:</strong> Open a Remote Window</h3>
<p>Now that you’ve installed the necessary packages and set up your app template, you need to open your IDE or code editor. This will let you access the folders on your remote server.</p>
<p>In your terminal, click the double arrow icon at the bottom left.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736073016500/cb3a4d44-3ae5-4ccb-9006-c592c0be30f7.png" alt="double arrow at the left" class="image--center mx-auto" width="155" height="119" loading="lazy"></p>
<p>When you click on it, it opens a modal window for you.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736073334686/a24d115c-9da3-4b46-80be-a75d73a189ab.gif" alt="connect to the host" class="image--center mx-auto" width="1920" height="1079" loading="lazy"></p>
<p>A window will appear. Click "Connect to Host," which will open another window.</p>
<p>Then choose "Add New SSH Host" to open the SSH connection terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736073802080/45dbc209-0b4c-41a2-83eb-3fa05a8eff20.gif" alt="adding ssh host" class="image--center mx-auto" width="1920" height="1079" loading="lazy"></p>
<p>Input your SSH command to configure the host.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736078262849/b09d017e-cbd3-476e-9641-63dc41e34d83.png" alt="image of SSH connection command" class="image--center mx-auto" width="928" height="146" loading="lazy"></p>
<p>After pressing "Enter," a configuration file will open. In this file, ensure that the <code>.pem</code> file and the <code>IP4v DNS</code> addresses from your EC2 instance are correct.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736083806867/e158ee79-67d3-41c8-bb63-870caab0033b.png" alt="place to press for the configuration file" class="image--center mx-auto" width="890" height="207" loading="lazy"></p>
<p>Here’s a GIF view of the image above:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736083586490/7520a325-376d-42a8-905d-2e22770498de.gif" alt="a gif view of how to open your configuration file" class="image--center mx-auto" width="1920" height="1079" loading="lazy"></p>
<p>Here’s the configuration file:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736084278100/6e71324f-6b47-4a2a-b7a1-89c1be10c39b.png" alt="config file" class="image--center mx-auto" width="1348" height="349" loading="lazy"></p>
<p>Go back to your editor and click on that double arrow again. This will automatically open a new window.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736086002267/53e4edd8-afe2-4652-90ab-56bc90f80405.gif" alt="Re-opening a new window" class="image--center mx-auto" width="1920" height="1079" loading="lazy"></p>
<p>If your editor displays the IPv4 DNS address, your VS Code is successfully connected to the EC2 instance.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736086479299/e399f86c-e236-4efc-8d4d-a7055139d01e.png" alt="connection to the remote server" width="683" height="209" loading="lazy"></p>
<p>Now that you’re connected and a new window has opened, let’s access the folder stored in the cloud.</p>
<h3 id="heading-step-5-access-your-project-folder">Step 5: Access Your Project Folder</h3>
<p>In step 3, remember when you installed Maven? It created a template for your web app. Now, you’ll access the folder where you created this.</p>
<ol>
<li><p>Go to the Explorer panel in the window.</p>
</li>
<li><p>Click the <strong>“</strong>Open Folder<strong>”</strong> button.</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736087503207/7fb21fcb-939e-4f17-83d2-93a6e0e3ee68.png" alt="access remote folder" class="image--center mx-auto" width="219" height="171" loading="lazy"></p>
<p>Clicking on this button opens a modal box for you to select your folder, which was created by the Maven template:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1742134089654/77104e69-4c7a-4b59-812d-423167079f24.gif" alt="accessing the folder" class="image--center mx-auto" width="1920" height="1079" loading="lazy"></p>
<p>To access the template file, click the “src” folder. This takes you to the <code>index.jsp</code> file.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1742135158716/4cfedc15-1c2e-4d60-b9f6-fe04c300dfa0.png" alt="template automatically created for you" width="1920" height="1080" loading="lazy"></p>
<p>With this template created, you can decide to tweak it and send it to your Git repository for storage.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Great job! You’ve set up an AWS EC2 instance, linked it to your code editor, and installed the tools needed for your web app. In this tutorial, we used Java, but you can also choose other languages like Node.js or Python.</p>
<p>If you found this article helpful, please share it with others who may find it interesting.</p>
<p>Stay updated with my projects by following me on <a target="_blank" href="https://twitter.com/ijaydimples">Twitter</a>, <a target="_blank" href="https://twitter.com/ijaydimples">LinkedIn</a> and <a target="_blank" href="https://github.com/ijayhub">GitHub</a>.</p>
<p>Thank you for reading.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Choose a Cloud Development Environment – Harness CDE, Gitpod, and Coder Compared ]]>
                </title>
                <description>
                    <![CDATA[ Cloud Development Environments (CDEs) have become essential tools in modern software development, offering enhanced productivity and streamlined workflows. This article compares three leading CDEs: Harness CDE, Gitpod, and Coder. My goal here is to o... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-choose-a-cloud-development-environment/</link>
                <guid isPermaLink="false">67a22fc0b7eb4acc424cb220</guid>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Gitpod ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Harness ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud Development  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Environment ]]>
                    </category>
                
                    <category>
                        <![CDATA[ coder ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Gursimar Singh ]]>
                </dc:creator>
                <pubDate>Tue, 04 Feb 2025 15:18:24 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738612280310/a3e39db8-66e9-45f5-9bc1-60cfa426a001.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Cloud Development Environments (CDEs) have become essential tools in modern software development, offering enhanced productivity and streamlined workflows.</p>
<p>This article compares three leading CDEs: Harness CDE, Gitpod, and Coder. My goal here is to offer an objective analysis to help you make informed decisions based on your specific needs.</p>
<h2 id="heading-what-is-a-cloud-development-environment-cde">What is a Cloud Development Environment (CDE)?</h2>
<p>A <strong>Cloud Development Environment (CDE)</strong> is a cloud-hosted workspace where developers can write, test, and deploy code without relying on local machines. Unlike traditional setups, CDEs provide pre-configured environments accessible via a browser or IDE, eliminating the "it works on my machine" problem.</p>
<p>How CDEs differ from traditional development environments</p>
<ul>
<li><p>CDEs are more consistent and help standardize tools, dependencies, and configurations across teams.</p>
</li>
<li><p>They’re also accessible from anywhere, enabling remote collaboration.</p>
</li>
<li><p>They’re more scalable, as resources (CPU, memory) scale dynamically based on workload.</p>
</li>
<li><p>And they’re secure, with centralized security controls and compliance adherence (for example, SOC 2, GDPR).</p>
</li>
</ul>
<h3 id="heading-common-cde-features"><strong>Common CDE Features</strong></h3>
<p>Most CDEs come with a variety of helpful features. They typically have pre-built environment templates (for example, Python, Node.js) and integrate easily with Git repositories and CI/CD pipelines. They also have various real-time collaboration tools, as well as the ability to automate backups and recovery.</p>
<p>You’ll learn more about specific features when we discuss each of our CDE options below.</p>
<h2 id="heading-the-case-for-cloud-based-development"><strong>The Case for Cloud-Based Development</strong></h2>
<p>CDEs can help you and your team solve some critical pain points:</p>
<h3 id="heading-cdes-make-setup-easier">CDEs make setup easier</h3>
<p>When using a CDE, you don’t have the hassle of setting up local machines. Instead, you have a pre-configured development environment that’s ready to go in minutes. With a traditional setup, you have to install dependencies, configure environments, and resolve compatibility issues – and this can take hours or even days. CDEs make this process much easier.</p>
<p>Let’s say a new developer joins your project that requires a complex stack – it needs a specific Python version, multiple frameworks, and environment variables. Instead of spending hours configuring their local machine, they can just launch a cloud-based workspace (like one of the tools we’ll discuss here), which comes pre-loaded with everything they need.</p>
<h3 id="heading-cdes-help-reduce-costs">CDEs help reduce costs</h3>
<p>CDEs can reduce your costs by making sure that development resources are allocated only when they’re needed. Unlike local machines, which require upfront investment in high-performance hardware, cloud environments help you scale resources dynamically and pay only for the compute power you and your team use.</p>
<p>Perhaps your team is developing a resource-intensive AI application. If you’re using a CDE, you’ll no longer need to provide every developer with an expensive workstation. Instead, you can just provision high-performance cloud instances when needed and shut them down when idle. This cuts down on unnecessary spending.</p>
<h3 id="heading-cdes-enhance-security">CDEs enhance security</h3>
<p>With cloud-based environments, code and sensitive data remain on secure, centralized servers rather than being stored on individual developer machines. This helps reduce the risk of data loss or theft. CDEs also provide audit logs, identity management, and automated backups, all of which help make things more security.</p>
<p>Let’s say a financial services company requires strict security controls over customer data. By using a CDE, the developers on the team can access code via secure connections without storing sensitive files locally. This helps ensure compliance with industry regulations like SOC 2 or GDPR.</p>
<h3 id="heading-cdes-enable-global-collaboration">CDEs enable global collaboration</h3>
<p>CDEs make collaboration among distributed teams much easier by allowing multiple developers to work in the same environment with shared configurations. Remote developers can contribute from anywhere without worrying about compatibility issues or inconsistent setups.</p>
<p>For example, perhaps your global development team is working on a SaaS product. They can use a CDE to collaborate in real time. A member of your dev team in India can start debugging an issue, and then a teammate in the US can pick up where they left off hours later without needing to set up the same environment locally.</p>
<h2 id="heading-methodology"><strong>Methodology</strong></h2>
<p>This analysis is based on official documentation, user reviews, and independent testing. All information is current as of the last update date. The article is focused on key aspects such as features, deployment options, security, pricing, and use cases.</p>
<h2 id="heading-overview-of-each-tool"><strong>Overview of Each Tool</strong></h2>
<h3 id="heading-harness-cde">Harness CDE</h3>
<p>Harness CDE is part of the broader Harness platform, designed to streamline software delivery with integrated CI/CD pipelines, feature flags, and cloud cost management. It provides enterprise-grade security, a user-friendly interface, and robust integration capabilities, making it ideal for large-scale applications.</p>
<p>With its comprehensive suite of tools and advanced cost management, Harness CDE helps enterprises efficiently manage their entire development lifecycle. Harness CDE's intuitive interface and detailed documentation further enhance its suitability for large-scale applications.</p>
<h4 id="heading-drawbacks"><strong>Drawbacks</strong></h4>
<p>Despite its many strengths, Harness CDE is relatively new to the market, meaning its features and capabilities are still evolving. Deep integration with the Harness platform could make switching challenging.</p>
<h3 id="heading-gitpod">Gitpod</h3>
<p>Gitpod is a SaaS solution that provides automated, ready-to-code development environments. It integrates seamlessly with popular version control systems like GitHub, GitLab, and Bitbucket, offering fast and consistent setups.</p>
<p>Gitpod is known for its user-friendly web interface and quick onboarding process, which significantly reduces setup times and lets devs focus on coding rather than environment configuration. This makes it ideal for agile development teams and startups.</p>
<h4 id="heading-drawbacks-1"><strong>Drawbacks</strong></h4>
<p>Gitpod's SaaS model offers limited control over infrastructure, which can be a disadvantage for teams needing more customization and control. Also, dedicated instances can be more costly, potentially offsetting some of the benefits of its free plan.</p>
<h3 id="heading-coder">Coder</h3>
<p>Coder is an open-source platform offering both free and self-managed (paid) options. It provides highly customizable, secure, and scalable development environments that you can host on your infrastructure. This makes it suitable for organizations needing tailored solutions.</p>
<p>Coder excels in environments where stringent security and compliance requirements are paramount, offering extensive control and customization.</p>
<h4 id="heading-drawbacks-2"><strong>Drawbacks</strong></h4>
<p>Coder requires more setup time and maintenance compared to Gitpod and Harness CDE. Its reliance on self-managed infrastructure can also increase complexity and cost, particularly for smaller teams or startups without dedicated DevOps resources.</p>
<h2 id="heading-detailed-feature-comparison">Detailed Feature Comparison</h2>
<p>Now let’s compare some basic features to see how these three tools stack up against each other.</p>
<h3 id="heading-deployment-and-scalability">Deployment and Scalability</h3>
<ul>
<li><p><strong>Harness CDE</strong>: Integrated with the Harness &amp; Gitness platforms, offering high scalability within the Harness ecosystem.</p>
</li>
<li><p><strong>Gitpod</strong>: SaaS model with easy scalability and options for managed dedicated instances.</p>
</li>
<li><p><strong>Coder</strong>: Self-managed deployment with full control over infrastructure, providing high scalability for tailored environments.</p>
</li>
</ul>
<h3 id="heading-integration-and-user-experience">Integration and User Experience</h3>
<ul>
<li><p><strong>Harness CDE</strong>: Comprehensive suite of development tools, intuitive interface, and detailed documentation.</p>
</li>
<li><p><strong>Gitpod</strong>: Seamless integration with GitHub, GitLab, and Bitbucket, featuring automated setups and excellent documentation.</p>
</li>
<li><p><strong>Coder</strong>: Integrates with existing infrastructure and various tech stacks, providing detailed documentation and customizable configurations.</p>
</li>
</ul>
<h3 id="heading-security-and-compliance">Security and Compliance</h3>
<ul>
<li><p><strong>Harness CDE</strong>: Enterprise-grade security features, including SOC 2 compliance, role-based access control, and advanced secrets management. Offers comprehensive audit logging and governance with policy-as-code support.</p>
</li>
<li><p><strong>Gitpod</strong>: Secure environments with data encryption, SOC 2 compliant.</p>
</li>
<li><p><strong>Coder</strong>: Focuses on security and compliance, supporting various standards like HIPAA and GDPR.</p>
</li>
</ul>
<h3 id="heading-costpricing">Cost/Pricing</h3>
<ul>
<li><p><strong>Harness CDE</strong>: Competitive pricing with integrated platform features. A lot of features are free to use. Pricing varies based on scale and needs – contact Harness for details.</p>
</li>
<li><p><strong>Gitpod</strong>: Varies with free and paid plans, limited customization based on SaaS offerings. The free plan includes 50 hours/month, while paid plans offer unlimited hours.</p>
</li>
<li><p><strong>Coder</strong>: Costs depend on self-managed infrastructure, offering high customization and control over environment setup. The tool is free for open-source use, and paid for self-managed deployments.</p>
</li>
</ul>
<h3 id="heading-setup-time-and-user-interface">Setup Time and User Interface</h3>
<ul>
<li><p><strong>Harness CDE</strong>: Fast setup with integrated CI/CD pipeline and modern, intuitive interface.</p>
</li>
<li><p><strong>Gitpod</strong>: Quick setup in minutes with a user-friendly, web-based interface.</p>
</li>
<li><p><strong>Coder</strong>: Setup time varies based on custom configurations, offering a flexible and customizable interface.</p>
</li>
</ul>
<h3 id="heading-availability">Availability</h3>
<ul>
<li><p><strong>Harness CDE</strong>: Part of the Harness platform, typically targeted at enterprise users.</p>
</li>
<li><p><strong>Gitpod</strong>: SaaS model with both free and paid plans.</p>
</li>
<li><p><strong>Coder</strong>: Open-source with both free and self-managed (paid) options.</p>
</li>
</ul>
<h3 id="heading-specs">Specs</h3>
<ul>
<li><p><strong>Harness CDE</strong>: Integrated CI/CD, feature flags, cloud cost management, enterprise-grade security, and so on.</p>
</li>
<li><p><strong>Gitpod</strong>: Automated setups, seamless integration with VCS, user-friendly interface.</p>
</li>
<li><p><strong>Coder</strong>: Highly customizable, secure, scalable, extensive control.</p>
</li>
</ul>
<h3 id="heading-additional-features"><strong>Additional Features</strong></h3>
<p>Here’s a detailed table that includes info on a bunch of other features that might help you make your decision as to which tool is best for you.</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Feature</td><td>Harness CDE</td><td>Gitpod</td><td>Coder</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Data Storage</strong></td><td>Integrated with Harness</td><td>External, cloud-based storage</td><td>On-premises, cloud options available</td></tr>
<tr>
<td><strong>Resource Management</strong></td><td>Automated scaling</td><td>Easy resource allocation</td><td>Customizable resource allocation</td></tr>
<tr>
<td><strong>Monitoring and Logging</strong></td><td>Integrated monitoring tools</td><td>External tools (e.g., Grafana)</td><td>Integrated and external options</td></tr>
<tr>
<td><strong>Performance</strong></td><td>High, optimized for enterprise use</td><td>High, optimized for cloud</td><td>High, depends on infrastructure</td></tr>
<tr>
<td><strong>Updates and Maintenance</strong></td><td>Automated updates</td><td>Regular updates, easy maintenance</td><td>Manual updates, customizable maintenance</td></tr>
<tr>
<td><strong>Community Support</strong></td><td>Growing community, active forums</td><td>Active community, strong documentation</td><td>Large community, extensive documentation</td></tr>
<tr>
<td><strong>Learning Curve</strong></td><td>Moderate, user-friendly</td><td>Low, easy to start</td><td>Moderate, flexible setup</td></tr>
<tr>
<td><strong>CI/CD Integration</strong></td><td>Built-in CI/CD pipelines</td><td>Supports CI/CD via third-party integrations</td><td>Requires custom setup for CI/CD</td></tr>
<tr>
<td><strong>Collaboration Features</strong></td><td>Integrated collaboration tools</td><td>Collaboration through VCS integrations</td><td>Customizable collaboration tools</td></tr>
<tr>
<td><strong>Container Support</strong></td><td>Native Docker support</td><td>Supports containerized environments</td><td>Full containerization support</td></tr>
<tr>
<td><strong>Cost Management</strong></td><td>Integrated cost management</td><td>No built-in cost management</td><td>Requires external tools for cost management</td></tr>
<tr>
<td><strong>Workflow Automation</strong></td><td>Extensive automation features</td><td>Basic automation through scripts</td><td>High customizability for automation</td></tr>
<tr>
<td><strong>Version Control Support</strong></td><td>Seamless VCS integration</td><td>Native support for Git-based VCS</td><td>Customizable VCS integration</td></tr>
<tr>
<td><strong>API Access</strong></td><td>Comprehensive API access</td><td>Robust API for integration</td><td>Full API support for custom integration</td></tr>
<tr>
<td><strong>Code Reviews</strong></td><td>Built-in code review tools</td><td>Code reviews through VCS integrations</td><td>Customizable code review processes</td></tr>
<tr>
<td><strong>Branch Management</strong></td><td>Advanced branch management</td><td>Supports branch management through VCS</td><td>Customizable branch management</td></tr>
<tr>
<td><strong>Testing Tools</strong></td><td>Integrated testing tools</td><td>Requires third-party testing tools</td><td>Full integration with various testing tools</td></tr>
<tr>
<td><strong>Data Backup and Recovery</strong></td><td>Automated backup and recovery</td><td>Limited backup options</td><td>Requires custom setup for backup and recovery</td></tr>
<tr>
<td><strong>Cloud Provider Compatibility</strong></td><td>Supports multiple cloud providers</td><td>Primarily cloud-agnostic</td><td>Fully compatible with various cloud providers</td></tr>
<tr>
<td><strong>Onboarding Time</strong></td><td>Fast, guided onboarding</td><td>Quick, automated onboarding</td><td>Varies, depending on custom configurations</td></tr>
<tr>
<td><strong>Multi-language Support</strong></td><td>Extensive support for multiple languages</td><td>Supports many languages</td><td>Full support for various programming languages</td></tr>
<tr>
<td><strong>User Authentication</strong></td><td>Integrated authentication options</td><td>Basic authentication options</td><td>Comprehensive, customizable authentication</td></tr>
<tr>
<td><strong>Secrets Management</strong></td><td>Built-in secrets management</td><td>Requires third-party tools</td><td>Full support for secrets management</td></tr>
<tr>
<td><strong>Pipeline Visualization</strong></td><td>Advanced, intuitive pipeline visualization</td><td>Basic pipeline visualization</td><td>Customizable pipeline visualization</td></tr>
<tr>
<td><strong>Environment Provisioning</strong></td><td>Automated, scalable environment provisioning</td><td>Fast, on-demand environment provisioning</td><td>Flexible environment provisioning</td></tr>
<tr>
<td><strong>License Model</strong></td><td>Open-source and commercial licenses</td><td>Open-source and commercial licenses</td><td>Open-source and commercial licenses</td></tr>
<tr>
<td><strong>Network Isolation</strong></td><td>Built-in network isolation features</td><td>Limited network isolation</td><td>Advanced network isolation options</td></tr>
<tr>
<td><strong>Role-based Access Control</strong></td><td>Comprehensive RBAC</td><td>Basic RBAC</td><td>Advanced RBAC</td></tr>
<tr>
<td><strong>Audit Logging</strong></td><td>Detailed audit logging</td><td>Basic audit logging</td><td>Extensive audit logging</td></tr>
<tr>
<td><strong>Governance with Policy as Code</strong></td><td>Supports OPA-based policies</td><td>Limited</td><td>Advanced governance features</td></tr>
<tr>
<td><strong>Feature Flags</strong></td><td>Integrated, robust feature flag management</td><td>Requires third-party tools</td><td>Full support for feature flag management</td></tr>
<tr>
<td><strong>Internal Developer Portal</strong></td><td>Comprehensive internal developer portal</td><td>Limited</td><td>Advanced portal capabilities</td></tr>
<tr>
<td><strong>Software Supply Chain Management</strong></td><td>Integrated, secure supply chain features</td><td>Limited</td><td>Requires custom setup</td></tr>
<tr>
<td><strong>Service Reliability Management</strong></td><td>Real-time insights and reliability</td><td>Limited</td><td>Requires third-party tools</td></tr>
<tr>
<td><strong>Chaos Engineering</strong></td><td>Built-in chaos engineering tools</td><td>Requires third-party tools</td><td>Full support for chaos engineering</td></tr>
<tr>
<td><strong>Self-Managed Options</strong></td><td>Available for enterprise</td><td>Not available</td><td>Available</td></tr>
<tr>
<td><strong>Code Repository Integration</strong></td><td>Seamless integration with Git-based repositories</td><td>Limited</td><td>Full support for various repositories</td></tr>
<tr>
<td><strong>APM Integration</strong></td><td>Comprehensive APM integration</td><td>Requires third-party tools</td><td>Full support for APM integration</td></tr>
<tr>
<td><strong>Artifact Management</strong></td><td>Integrated artifact management</td><td>Limited</td><td>Full support for artifact management</td></tr>
<tr>
<td><strong>Cloud Cost Management</strong></td><td>Advanced cloud cost management features</td><td>No built-in cost management</td><td>Requires third-party tools</td></tr>
<tr>
<td><strong>AI and ML Support</strong></td><td>Built-in tools for AI/ML workflows</td><td>Requires third-party tools</td><td>Extensive support for AI/ML</td></tr>
</tbody>
</table>
</div><h3 id="heading-how-to-choose-the-right-tool"><strong>How to Choose the Right Tool</strong></h3>
<p>As you can see, each of these cloud development environments has its strengths. It’s up to you to analyze them and decide which tool is right for you. Here’s a quick summary:</p>
<ul>
<li><p>Harness CDE offers the fastest startup times and a straightforward, performance-focused approach.</p>
</li>
<li><p>Gitpod provides the widest language support and a large community, with competitive pricing.</p>
</li>
<li><p>Coder excels in security, compliance, and customization.</p>
</li>
</ul>
<p>When choosing a CDE, consider the following factors:</p>
<ul>
<li><p>Team size and structure</p>
</li>
<li><p>Existing technology stack</p>
</li>
<li><p>Security and compliance requirements</p>
</li>
<li><p>Budget constraints</p>
</li>
<li><p>Customization needs</p>
</li>
<li><p>Scalability requirements</p>
</li>
<li><p>Integration with existing tools and workflows</p>
</li>
</ul>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>In this guide, you learned about three CDE tools and their main features. Which of these tools you choose will largely depend on your specific needs.</p>
<p>Ultimately, I recommend that you take advantage of any free trials or demos offered by these platforms to get hands-on experience before making a decision. Consider your team's specific workflows, the technologies you use, and your scalability needs when choosing a cloud development environment.</p>
<h3 id="heading-references"><strong>References</strong></h3>
<ul>
<li><p><a target="_blank" href="https://developer.harness.io/docs/">Harness Docs</a></p>
</li>
<li><p><a target="_blank" href="https://www.gitpod.io/docs/introduction">Gitpod Docs</a></p>
</li>
<li><p><a target="_blank" href="https://coder.com/docs">Coder Docs</a></p>
</li>
</ul>
<p>Note: This article is for informational purposes only. Everyone should conduct their own thorough evaluation based on their specific requirements before making a decision.</p>
<p>I hope you’ve enjoyed it and have learned something new. I’m always open to suggestions and discussions on <a target="_blank" href="https://www.linkedin.com/in/gursimarsm">LinkedIn</a>. Hit me up with direct messages.</p>
<p>If you’ve enjoyed my writing and want to keep me motivated, consider leaving starts on <a target="_blank" href="https://github.com/gursimarsm">GitHub</a> and endorsing me for relevant skills on <a target="_blank" href="https://www.linkedin.com/in/gursimarsm">LinkedIn</a>.</p>
<p>Till the next one, happy coding!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Build an Application with AWS Lambda ]]>
                </title>
                <description>
                    <![CDATA[ AWS Lambda is a service from Amazon Web Services (AWS) that lets you run your code in response to events without managing servers. It’s a simple and scalable way to build applications. In this tutorial, I’ll show you how to use AWS Lambda with three ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-build-an-application-with-aws-lambda/</link>
                <guid isPermaLink="false">6798f596558861e9737fa5af</guid>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud Computing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ aws lambda ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Ijeoma Igboagu ]]>
                </dc:creator>
                <pubDate>Tue, 28 Jan 2025 15:19:50 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1738077341437/939ee844-0f10-4ea6-b031-9c481019e7c6.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>AWS Lambda is a service from Amazon Web Services (AWS) that lets you run your code in response to events without managing servers. It’s a simple and scalable way to build applications.</p>
<p>In this tutorial, I’ll show you how to use AWS Lambda with three other services:</p>
<ul>
<li><p><strong>Amazon S3</strong> for storing files, images, and videos</p>
</li>
<li><p><strong>Amazon Simple Notification Service (SNS)</strong> for sending notifications</p>
</li>
<li><p><strong>Amazon EventBridge</strong> for scheduling messages</p>
</li>
</ul>
<p>We’ll go through everything step by step.</p>
<p>By the end, with the integration of the other services, you will have built a Goal Manifestation Quote App that sends random inspirational messages to keep you motivated and focused on your goals.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<ul>
<li><p>An AWS account: If you don’t have one, sign up <a target="_blank" href="https://aws.amazon.com/">here</a>.</p>
</li>
<li><p>A GitHub repository: This is for storing your source code. If you don’t have a GitHub account, you can create one <a target="_blank" href="https://github.com/">here</a>.</p>
</li>
<li><p>An Integrated Development Environment (IDE) such as <a target="_blank" href="https://code.visualstudio.com/">Visual Studio Code</a> or <a target="_blank" href="https://www.sublimetext.com/download">Sublime Text</a>.</p>
</li>
<li><p>A basic knowledge of web development and any programming language of your choice. I used Python for this tutorial.</p>
</li>
<li><p><a target="_blank" href="https://zenquotes.io/">Zenquote Random API</a></p>
</li>
</ul>
<h3 id="heading-what-youll-learn">What You'll Learn</h3>
<ul>
<li><p>How to create an Amazon S3 bucket</p>
</li>
<li><p>How to use Amazon Simple Notification Service (SNS)</p>
</li>
<li><p>How to use Amazon Lambda</p>
</li>
<li><p>How to use Amazon EventBridge</p>
</li>
</ul>
<h2 id="heading-table-of-contents"><strong>Table of Contents</strong></h2>
<ol>
<li><p><a class="post-section-overview" href="#heading-step-1-set-up-your-development-environment">Step 1: Set Up Your Development Environment</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-2-create-an-amazon-simple-storage-service-s3">Step 2: Create an Amazon Simple Storage Service (S3)</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-3-create-an-amazon-simple-simple-notification-service">Step 3: Create an Amazon Simple Notification Service (SNS)</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-4-create-an-iam-policy">Step 4: Create an IAM Policy</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-5-create-an-amazon-lambda-function">Step 5: Create an Amazon Lambda function</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-6-create-an-eventbridge">Step 6: Create an EventBridge</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-7-upload-your-code">Step 7. Upload Your Code</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736791948488/38dfe402-1050-410d-869b-0cef2797b792.png" alt="Let's get started 🚀" class="image--center mx-auto" width="600" height="401" loading="lazy"></p>
<h2 id="heading-step-1-set-up-your-development-environment">Step 1: Set Up Your Development Environment</h2>
<p>In this step, you'll get everything set up. Start by signing in to your AWS account, then install <a target="_blank" href="https://www.python.org/downloads/">Python</a> if you don't have it on your IDE.</p>
<h2 id="heading-step-2-create-an-amazon-simple-storage-service-s3"><strong>Step 2: Create an Amazon Simple Storage Service (S3)</strong></h2>
<p>Before we begin creating an S3 bucket, let's first understand what Amazon S3 is:</p>
<p><strong>Amazon S3 (Simple Storage Service)</strong> is a service from Amazon that allows you to store and access any amount or type of data, such as photos, videos, documents, and backups, whenever you need it.</p>
<p>Now that you know the basics of what Amazon S3 is, let's return to the tutorial.</p>
<h3 id="heading-create-an-s3-bucket">Create an S3 Bucket</h3>
<p>There are several ways to create an S3 bucket, but for this tutorial, we'll use the <a target="_blank" href="https://ubuntu.com/download">Ubuntu command line (CMD)</a>, your terminal, or <strong>Amazon CloudShell</strong>, depending on what you're most comfortable with.</p>
<ul>
<li><p>Type boto3 s3 in the web search bar to view a list of related documentation.</p>
</li>
<li><p>Click on the first result.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736792137101/5f38b4ec-fa23-41b3-b108-ca7fc7b390ba.png" alt="Regular Google search" class="image--right mx-auto mr-0" width="848" height="272" loading="lazy"></p>
<ul>
<li>Once the documentation is open, copy the first command you see.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736792202800/5647c731-734f-4134-a558-9d66eee47734.png" alt="boto3 command" width="947" height="376" loading="lazy"></p>
<ul>
<li>Paste it on your CMD OR terminal of your choice – but before then remember to "<strong>cd</strong>" into the right directory.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736792298332/d3384fc3-e31c-4d37-8e17-40ad7e77df28.png" alt="paste command from documentation to your editor" width="725" height="89" loading="lazy"></p>
<ul>
<li>In the documentation, scroll down and click on "create_bucket.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736792399748/0cd59a14-b037-464b-8193-7ec515c4772e.png" alt="0cd59a14-b037-464b-8193-7ec515c4772e" width="223" height="24" loading="lazy"></p>
<ul>
<li><p>Once it's open, scroll down to "Request Syntax." Copy the <strong>bucket name</strong> and the <strong>bucket configuration</strong>.</p>
</li>
<li><p>Other variables listed in the request syntax are optional.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736792898846/eea0f8c4-d153-4bc8-8c78-346fc5bf6a04.png" alt="Request syntax from the documentation" width="887" height="262" loading="lazy"></p>
<ul>
<li>Once this is done, make sure you save.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736793004865/a1c9739c-2d12-4e2d-b057-f09bc61e16a3.png" alt="All command" width="980" height="413" loading="lazy"></p>
<ul>
<li>Go back and call the script:</li>
</ul>
<pre><code class="lang-plaintext">#python3 your file name
</code></pre>
<ul>
<li>Running the script automatically creates an S3 bucket in your Amazon S3.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736793086405/9c0b4671-ea07-4ad7-b1d7-0d785aafa954.png" alt="Automatic creation" width="1904" height="155" loading="lazy"></p>
<ul>
<li>Now you can go to the console to check if it has been created:</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736692453693/320318d4-bdf3-4be3-a709-6cff18459c9c.png" alt="Amazon console" class="image--center mx-auto" width="744" height="129" loading="lazy"></p>
<h3 id="heading-upload-files">Upload Files</h3>
<p>With the bucket created, we can now upload files through the console. I believe there's also a programmatic way to upload files and test, but I haven't explored all the methods in the documentation yet.</p>
<p>Click on the bucket name to be redirected to the object page. This is where you will upload your files for storage.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736692660862/355f828f-f83f-4501-a960-f0068cf9d977.png" alt="upload page" class="image--center mx-auto" width="1837" height="369" loading="lazy"></p>
<p>Click on the <strong>Upload button</strong> to upload a file. Remember, we're creating a Goal Manifestation Quote Application.</p>
<p>Now that we've set up a storage bucket:</p>
<ul>
<li><p>Open a tool like Google Drive, MS Word, WPS, or any other document editor.</p>
</li>
<li><p>Write down the goals you want to achieve.</p>
</li>
<li><p>Save the file in either PDF or DOCX format.</p>
</li>
<li><p>Take the document and upload it to your Amazon S3.o</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736693525955/765b6c3a-ae68-4cbc-9df7-e896a1d63cbb.png" alt="upload a document" class="image--center mx-auto" width="1519" height="402" loading="lazy"></p>
<p>To verify if it's the correct file:</p>
<ul>
<li><p>Navigate to the <strong>Permissions</strong> tab.</p>
</li>
<li><p>Scroll down to <strong>Block public access.</strong></p>
</li>
<li><p>Click on <strong>Edit</strong> and uncheck the box.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736738796036/6ab41bc4-72a8-4874-a491-35bcdda49938.png" alt="block access " class="image--center mx-auto" width="1860" height="291" loading="lazy"></p>
<p>As shown above, it is currently set to "on." Uncheck it to turn it "off."</p>
<ul>
<li><p>On the same bucket settings page, modify the policy.</p>
</li>
<li><p>Scroll down, and you'll see that a bucket policy has been auto-generated.</p>
</li>
<li><p>Go ahead and copy the policy.</p>
</li>
</ul>
<pre><code class="lang-plaintext">{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadGetObject",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*"
    }
  ]
}
</code></pre>
<ul>
<li>Go back to the bucket policy editor and paste the policy.</li>
</ul>
<p>Once you've completed these steps, your object will have public access.</p>
<p>Return to the <strong>Objects</strong> tab and click on the Object URL provided below:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736740454730/3b36b380-912d-4a2a-a8c5-bee61bd42765.png" alt="3b36b380-912d-4a2a-a8c5-bee61bd42765" class="image--center mx-auto" width="729" height="89" loading="lazy"></p>
<p>With this URL, your upload is now visible.</p>
<h2 id="heading-step-3-create-an-amazon-simple-notification-service-sns"><strong>Step 3: Create an Amazon Simple Notification Service (SNS)</strong></h2>
<p><strong>SNS</strong> is a fully managed messaging service provided by AWS. It enables communication between applications or directly with users by sending notifications.</p>
<p>To create an SNS, follow these steps:</p>
<h4 id="heading-1-log-in-to-the-aws-management-console"><strong>1. Log in to the AWS management console</strong></h4>
<p>Then go to Amazon SNS. Navigate to the SNS Dashboard and select <strong>Topics</strong> from the left-hand menu.</p>
<p>To create a topic:</p>
<ul>
<li><p>Click <strong>Create topic</strong>.</p>
</li>
<li><p>Choose a <strong>Topic type</strong>: Standard (default) or FIFO (for ordered messages).</p>
</li>
<li><p>Enter a <strong>Name</strong> for your topic. (for example, <code>MyFirstSNSTopic</code>).</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736743311856/fa51ecb9-935a-4567-829c-b84ee3c1bee0.png" alt="sns topic creation" class="image--center mx-auto" width="1225" height="727" loading="lazy"></p>
</li>
<li><p>Configure optional settings like encryption, delivery retry policies, or tags.</p>
</li>
<li><p>Click <strong>Create topic</strong>.</p>
</li>
</ul>
<h4 id="heading-2-add-subscriptions"><strong>2. Add Subscriptions:</strong></h4>
<p>Once the topic is created, click on it to open the details page. Select the <strong>Subscriptions</strong> tab.</p>
<p>Click <strong>Create Subscription</strong> and choose:</p>
<ul>
<li><p><strong>Protocol</strong> can be Email, SMS, HTTP/S, Lambda, or SQS.</p>
</li>
<li><p><strong>Endpoints</strong> such as email address, phone number, or URL.</p>
</li>
</ul>
<p>Click <strong>Create Subscription</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736743374208/8005dc71-68ed-4d26-b79b-7b418959ab6c.png" alt="Subscription created" class="image--center mx-auto" width="1544" height="231" loading="lazy"></p>
<h4 id="heading-3-confirm-the-subscription"><strong>3. Confirm the Subscription:</strong></h4>
<p>If you selected email or SMS, a confirmation link or code will be sent to the provided endpoint. Follow the instructions to confirm the subscription.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736743525222/90c3b61d-eeb2-450d-a397-253b9e3c15db.png" alt="A confirm message from amazon sns" class="image--center mx-auto" width="760" height="372" loading="lazy"></p>
<p>Now that we’ve done this, let's create an Amazon Lambda function that will trigger the SNS so that the message will be sent to your mail.</p>
<h2 id="heading-step-4-create-an-iam-policy"><strong>Step 4: Create an IAM Policy</strong></h2>
<p>This policy is created to authorize Amazon Lambda to trigger the event and to ensure that CloudWatch is automatically triggered to monitor the application's events.</p>
<p>To create a policy, follow these steps:</p>
<h4 id="heading-1-log-in-to-the-aws-management-console-1"><strong>1. Log in to the AWS Management console.</strong></h4>
<p>In the left-hand menu, select <strong>Policies</strong>. Then:</p>
<ul>
<li><p>Click <strong>Create policy</strong>.</p>
</li>
<li><p>Choose the <strong>Visual</strong> tab, then select the <strong>SNS</strong> service.</p>
</li>
<li><p>Next, click the <strong>Choose</strong> tab to create a custom policy.</p>
</li>
</ul>
<pre><code class="lang-plaintext">{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "sns:Publish",
            "Resource": "arn:aws:sns:REGION:ACCOUNT_ID:goal_topic"
        }
    ]
}
</code></pre>
<p>Then, replace the following placeholders with your info:</p>
<ul>
<li><p><code>region</code>: Your AWS region (for example, <code>us-east-1</code>).</p>
</li>
<li><p><code>account-id</code>: Your AWS account ID.</p>
</li>
<li><p><code>topic-name</code>: Your SNS topic name.</p>
</li>
</ul>
<h4 id="heading-2-view-and-create-the-policy"><strong>2. View and create the policy:</strong></h4>
<p>You can do this by following these steps:</p>
<ul>
<li><p>Click on the Review button.</p>
</li>
<li><p>Give your policy a <strong>Name</strong> (for example, <code>LambdaSNSPolicy</code>), and optionally, a <strong>Description</strong>.</p>
</li>
<li><p>Click <strong>Create policy</strong>.</p>
</li>
</ul>
<h4 id="heading-3-attach-policy-to-the-lambda-execution-role">3. Attach policy to the Lambda Execution Role</h4>
<p>Now, you need to attach the policy to your Lambda Execution Role. To do that, follow these steps:</p>
<ul>
<li><p>Go to the <strong>Roles</strong> section in the IAM Console.</p>
</li>
<li><p>Search for and select the execution role.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736749886571/70ea6752-5c13-465c-bc05-22e3da50127e.png" alt="lambdaexecution role" class="image--center mx-auto" width="1527" height="275" loading="lazy"></p>
<ul>
<li><p>Next, search for the policy you just created and select it.</p>
</li>
<li><p>Click <strong>Attach policy</strong>.</p>
</li>
</ul>
<p>Both policies will be automatically attached.</p>
<h2 id="heading-step-5-create-an-amazon-lambda-function"><strong>Step 5: Create an Amazon Lambda function</strong></h2>
<p>Amazon Lambda is a service from AWS that lets you run code without managing servers. You upload your code, and Lambda automatically runs and scales it when needed.</p>
<p>Follow these steps to create an Amazon Lambda function:</p>
<h4 id="heading-1-log-in-to-aws-management-console"><strong>1. Log in to AWS Management Console</strong>:</h4>
<p>Navigate to AWS Lambda.</p>
<h4 id="heading-2-create-a-function"><strong>2. Create a Function</strong>:</h4>
<p>Click on the <strong>Create function</strong> and choose the option <strong>Author from scratch</strong>.</p>
<p>Fill in the details:</p>
<ul>
<li><p><strong>Function name</strong>: Enter a unique name (for example, <code>SNSLambdaFunction</code>).</p>
</li>
<li><p><strong>Runtime</strong>: Select the runtime (for example, Python, Node.js, Java, and so on).</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736751631488/fe254e56-89f1-4938-b2a9-e59b24e54a04.png" alt="creating a function" class="image--center mx-auto" width="1512" height="515" loading="lazy"></p>
<ul>
<li><strong>Role</strong>: Choose or create a role. If you already have a role, select <strong>Use an existing role</strong>. Otherwise, select <strong>Create a new role with basic Lambda permissions</strong>.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736751816631/97475623-10dc-4427-87ab-7e8789526e9e.png" alt="role choosing" class="image--center mx-auto" width="1108" height="346" loading="lazy"></p>
<ul>
<li>Click the <strong>Create function button</strong>.</li>
</ul>
<h4 id="heading-3-paste-in-the-code"><strong>3. Paste in the code</strong>:</h4>
<p>On the Lambda function’s page, go to the <strong>Configuration</strong> tab:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736753706928/b0351665-c506-454e-9c71-b4a52fce5a0a.png" alt="configuration tab" class="image--center mx-auto" width="1517" height="404" loading="lazy"></p>
<p>Remember, we are trying to fetch a quote. I'll add the ARN of the topic we created here and include my API keys. But for this tutorial, I will use the API directly to fetch the data.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736754071465/1322e207-5c51-45f1-979f-05f2388e9557.png" alt="1322e207-5c51-45f1-979f-05f2388e9557" class="image--center mx-auto" width="1517" height="404" loading="lazy"></p>
<h4 id="heading-4-write-the-lambda-code"><strong>4. Write the Lambda Code:</strong></h4>
<p>Go to the <strong>Code</strong> tab in your Lambda function. Then write or paste the code from your IDE to process the incoming SNS messages.</p>
<p>Example:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736754319755/60224578-53c2-43f6-9bf1-8cba6afaa1a3.png" alt="Testing code" class="image--center mx-auto" width="1513" height="405" loading="lazy"></p>
<p>Here’s the code:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> os
<span class="hljs-keyword">import</span> json
<span class="hljs-keyword">import</span> urllib.request
<span class="hljs-keyword">import</span> boto3

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">fetch_random_quote</span>():</span>
    <span class="hljs-string">"""
    Fetches a random quote from the ZenQuotes API.
    """</span>
    api_url = <span class="hljs-string">"https://zenquotes.io/api/random"</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-keyword">with</span> urllib.request.urlopen(api_url) <span class="hljs-keyword">as</span> response:
            data = json.loads(response.read().decode())
            <span class="hljs-keyword">if</span> data <span class="hljs-keyword">and</span> isinstance(data, list):
                <span class="hljs-comment"># Format the quote and author</span>
                quote = data[<span class="hljs-number">0</span>].get(<span class="hljs-string">"q"</span>, <span class="hljs-string">"No quote available"</span>)
                author = data[<span class="hljs-number">0</span>].get(<span class="hljs-string">"a"</span>, <span class="hljs-string">"Unknown author"</span>)
                <span class="hljs-keyword">return</span> <span class="hljs-string">f'"<span class="hljs-subst">{quote}</span>" - <span class="hljs-subst">{author}</span>'</span>
            <span class="hljs-keyword">else</span>:
                <span class="hljs-keyword">return</span> <span class="hljs-string">"No quote available."</span>
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        print(<span class="hljs-string">f"Error fetching random quote: <span class="hljs-subst">{e}</span>"</span>)
        <span class="hljs-keyword">return</span> <span class="hljs-string">"Failed to fetch quote."</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">lambda_handler</span>(<span class="hljs-params">event, context</span>):</span>
    <span class="hljs-string">"""
    AWS Lambda handler function to fetch a random quote and publish it to an SNS topic.
    """</span>
    <span class="hljs-comment"># Get the SNS topic ARN from environment variables</span>
    sns_topic_arn = os.getenv(<span class="hljs-string">"SNS_TOPIC_ARN"</span>)
    sns_client = boto3.client(<span class="hljs-string">"sns"</span>)

    <span class="hljs-comment"># Fetch a random quote</span>
    quote = fetch_random_quote()
    print(<span class="hljs-string">f"Fetched Quote: <span class="hljs-subst">{quote}</span>"</span>)

    <span class="hljs-comment"># Publish the quote to SNS</span>
    <span class="hljs-keyword">try</span>:
        sns_client.publish(
            TopicArn=sns_topic_arn,
            Message=quote,
            Subject=<span class="hljs-string">"Daily Random Quote to help you stay motivated and inspired to achieve your goals"</span>,
        )
        print(<span class="hljs-string">"Quote published to SNS successfully."</span>)
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        print(<span class="hljs-string">f"Error publishing to SNS: <span class="hljs-subst">{e}</span>"</span>)
        <span class="hljs-keyword">return</span> {<span class="hljs-string">"statusCode"</span>: <span class="hljs-number">500</span>, <span class="hljs-string">"body"</span>: <span class="hljs-string">"Error publishing to SNS"</span>}

    <span class="hljs-keyword">return</span> {<span class="hljs-string">"statusCode"</span>: <span class="hljs-number">200</span>, <span class="hljs-string">"body"</span>: <span class="hljs-string">"Quote sent to SNS"</span>}
</code></pre>
<h4 id="heading-5-save"><strong>5. Save:</strong></h4>
<p>Click on the deploy button to save.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736756768348/8ec83b6b-874c-47c3-a1ad-8d8b85cd6d48.png" alt="8ec83b6b-874c-47c3-a1ad-8d8b85cd6d48" class="image--center mx-auto" width="336" height="48" loading="lazy"></p>
<h4 id="heading-6-test-your-lambda-function"><strong>6. Test Your Lambda Function</strong>:</h4>
<p>Go to the <strong>Test</strong> tab and create a new test event.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736757103169/834c5b6c-8796-4a52-bcc3-cbd8009b01da.png" alt="TEST EVENT" class="image--center mx-auto" width="1496" height="671" loading="lazy"></p>
<p>Then save and run the test. If it’s successful, a message will be sent:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736757309807/d97f9648-0000-4ec8-b287-df5250b3be0a.png" alt="success msg" class="image--center mx-auto" width="1466" height="365" loading="lazy"></p>
<p>This means the message has been created for you</p>
<p>Finally, check your email or SMS, depending on the endpoint you used for this tutorial. In my case, I used email.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736757884384/d5b949d4-0804-4694-9674-77fc0265e2e8.png" alt="email notification" class="image--center mx-auto" width="1314" height="309" loading="lazy"></p>
<h2 id="heading-step-6-create-an-eventbridge"><strong>Step 6: Create an EventBridge</strong></h2>
<p>Amazon EventBridge is a service that helps you connect applications and AWS services such as the Amazon SNS and Amazon Lambda.</p>
<p>To create an Amazon EventBridge rule, follow these steps:</p>
<h4 id="heading-1-navigate-to-eventbridge"><strong>1. Navigate to EventBridge</strong>:</h4>
<p>In the search bar, type <strong>EventBridge</strong> and select it from the services list.</p>
<h4 id="heading-2-create-a-rule"><strong>2. Create a Rule:</strong></h4>
<p>In the EventBridge console, click <strong>Rules</strong> on the left panel. Then click the <strong>Create rule</strong> button.</p>
<h4 id="heading-3-set-up-the-rule-details"><strong>3. Set Up the Rule Details</strong>:</h4>
<ul>
<li><p><strong>Name</strong>: Enter a unique name for your rule.</p>
</li>
<li><p><strong>Description (optional)</strong>: Add a description to explain what this rule does.</p>
</li>
</ul>
<h4 id="heading-4-choose-the-event-bus"><strong>4. Choose the Event Bus</strong>:</h4>
<p>Select <strong>Default event bus</strong> (or another event bus if you've created one).</p>
<h4 id="heading-5-define-the-event-pattern-or-schedule"><strong>5. Define the Event Pattern or Schedule</strong>:</h4>
<p><strong>For Event Pattern</strong>:</p>
<ul>
<li><p>Choose an <strong>AWS Service</strong> as the event source.</p>
</li>
<li><p>Select the specific <strong>event type</strong> (for example, an S3 file upload or an EC2 instance state change).</p>
</li>
</ul>
<p><strong>For Schedule</strong>:</p>
<ul>
<li>Choose the <strong>Schedule</strong> option to run the rule on a fixed interval (for example, every 5 minutes).</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736759371221/ca28dcf2-061a-4c8f-8191-32bdf8380111.png" alt="rule details" class="image--center mx-auto" width="1513" height="817" loading="lazy"></p>
<ul>
<li>Click on continue. This takes you to the specific details page where:</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736759696183/44ba44e8-2a1b-4cd8-928b-6fe87cc35c4e.png" alt="schedule page" class="image--center mx-auto" width="1509" height="795" loading="lazy"></p>
<ul>
<li><p>Scroll down and click on the cron scheduler. The cron scheduler specifies what time the message will be sent.</p>
</li>
<li><p>Select <strong>"Off"</strong> for the flexible time window option.</p>
</li>
<li><p>Review the rule details to confirm everything is correct.</p>
</li>
<li><p>Click the <strong>"Next"</strong> button to proceed to the <strong>Target</strong> page.</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736760213450/c4f6cccf-7f89-485d-802e-051284c89f9a.png" alt="cron scheduler " width="1475" height="798" loading="lazy"></p>
<p>  The picture above shows when the time the messages will be sent.</p>
<ul>
<li>On the Target page, select <strong>AWS Lambda</strong> to invoke your function.</li>
</ul>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736761288843/e35a7153-48d7-4b34-86ce-9cba68bd5161.png" alt="the target page" class="image--center mx-auto" width="1485" height="511" loading="lazy"></p>
<ul>
<li>Scroll down to invoke and choose the function you created.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736761539389/4faa1dbc-5635-4de3-8087-15a444298b2e.png" alt="invoke the function" class="image--center mx-auto" width="1114" height="193" loading="lazy"></p>
<ul>
<li>Click the "Next" button to proceed. This will take you to the settings page. Under the permissions section, select "Use existing rule."</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736782488383/ffbbcc4e-6379-4c9c-af16-f4c017e7426c.png" alt="setting page" class="image--center mx-auto" width="1509" height="366" loading="lazy"></p>
<ul>
<li>Lastly, go to the review and create a schedule:</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736783029778/2d0e7ff9-bb7d-462d-a644-23517f47e53e.png" alt="2d0e7ff9-bb7d-462d-a644-23517f47e53e" class="image--center mx-auto" width="1463" height="776" loading="lazy"></p>
<ul>
<li>The next page shows you all the details:</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1736783558777/4545d2da-5020-46c3-a265-5499e6b4e74f.png" alt="4545d2da-5020-46c3-a265-5499e6b4e74f" class="image--center mx-auto" width="1512" height="828" loading="lazy"></p>
<p>Using the EventBrige creates a scheduler for the users.</p>
<h2 id="heading-step-7-upload-your-code"><strong>Step 7: Upload Your Code</strong></h2>
<p>Finally, upload your code to GitHub and include proper documentation to help explain how the code works.</p>
<p>Check this documentation out if you don’t know how: <a target="_blank" href="https://docs.github.com/en/get-started/start-your-journey/uploading-a-project-to-github">Uploading a project to GitHub</a>.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>If you’ve followed all these steps, you will have created a Goal Manifestation Quote App using AWS Lambda, Amazon S3, Amazon SNS, and Amazon EventBridge. This app fetches motivational quotes and sends them to subscribers on a schedule.</p>
<p>You can find the repository link <a target="_blank" href="https://github.com/ijayhub/goal-manifestation-quote">here</a>.</p>
<p>Feel free to share your progress or ask questions if you have any issues.</p>
<p>If you found this article helpful, share it with others.</p>
<p>Stay updated with my projects by following me on <a target="_blank" href="https://https//twitter.com/ijaydimples">Twitter</a>, <a target="_blank" href="https://www.linkedin.com/in/ijeoma-igboagu/">LinkedIn</a> and <a target="_blank" href="https://github.com/ijayhub">GitHub</a></p>
<p>Thank you for reading 💖.</p>
<p><strong>Disclaimer:</strong><br>The resources shown in this article, including the S3 bucket and its ARN, have been deleted and no longer exist. The details visible in the screenshots are used solely for demonstration purposes.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Monitor Your Kubernetes Clusters with Prometheus and Grafana on AWS ]]>
                </title>
                <description>
                    <![CDATA[ Creating a solid application monitoring and observability strategy is a critical foundational step when deploying infrastructure or software in any environment. Monitoring ensures that your systems are running smoothly, while observability provides i... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/kubernetes-cluster-observability-with-prometheus-and-grafana-on-aws/</link>
                <guid isPermaLink="false">6790382dcb2eedbe449b6899</guid>
                
                    <category>
                        <![CDATA[ Kubernetes ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Grafana ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Devops ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ cloudnative ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Eti Ijeoma ]]>
                </dc:creator>
                <pubDate>Wed, 22 Jan 2025 00:13:33 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737504669572/017570c6-7676-44e1-aa19-4257dd7d30e7.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Creating a solid application monitoring and observability strategy is a critical foundational step when deploying infrastructure or software in any environment. Monitoring ensures that your systems are running smoothly, while observability provides insights into the internal state of your application through the data generated. Together, they help you detect and address issues proactively rather than reacting after a failure occurs.</p>
<p>In Kubernetes environments, the complexity of managing distributed microservices can be challenging. For instance, an application usually spans multiple pods, nodes, and clusters. Because of Kubernetes’s dynamic nature, where pods are frequently created and terminated, proper monitoring and observability are ideal for capturing its fleeting behavior.</p>
<p>Imagine building a microservices application with several connected services handling critical components such as authentication, payments, and databases without proper monitoring. A sudden traffic spike could affect a single service, cascading to other services, causing the system to crash and resulting in downtime.</p>
<p>Without proper visibility, you may struggle to find the root cause of the issue. You may spend hours manually going through logs – and meanwhile, users are frustrated, and businesses are losing revenue and customer trust.</p>
<p>Before we begin the project, you’ll learn key monitoring and observability concepts, as well as why tools like Prometheus and Grafana are crucial for setting up a robust monitoring stack on your Kubernetes infrastructure.</p>
<h3 id="heading-heres-what-well-cover">Here’s what we’ll cover:</h3>
<ul>
<li><p><a class="post-section-overview" href="#heading-understanding-monitoring-and-observability">Understanding Monitoring and Observability</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-tools-for-monitoring-and-observability">Tools for Monitoring and Observability</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-deploy-prometheus-and-grafana-on-aws-eks-using-helm">How to Deploy Prometheus and Grafana on AWS EKS using Helm</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-understanding-monitoring-and-observability">Understanding Monitoring and Observability</h2>
<p>Implementing a proper monitoring and observability approach is important in fast-paced production Kubernetes environments. This helps in situations where downtime can lead to serious business loss and damage to customer trust. It’ll hopefully help you avoid the dreaded 2 am calls that are usually triggered by alert noise so you can focus on adding more innovative features to your software (rather than spending so much energy firefighting).</p>
<p>Monitoring and observability are often referred to as the same thing. But they serve two different purposes, especially for development and engineering teams.</p>
<h3 id="heading-monitoring">Monitoring</h3>
<p>In the software development lifecycle, monitoring is the practice of analyzing data in real time or reviewing data trends to ensure the health and performance of systems, infrastructure, and applications. Monitoring acts as the eyes and ears of your IT operations, collecting insightful data and presenting it in a way that is actionable.</p>
<p>If you have visited the IT department of a well-established organization, you have most likely seen large screens displaying colorful dashboards with charts and real-time statistics. This offers a centralized view of the key metrics, such as the server uptime, application response times, and resource usage.</p>
<h3 id="heading-observability">Observability</h3>
<p>Observability helps to address issues that haven’t been anticipated. These are usually called “unknown unknowns."  Unlike monitoring, which deals with predefined parameters and data, observability goes deeper into the application to give a broader view.</p>
<p>This not only helps to answer what is happening within your system and why it is happening. It also uses patterns within the system and application operations to detect and resolve issues efficiently. </p>
<p>Observability revolves around the three pillars of data: <strong>metrics</strong>, <strong>logs</strong>, and <strong>traces</strong>.</p>
<h4 id="heading-1-metrics">1. Metrics</h4>
<p>Metrics consist of time-series measurements such as CPU usage and memory consumption. These data points help teams to manage, optimize, and predict system performance and deviations from expected behavior.</p>
<h4 id="heading-2-logs">2. Logs</h4>
<p>Logs serve as a history of what happened within the system. It is a trail for engineers, especially during troubleshooting. Logs are important in diagnosing root causes and discovering malicious activities.</p>
<h4 id="heading-3-traces">3. Traces</h4>
<p>Traces provide insights into application workflows by tracking requests as they move through various components. They are good for highlighting latency issues and potential points of failure.</p>
<h2 id="heading-tools-for-monitoring-and-observability">Tools for Monitoring and Observability</h2>
<p>Now that you understand the theory behind monitoring and observability, you may be wondering what platforms and tools are available to developers to collect data and get insights about their services.</p>
<p>In the world of cloud-native infrastructure and Kubernetes, many users gravitate towards the popular stack of Prometheus and Grafana.</p>
<h3 id="heading-prometheus">Prometheus</h3>
<p>Prometheus is an open-source tool that specializes in collecting metrics as time-series data. The information is stored with the timestamp when it was recorded.<br>The Prometheus ecosystem includes the main Prometheus server, which scrapes and stores time-series data, an alert manager for managing alerts, a push gateway for handling metrics from short-lived jobs, and exporters for collecting metrics from various services connected to the cluster.</p>
<p>It fits both in machine-centric and application-centric monitoring, especially for microservices in a Kubernetes cluster. It’s designed to be the system you go to if there is a system outage and you need to quickly diagnose problems.</p>
<p>The Prometheus ecosystem includes the main Prometheus server, which scrapes and stores time-series data, an alert manager for managing alerts, a push gateway for handling metrics from short-lived jobs, and exporters for collecting metrics from various services connected to the cluster.</p>
<p>Prometheus fits both in machine-centric and application-centric monitoring, especially for microservices in a Kubernetes cluster. It’s designed to be the system you go to if there is a system outage and you need to quickly diagnose problems.</p>
<h3 id="heading-grafana">Grafana</h3>
<p>Grafana is a visualization tool that transforms, queries, visualizes, and sets alerts on raw metrics stored in Prometheus. With Grafana, you can explore metrics and logs wherever they are stored and display the data on live dashboards. This allows teams to monitor system performance, identify trends, and act quickly on anomalies.</p>
<p>Prometheus and Grafana are compatible with containerized applications, especially in Kubernetes environments. It can also manage workloads outside Kubernetes for flexibility. They are both open-source tools that give developers control over the implementation. There is no licensing cost, which helps teams that cannot afford expensive, powerful solutions.</p>
<p>By combining Prometheus and Grafana, your team gets helpful insights into the system to optimize performance, track errors, and aid troubleshooting processes.</p>
<h2 id="heading-how-to-deploy-prometheus-and-grafana-on-aws-eks-using-helm">How to Deploy Prometheus and Grafana on AWS EKS using Helm</h2>
<h3 id="heading-prerequisites">Prerequisites</h3>
<p>For this project, we will use an EC2 instance with the Ubuntu 22.04 operating system. If you are using Windows or a Mac, log into AWS to create your virtual machine.</p>
<p>Here’s what else you’ll need:</p>
<h4 id="heading-1-aws-account-setup-with-access-keys-and-secret-keys">1. AWS account setup with access keys and secret keys</h4>
<ul>
<li><p><a target="_blank" href="https://portal.aws.amazon.com/billing/signup">AWS Sign Up</a></p>
</li>
<li><p><a target="_blank" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html">AWS Access ID and Secret Keys</a></p>
</li>
</ul>
<h4 id="heading-2-knowledge-of-kubernetes">2. Knowledge of Kubernetes</h4>
<ul>
<li><a target="_blank" href="https://kubernetes.io/docs/home/">Kubernetes Official Documentation</a></li>
</ul>
<h4 id="heading-3-aws-cli-installation-for-the-virtual-server">3. AWS CLI installation for the virtual server</h4>
<ul>
<li><a target="_blank" href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">AWS CLI Installation Guide</a></li>
</ul>
<h3 id="heading-getting-started">Getting Started</h3>
<p>Let’s start by setting up an EKS cluster on a virtual server and installing the required tools on the server. Then, we’ll deploy our monitoring tools, Prometheus and Grafana, using Helm charts. In the end, we’ll deploy an NGINX web application on Kubernetes and use Grafana to visualize the pod performance and cluster resource usage on the cluster.</p>
<h3 id="heading-step-1-install-aws-cli-eksctl-kubectl-and-helm">Step 1: Install AWS CLI, <code>eksctl</code>, <code>kubectl</code>, and Helm</h3>
<p>AWS CLI is a tool that allows users to interact with AWS services using the command-line interface. It makes the management of cloud resources simpler and enables admins to configure AWS services.</p>
<p>Here, we will install AWS CLI on our server to be able to create Kubernetes resources.</p>
<p>On your server, run the following commands:</p>
<pre><code class="lang-bash">curl <span class="hljs-string">"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"</span> -o <span class="hljs-string">"awscliv2.zip"</span>

sudo apt install unzip

unzip awscliv2.zip

sudo ./aws/install
</code></pre>
<p>Verify the installation by running this:</p>
<pre><code class="lang-bash">aws --version
</code></pre>
<p>After installation, configure the AWS CLI with your credentials using the following command:</p>
<pre><code class="lang-bash">aws configure
</code></pre>
<p>You will be prompted to enter your AWS Access Key ID, Secret Access Key, Default region name, and default output format.</p>
<p>Next, we need to install eksctl. <code>eksctl</code> is a command-line tool that simplifies the creation and management of Kubernetes clusters on AWS. It helps you configure, set, and maintain clusters and allows you to manage clusters more effectively.</p>
<p>This tool removes the complexities of setting up a production-grade cluster, helping you and your admins focus only on application development and deployment.</p>
<p>To set up <code>eksctl</code> on your machine, download the latest release using the following command:</p>
<pre><code class="lang-bash"><span class="hljs-comment"># for ARM systems, set ARCH to: arm64, armv6 or armv7</span>
ARCH=amd64

PLATFORM=$(uname -s)_<span class="hljs-variable">$ARCH</span>

curl -sLO <span class="hljs-string">"https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_<span class="hljs-variable">$PLATFORM</span>.tar.gz"</span>

<span class="hljs-comment"># (Optional) Verify checksum</span>

curl -sL <span class="hljs-string">"https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt"</span> | grep <span class="hljs-variable">$PLATFORM</span> | sha256sum --check

tar -xzf eksctl_<span class="hljs-variable">$PLATFORM</span>.tar.gz -C /tmp &amp;&amp; rm eksctl_<span class="hljs-variable">$PLATFORM</span>.tar.gz

sudo mv /tmp/eksctl /usr/<span class="hljs-built_in">local</span>/bin
</code></pre>
<p>Run <code>eksctl version</code> to confirm its successful installation and the version downloaded.</p>
<pre><code class="lang-bash">eksctl version <span class="hljs-comment"># 0.198.0</span>
</code></pre>
<p>Next, we’ll run Kubectl which is a command line interface for managing and interacting with Kubernetes clusters. It enables users to deploy and manage applications within a Kubernetes environment.</p>
<p>With Kubectl, you can perform various crucial operations such as scaling, deployments, inspecting cluster status, and managing networking.</p>
<p>To install <code>kubectl</code>, run the following commands:</p>
<pre><code class="lang-bash">curl -LO <span class="hljs-string">"https://storage.googleapis.com/kubernetes-release/release/<span class="hljs-subst">$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)</span>/bin/linux/amd64/kubectl"</span>
chmod +x ./kubectl
sudo mv ./kubectl /usr/<span class="hljs-built_in">local</span>/bin
</code></pre>
<p>Run <code>kubectl</code> on your command line to confirm it has been installed successfully:</p>
<pre><code class="lang-bash">kubectl version 
<span class="hljs-comment"># client version: 0.198.0</span>
<span class="hljs-comment"># Kustomize Versionv: 5.4.2</span>
<span class="hljs-comment"># Server Version: v1.30.7-eks-56e63d8</span>
</code></pre>
<p>Finally, we’ll install Helm which is a Kubernetes Package manager that simplifies the deployments and management of applications in Kubernetes. It uses <a target="_blank" href="https://helm.sh/docs/topics/charts/"><strong>charts</strong></a> to define Kubernetes resources into a collection of files, handles templating and versioning, and makes application deployment easier.</p>
<p>Here, we will install the Helm package manager on our virtual machine for our cluster deployments. This downloads the installation script and saves it in the <code>get_helm.sh</code> file.</p>
<p>Next, the file is set to executable, which allows only the user to run it. Finally, the script is executed using the <code>./get_helm.sh</code> command.</p>
<pre><code class="lang-bash">curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3

chmod 700 get_helm.sh

./get_helm.sh
</code></pre>
<h3 id="heading-step-2-create-a-kubernetes-cluster">Step 2: Create a Kubernetes Cluster</h3>
<p>Next, we need to create our Kubernetes cluster in AWS with the <code>eksctl</code> command line. We can do this with the following command:</p>
<pre><code class="lang-bash">eksctl create cluster --name my-prac-cluster-1 --version 1.30 --region us-east-1 --nodegroup-name worker-nodes --node-type t2.medium --nodes 2 --nodes-min 2 --nodes-max 3
</code></pre>
<p><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf-np7NdxK-zwQLtYoVE51RUoHYMf5GBHT1tAEjV-eoxk2xCvH13s0tjzPdIb8QVt5amijSBjkpaAh4AuPQd4DJvtnKmMpPQ1_dFoRx1KRNRiCto0U7CpXU-rsd-KH8NhuQoHfRAg?key=U2Fi6zvcj43zRMwXR2oKCzLU" alt="Terminal window in Visual Studio Code displaying a series of commands and outputs related to setting up an EKS cluster. The log includes status updates, such as &quot;creating addon&quot; and &quot;EKS cluster resources have been created.&quot; The environment is Ubuntu, visible through the desktop interface and application icons on the left." width="1366" height="768" loading="lazy"></p>
<p>Let’s break down the command:</p>
<ul>
<li><p><code>–name my-prac-cluster-1</code>: This specifies the name of the EKS cluster that will be created. In this case, the cluster will be named <strong>my-prac-cluster-1</strong>.</p>
</li>
<li><p><code>–version 1.30</code>: This sets the Kubernetes version for the cluster. Here, the version will be version 1.30.</p>
</li>
<li><p><code>--region us-east-1</code>: This specifies the AWS region where the cluster will be provisioned on AWS. Here, it is set to us-east-1.</p>
</li>
<li><p><code>--nodegroup-name worker-nodes</code>: This defines the name of the node groups that will be created. In this case, it’s named <strong>worker-nodes</strong>.</p>
</li>
<li><p><code>--node-type t2.large</code>: This sets the instance type for the worker nodes in the <code>node-group</code>.</p>
</li>
<li><p><code>--nodes 2</code>: This sets the desired number of worker nodes in the node group.</p>
</li>
<li><p><code>--nodes-min 2</code>: This sets the minimum number of worker nodes that should be maintained in the node group to 2.</p>
</li>
<li><p><code>--nodes-max 3</code>: This defines the maximum number of worker nodes allowed in the node group and sets it to 3.</p>
</li>
</ul>
<p>Once the cluster comes up, run the command <code>kubectl get nodes</code> to ensure that the cluster is set up properly.</p>
<h3 id="heading-step-3-install-the-metrics-server">Step 3: Install the Metrics Server</h3>
<p>The metrics server is a component that collects resource data from the Kubelets on each node in the cluster. This includes metrics such as CPU, memory, and network usage, which Prometheus can access. The server provides a single source of truth for resource data and is easy to deploy and use.</p>
<p>Run the following script to install the metrics server:</p>
<pre><code class="lang-bash">kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
</code></pre>
<p>To verify the installation, run the following command:</p>
<pre><code class="lang-bash">kubectl get deployment metrics-server -n kube-system
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734913540206/47361106-21b0-4076-91c2-ffb8a925b372.jpeg" alt="A terminal screenshot displaying the command output for `kubectl get deployment metrics-server -n kube-system`. It shows the deployment details of &quot;metrics-server&quot; with readiness, up-to-date and available statuses as 1, and an age of 51 minutes." class="image--center mx-auto" width="1122" height="234" loading="lazy"></p>
<h3 id="heading-step-4-install-the-iam-oidc-identity-provider-and-amazon-ebs-csi-driver">Step 4: Install the IAM OIDC Identity Provider and Amazon EBS CSI Driver</h3>
<p>The IAM OpenID connect provider allows Kubernetes access to AWS resources within the cluster. Here, we need EBS volumes to create persistent storage for Prometheus pods.</p>
<p>Run the following commands to create the IAM OIDC provider:</p>
<pre><code class="lang-bash">eksctl utils associate-iam-oidc-provider --cluster my-prac-cluster-1 --approve
</code></pre>
<p>Next, we will create the Amazon EBS CSI Driver that will provide permissions for the cluster to access the EBS volumes. Replace the placeholder “my-cluster” with your cluster name.</p>
<pre><code class="lang-bash">eksctl create iamserviceaccount \

--name ebs-csi-controller-sa \

--namespace kube-system \

--cluster my-prac-cluster-1 \

--role-name AmazonEKS_EBS_CSI_DriverRole \

--role-only \

--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \

--approve
</code></pre>
<p>Now, we need to add the AWS EBS Driver Addon to the cluster using the following commands:</p>
<pre><code class="lang-bash">eksctl create addon --name aws-ebs-csi-driver --cluster &lt;cluster_name&gt; --service-account-role-arn arn:aws:iam::&lt;AWS_ACCOUNT_ID&gt;:role/AmazonEKS_EBS_CSI_DriverRole --force
</code></pre>
<p>Adding the AWS EBS CSI Driver to your Kubernetes cluster enables the cluster to dynamically create and manage EBS volumes for persistent storage within the cluster. Since our Prometheus installation needs persistent volumes, this add-on will enable the cluster to create EBS volumes to persist data.</p>
<p>Now, our future Prometheus installation will create EBS volumes for persistent storage.</p>
<h3 id="heading-step-5-install-prometheus-and-grafana">Step 5: Install Prometheus and Grafana.</h3>
<p>To install Prometheus and Grafana, we need to add the Helm Stable Charts for the local client.</p>
<p>Run the command below:</p>
<pre><code class="lang-bash">helm repo add stable https://charts.helm.sh/stable
</code></pre>
<p>Next, we will add the Prometheus Helm repo:</p>
<pre><code class="lang-bash">helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
</code></pre>
<p>We’ll use the Prometheus community version because it is well-maintained by the Prometheus community. It offers faster updates and continuous improvements for different Kubernetes environments.</p>
<p>Next, create the Prometheus namespace:</p>
<pre><code class="lang-bash">kubectl create namespace prometheus
</code></pre>
<p>Install Prometheus and Grafana through the <code>kube-prometheus-stack</code> Helm Chart:</p>
<pre><code class="lang-bash">helm install stable prometheus-community/kube-prometheus-stack -n prometheus
</code></pre>
<p>When that’s done, verify that the Prometheus deployment and service are installed by using the command below:</p>
<pre><code class="lang-bash">kubectl get all -n prometheus
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734913921541/9b851fcc-c390-4d86-9108-adaaddd58d07.jpeg" alt="Terminal output showing Kubernetes resources in the &quot;prometheus&quot; namespace. It lists several pods and services, each with information on readiness, status, restarts, age, type, cluster IP, and ports. All pods are in the &quot;Running&quot; status, with no restarts." class="image--center mx-auto" width="1135" height="597" loading="lazy"></p>
<p>At this stage, you should change the service type from a ClusterIP to a LoadBalancer in the manifest file. We can update the file by running the command below:</p>
<pre><code class="lang-bash">kubectl edit svc stable-kube-prometheus-sta-prometheus -n prometheus
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734914216836/217e2e5e-1d75-4ca4-88eb-56276f25c12f.jpeg" alt=" Screenshot of a Kubernetes service YAML file edited with kubectl for Prometheus in the prometheus namespace." class="image--center mx-auto" width="1172" height="584" loading="lazy"></p>
<p>After the update, a LoadBalancer URL will be generated for you to access your Prometheus Dashboard.</p>
<p><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcWtK8G1cJTD8GI-vACe_KexsXIp5SEXYiGTuBXZNQJ93tpo-XrMVb6ekA1ZRDrAODyFn29p3JdQDOHCdMnq2eapX4drdLMJ_8u_B8z1Jl0LqJjIHJwwIbDhgRUU5tlkGhhnBdYKQ?key=U2Fi6zvcj43zRMwXR2oKCzLU" alt=" Prometheus dashboard showing the &quot;Targets&quot; page with active scrape pools, including details such as endpoints, state, labels, last scrape, scrape duration, and errors for Prometheus Alertmanager services." width="1366" height="768" loading="lazy"></p>
<p>Next, we’ll move over to Grafana. Change the SVC file of Grafana to create a LoadBalancer and expose it to the public using the command below:</p>
<pre><code class="lang-bash">kubectl edit svc stable-grafana -n prometheus
</code></pre>
<p>Next, we will update the Grafana SVC file by changing the service <code>type</code> from <code>ClusterIP</code> to <code>LoadBalancer</code> to expose it to the public using the command below:</p>
<pre><code class="lang-bash">kubectl edit svc stable-grafana -n prometheus
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734914435224/1ab76b93-2b35-4074-92cb-c7c3173edaee.jpeg" alt=" Screenshot of a Kubernetes service YAML configuration file edited using kubectl edit svc stable-grafana -n prometheus, displaying the details for the Grafana service in the prometheus namespace" class="image--center mx-auto" width="1144" height="601" loading="lazy"></p>
<p>Once the settings are saved, you can use the <code>LoadBalancer</code> link to access your Grafana Dashboard from the browser. The username is <strong>admin</strong>. To get the login password printed in the terminal, run the following command:</p>
<pre><code class="lang-bash">kubectl get secret --namespace prometheus stable-grafana -o jsonpath=<span class="hljs-string">"{.data.admin-password}"</span> | base64 --decode ; <span class="hljs-built_in">echo</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734915573534/12b64c7f-b74b-4ebb-8a1b-ae6c5357f76a.jpeg" alt="Grafana login screen displaying input fields for email/username and password with a notification indicating a successful login." class="image--center mx-auto" width="1276" height="629" loading="lazy"></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734915606224/bc06a48b-75e8-4115-816b-462c69975d97.jpeg" alt="Grafana welcome dashboard after a successful authentication" class="image--center mx-auto" width="1243" height="636" loading="lazy"></p>
<p>After successfully logging into the Grafana dashboard, the first step is to create a <code>datasource</code> that will provide the metrics for the Grafana visualization.</p>
<p>Go to <strong>Add your first data source</strong> and choose Prometheus as the Data Source.</p>
<p>Insert the Prometheus URL, and click on “<strong>Save and Test</strong>”. It should show success if Grafana queries the Prometheus URL successfully.</p>
<p>The next step is to create a Dashboard that our Grafana visualization will use to view the metrics of our pods. To do so, click on “<strong>Dashboards</strong>” and then on “<strong>Add Visualization.</strong>”</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734915769650/10f7877b-7183-4709-b672-ff6d67ef529d.jpeg" alt="Screenshot of a configuration interface showing options for custom query parameters and HTTP method (set to POST) for Prometheus data source. Confirmation message states, &quot;Successfully queried the Prometheus API,&quot; with options to delete or save &amp; test." class="image--center mx-auto" width="1293" height="627" loading="lazy"></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734915836669/3fb27ce9-23d9-4c35-abf6-7ce44508720d.jpeg" alt="Grafana Dashboard interface with options to add a visualization, import a panel, or import a dashboard. There is a prominent button for adding a visualization." class="image--center mx-auto" width="1263" height="622" loading="lazy"></p>
<p>You’d be taken to an environment where you’d be required to import a dashboard. Select the data source as “<strong>Prometheus-1</strong>” and use the code “<strong>15760</strong>” to import the Node Exporter dashboard to view our pods.</p>
<p>Click on Load after importing the dashboard, and you will see your newly created dashboard.</p>
<p>Here, we can see the entire data of the cluster, the CPU and RAM use, and data regarding pods in a specified namespace.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734917376090/9e0097f4-07bb-495a-9572-060db373334c.jpeg" alt="Screenshot of a Grafana interface showing a &quot;Select data source&quot; window. Two data sources named &quot;Prometheus&quot; and &quot;prometheus-1&quot; are listed. Options for using mixed data sources, dashboards, and Grafana mock data are on the right." class="image--center mx-auto" width="1266" height="579" loading="lazy"></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734917392381/c7e01350-d90e-43a1-b172-82899f377d82.jpeg" alt="Screenshot of Grafana's &quot;Import dashboard&quot; page, showing options to upload a JSON file or enter a dashboard ID. The ID &quot;15760&quot; is entered in the input box, and there is a JSON model example displayed below." class="image--center mx-auto" width="1284" height="637" loading="lazy"></p>
<h3 id="heading-step-6-deploying-an-application-on-kubernetes-to-monitor-on-grafana">Step 6: Deploying an Application on Kubernetes to Monitor on Grafana.</h3>
<p>Finally, we will deploy an NGINX container in our EKS Cluster to monitor using Grafana. We need to create a Yaml deployment and service file.</p>
<pre><code class="lang-yaml"><span class="hljs-attr">apiVersion:</span> <span class="hljs-string">apps/v1</span>

<span class="hljs-attr">kind:</span> <span class="hljs-string">Deployment</span>

<span class="hljs-attr">metadata:</span>

<span class="hljs-attr">name:</span> <span class="hljs-string">nginx-app</span>

<span class="hljs-attr">spec:</span>

<span class="hljs-attr">replicas:</span> <span class="hljs-number">2</span>

<span class="hljs-attr">selector:</span>

<span class="hljs-attr">matchLabels:</span>

<span class="hljs-attr">app:</span> <span class="hljs-string">nginx-app</span>

<span class="hljs-attr">template:</span>

<span class="hljs-attr">metadata:</span>

<span class="hljs-attr">labels:</span>

<span class="hljs-attr">app:</span> <span class="hljs-string">nginx-app</span>

<span class="hljs-attr">spec:</span>

<span class="hljs-attr">containers:</span>

<span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">nginx-app</span>

<span class="hljs-attr">image:</span> <span class="hljs-string">nginx:latest</span>

<span class="hljs-attr">ports:</span>

<span class="hljs-bullet">-</span> <span class="hljs-attr">containerPort:</span> <span class="hljs-number">80</span>

<span class="hljs-meta">---</span>

<span class="hljs-attr">apiVersion:</span> <span class="hljs-string">v1</span>

<span class="hljs-attr">kind:</span> <span class="hljs-string">Service</span>

<span class="hljs-attr">metadata:</span>

<span class="hljs-attr">name:</span> <span class="hljs-string">nginx-app</span>

<span class="hljs-attr">spec:</span>

<span class="hljs-attr">type:</span> <span class="hljs-string">LoadBalancer</span>

<span class="hljs-attr">ports:</span>

<span class="hljs-bullet">-</span> <span class="hljs-attr">port:</span> <span class="hljs-number">80</span>

<span class="hljs-attr">targetPort:</span> <span class="hljs-number">80</span>

<span class="hljs-attr">selector:</span>

<span class="hljs-attr">app:</span> <span class="hljs-string">nginx-app</span>
</code></pre>
<p>To deploy the Node.js application on the Kubernetes cluster, use the following <code>kubectl</code> command. Verify the deployment by running the following <code>kubectl</code> command:</p>
<pre><code class="lang-bash">kubectl apply -f deployment.yml

kubectl get deployment

kubectl get pods
</code></pre>
<p>Click the load balancer URL to see your application on your browser:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734917018333/987b78c4-cae0-42dc-bd19-0a4f8a6a6b10.jpeg" alt="Browser window displaying the default welcome page for Nginx, indicating successful installation and suggesting further configuration." class="image--center mx-auto" width="1162" height="710" loading="lazy"></p>
<p>Let’s refresh our Grafana dashboard to see our NGINX web application in Grafana.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734917096760/72815d56-04a5-47cf-8b2b-89164ccb7e7a.jpeg" alt="A Kubernetes dashboard showing CPU and memory usage by container. The CPU usage graph is on the left, and the memory usage graph is on the right. Both graphs display data for containers named &quot;nginx-app&quot; over the last 5 minutes." class="image--center mx-auto" width="1278" height="626" loading="lazy"></p>
<h3 id="heading-step-7-deleting-the-cluster">Step 7: Deleting the Cluster</h3>
<p>Now that everything is set up, we can delete our Kubernetes Cluster to avoid extra costs. Run the following commands to do so:</p>
<pre><code class="lang-bash">eksctl delete cluster my-prac-cluster-1 –region us-east-1
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1734917455255/04b00a79-d963-4e28-bc99-4cb6ea8c65cf.jpeg" alt="A terminal window displaying a series of commands and system messages related to the deletion of an EKS cluster and associated resources. It shows timestamps for each action, status updates, and confirmation that all cluster resources were deleted successfully." class="image--center mx-auto" width="1192" height="657" loading="lazy"></p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>This article teaches the theory behind monitoring and observability and highlights the roles of Prometheus and Grafana in these processes.</p>
<p>We went through a hands-on deployment of Prometheus and Grafana on an EKS cluster and a web application to illustrate how they can be effectively monitored using Grafana.</p>
<p>By leveraging these tools, administrators can enjoy real-time visibility into their Kubernetes infrastructure, easily spot performance bottlenecks, and confidently make decisions that enhance application performance and reliability.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Move a Single Fly Machine and Volume to a New Region with flyctl ]]>
                </title>
                <description>
                    <![CDATA[ Fly.io allows users to deploy their applications to virtual machines in regions where their applications are mostly used. A Fly application can also be deployed to multiple regions. You may want to move your Fly application to a new region if you exp... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-move-a-fly-application-to-a-new-region/</link>
                <guid isPermaLink="false">66bb4ce074045df86842bf26</guid>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ deployment ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Clarence Bakosi ]]>
                </dc:creator>
                <pubDate>Thu, 18 Jul 2024 13:19:23 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/07/Cover-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Fly.io allows users to deploy their applications to virtual machines in regions where their applications are mostly used. A Fly application can also be deployed to multiple regions.</p>
<p>You may want to move your Fly application to a new region if you experience performance issues, high latency, or data residency compliance problems. Placing your application closer to your users can reduce latency and improve response time.</p>
<p>Additionally, aligning your data storage with regional compliance requirements can prevent legal issues. Overall, these changes enhance the user experience with your application.</p>
<p>This article will cover how to smoothly move a Fly application that includes a single <a target="_blank" href="https://fly.io/docs/machines/overview/">Fly Machine</a> and an attached <a target="_blank" href="https://fly.io/docs/volumes/overview/">Fly Volume</a>, from one <a target="_blank" href="https://fly.io/docs/reference/regions/">Fly region</a> to another using <a target="_blank" href="https://fly.io/docs/flyctl/">flyctl</a> commands.</p>
<h2 id="heading-prerequisites"><strong>Prerequisites</strong></h2>
<ul>
<li><a target="_blank" href="https://fly.io/dashboard">Fly.io account</a></li>
<li><code>flyctl</code> installed</li>
<li>Command line Interface (CLI)</li>
</ul>
<h2 id="heading-getting-started"><strong>Getting Started</strong></h2>
<p>To get started, you will have to verify if you already have <code>flyctl</code> installed and also get it authenticated.</p>
<h3 id="heading-how-to-verify-flyctl-installation">How to Verify <code>flyctl</code> Installation</h3>
<p>You can verify that you have <code>flyctl</code> installed using the command below. If not, use this <a target="_blank" href="https://fly.io/docs/flyctl/install/">guide</a> to install it.</p>
<pre><code class="lang-bash">fly version
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-19.43.16.png" alt="fly version" width="600" height="400" loading="lazy">
<em>Output of fly version</em></p>
<p>This shows the version you have installed.</p>
<h3 id="heading-how-to-authenticate-flyctl">How to Authenticate <code>flyctl</code></h3>
<p>Connect the terminal to your account via the CLI using:</p>
<pre><code class="lang-bash">fly auth login
</code></pre>
<p>When the browser opens up, login if you aren't already logged in and proceed to authenticate your CLI.</p>
<p>After authenticating your account, return to the CLI.</p>
<h2 id="heading-how-to-confirm-the-region-of-the-application"><strong>How to Confirm the Region of the Application</strong></h2>
<p>Navigate to the root folder of your project and run the following to determine the current region of your application:</p>
<pre><code class="lang-bash">fly status
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-19.44.26.png" alt="fly status" width="600" height="400" loading="lazy">
<em>Output of fly status</em></p>
<p>The application's current region is <code>lhr</code>, the command shows additional information about the application, including the app name, owner, hostname, image, and machine details.</p>
<h2 id="heading-how-to-verify-the-number-of-volumes-available"><strong>How to Verify the Number of Volumes Available</strong></h2>
<p>Run the following command to list all volumes:</p>
<pre><code class="lang-bash">fly volumes list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-19.45.05.png" alt="fly volumes list" width="600" height="400" loading="lazy">
<em>Output of fly volumes list</em></p>
<p>There should be only one volume that exists and it should be already attached to a machine. You can use this <a target="_blank" href="https://fly.io/docs/apps/volume-storage/#launch-a-new-app-with-a-fly-volume">guide</a> to create an application with a single machine with an attached volume.</p>
<h2 id="heading-how-to-verify-that-the-volume-is-attached-to-a-machine"><strong>How to Verify that the Volume is Attached to a Machine</strong></h2>
<p>To ensure the volume is attached to a machine, run:</p>
<pre><code class="lang-bash">fly machine list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.14.04.png" alt="fly machine list" width="600" height="400" loading="lazy">
<em>Output of fly machine list</em></p>
<p>From the output, you can determine if there is a volume attached to the machine.</p>
<h2 id="heading-list-of-fly-regions"><strong>List of Fly Regions</strong></h2>
<p>To determine the new region you want to move the Machine and volume to, use the following command to view the list of available regions:</p>
<pre><code class="lang-bash">fly platform regions
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.15.13.png" alt="fly platform regions" width="600" height="400" loading="lazy">
<em>Output of fly platform regions</em></p>
<p>For this article, the machine and volume will be moved to the <code>syd</code> region.</p>
<h2 id="heading-fork-the-available-volume-to-a-new-region"><strong>Fork the Available Volume to a New Region</strong></h2>
<p>You can create a copy of an existing volume and place it into a new region by forking it using the current volume ID to create a fork:</p>
<pre><code class="lang-bash">fly volumes fork vol_4yj0k93z118j9x14 --region syd
</code></pre>
<p>Result:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.16.00.png" alt="fly volumes fork" width="600" height="400" loading="lazy">
<em>Output of fly volumes fork</em></p>
<p>This shows information about the newly created volume.</p>
<pre><code class="lang-bash">fly volumes list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.18.52.png" alt="fly volumes list" width="600" height="400" loading="lazy">
<em>Output of fly volumes list</em></p>
<p>The current state of the new forked volume in a new region will be in a <code>hydrating</code> state for a couple of minutes before it is changed to <code>created</code>.</p>
<pre><code class="lang-bash">fly volumes list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.19.11.png" alt="fly volumes list" width="600" height="400" loading="lazy">
<em>Output of fly volumes list</em></p>
<p>The image above shows current state after <code>hydrating</code> is complete.</p>
<p>You have successfully created a new volume in another region containing data from the volume existing in the old region.</p>
<h2 id="heading-how-to-clone-the-existing-machine"><strong>How to Clone the Existing Machine</strong></h2>
<p>Fly possesses the clone feature to replicate a machine and you can make use of this by getting the ID of the existing machine.</p>
<pre><code class="lang-bash">fly machine list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.19.43.png" alt="fly machine list" width="600" height="400" loading="lazy">
<em>Output of fly machine list</em></p>
<p>After retrieving the ID of the machine, use the command below to clone the machine and attach the new volume using the same region as the newly created volume:</p>
<p>For example:</p>
<pre><code class="lang-bash">fly machine <span class="hljs-built_in">clone</span> &lt;machine id&gt; --region &lt;region code&gt; --attach-volume &lt;volume id&gt;:&lt;destination_mount_path&gt;
</code></pre>
<p>It's important to note that the <code>destination_mount_path</code> has to be a different path other than <code>/</code> which is the root directory of the application. It should be a unique path <code>/zata</code>.</p>
<pre><code class="lang-bash">fly machine <span class="hljs-built_in">clone</span> 5683977a624218 --region syd --attach-volume vol_vzkd2l6yxnk72p9v:/zata
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.20.06.png" alt="fly machine clone" width="600" height="400" loading="lazy">
<em>Output of fly machine clone</em></p>
<p>You have successfully created a clone of the existing machine and attached the forked volume.</p>
<h2 id="heading-how-to-verify-the-volume-attachment"><strong>How to Verify the Volume Attachment</strong></h2>
<p>To check if the volume has been successfully attached:</p>
<pre><code class="lang-bash">fly volumes list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.20.37.png" alt="fly volumes list" width="600" height="400" loading="lazy">
<em>Output of fly volumes list</em></p>
<p>The volume is now attached to a machine.</p>
<p>To check if the machine has been successfully attached:</p>
<pre><code class="lang-bash">fly machine list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.21.08.png" alt="fly machine list" width="600" height="400" loading="lazy">
<em>Output of fly machine list</em></p>
<p>The machine now has a volume attached.</p>
<p>You have successfully moved the machine and volume to a new region.</p>
<h2 id="heading-how-to-view-the-application-available-regions"><strong>How to View the Application Available Regions</strong></h2>
<p>Currently, the application exists in two different regions and you can view this using the following command:</p>
<pre><code class="lang-bash">fly scale show
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.21.30.png" alt="fly scale show" width="600" height="400" loading="lazy">
<em>Output of fly scale show</em></p>
<p>The application is now running in <code>lhr</code> and <code>syd</code>.</p>
<h2 id="heading-how-to-update-the-remote-flytoml"><strong>How to Update the Remote fly.toml</strong></h2>
<p>Add the new region to the <strong>fly.toml</strong> file <code>primary_region = 'syd'</code>, update the volume destination to <code>destination = '/zata'</code>, and deploy the changes.</p>
<pre><code class="lang-bash">fly deploy
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.22.37.png" alt="fly deploy" width="600" height="400" loading="lazy">
<em>Output of fly deploy</em></p>
<p>Once this is successful, the changes to the <strong>fly.toml</strong> file will be on the remote configuration.</p>
<h2 id="heading-how-to-destroy-the-old-machine"><strong>How to Destroy the Old Machine</strong></h2>
<p>You have successfully moved your machine and attached volume to a new region and since we no longer need the machine in the old region <code>lhr</code>, you will have to clean it up. The first approach is to stop the machine using the ID.</p>
<h3 id="heading-stop-the-old-machine">Stop the Old Machine</h3>
<pre><code class="lang-bash">fly machine stop &lt;old_machine_id&gt;
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.23.39.png" alt="fly machine stop" width="600" height="400" loading="lazy">
<em>Output of fly machine stop</em></p>
<p>To confirm if it was successful, use:</p>
<pre><code class="lang-bash">fly machine list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.24.11.png" alt="fly machine list" width="600" height="400" loading="lazy">
<em>Output of fly machine list</em></p>
<p>The state of the machine has been updated to <code>stopped</code></p>
<h3 id="heading-destroy-the-old-machine">Destroy the Old Machine</h3>
<pre><code class="lang-bash">fly machine destroy &lt;old_machine_id&gt;
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.24.35.png" alt="fly machine destroy" width="600" height="400" loading="lazy">
<em>Output of fly machine destroy</em></p>
<p>Run the below command to verify if the machine still exists.</p>
<pre><code class="lang-bash">fly machine list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.24.59.png" alt="fly machine list" width="600" height="400" loading="lazy">
<em>Output of fly machine list</em></p>
<p>The machine in the old region has been successfully deleted.</p>
<h2 id="heading-how-to-destroy-the-unattached-volume"><strong>How to Destroy the Unattached Volume</strong></h2>
<p>After successfully destroying the Machine, the volume attached to it is now unattached and can also be destroyed.</p>
<pre><code class="lang-bash">fly volumes list
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.25.24.png" alt="fly volumes list" width="600" height="400" loading="lazy">
<em>Output of fly volumes list</em></p>
<p>Use the ID of the unattached volume and run the below command:</p>
<pre><code class="lang-bash">fly volumes destroy &lt;old_volume_id&gt;
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.26.04.png" alt="fly volumes destroy" width="600" height="400" loading="lazy">
<em>Output of fly volumes destroy</em></p>
<p>The unattached volume has now been destroyed.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/07/Screenshot-2024-07-15-at-20.26.27.png" alt="fly volumes list" width="600" height="400" loading="lazy">
<em>Output of fly volumes list</em></p>
<p>Only one volume exists and is attached to a machine in the new region.</p>
<h2 id="heading-how-to-check-the-state-of-the-instance"><strong>How to Check the State of the Instance</strong></h2>
<p>Check the logs to see the state of the instance:</p>
<pre><code class="lang-bash">fly logs
</code></pre>
<p>The logs show the application is running without any issues.</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Moving a Fly.io application to a new region involves forking the existing volume, cloning the existing machine with the forked volume to a new region, updating <strong>fly.toml</strong>, deploying the changes, and removing the old machine and volume. </p>
<p>Following these guidelines ensures a smooth and successful transition with minimal disruption.</p>
<p> If you have any questions you can always find me on <a target="_blank" href="https://x.com/X8inez">X (formerly Twitter)</a></p>
<h2 id="heading-resources"><strong>Resources</strong>:</h2>
<ul>
<li><a target="_blank" href="https://fly.io/docs">Fly Docs</a></li>
<li><a target="_blank" href="https://fly.io/docs/flyctl">Flyctl</a></li>
<li><a target="_blank" href="https://fly.io/docs/machines/overview/">Fly Machines</a></li>
<li><a target="_blank" href="https://fly.io/docs/volumes/overview/">Fly Volumes</a></li>
<li><a target="_blank" href="https://fly.io/docs/reference/regions/">Fly regions</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Migrate Your Local Data to MongoDB Atlas ]]>
                </title>
                <description>
                    <![CDATA[ Data forms the bedrock of our daily lives, as a lot of day-to-day decision-making is hinged on its existence. Just like energy, data can be transformed from one medium to another. So far, web development has become much more advanced, and data migrat... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/mongodb-data-migration/</link>
                <guid isPermaLink="false">66bb58cc0da5b03e481107d8</guid>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ MongoDB ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Oluwatobi ]]>
                </dc:creator>
                <pubDate>Mon, 18 Mar 2024 14:40:31 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/03/mongoCloud.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Data forms the bedrock of our daily lives, as a lot of day-to-day decision-making is hinged on its existence. Just like energy, data can be transformed from one medium to another.</p>
<p>So far, web development has become much more advanced, and data migration and backup is an essential skill every web developer should have to help ensure continuity of data and preserve user information regardless of any circumstances.</p>
<p>For developers like me who prefer to test all their code features locally in a development environment before final deployment to the cloud, this tutorial would come in handy for you when faced with the challenge of migrating your locally stored MongoDB data to a cloud platform or any other platform.</p>
<p>The inspiration for this article is a result of the need for me to migrate the total JSON data on my local MongoDB Compass server to the cloud (MongoDB Atlas) for an ongoing project. I waded through the endless internet resources and documentation but couldn’t get a suitable, straightforward fix. With multiple trials and errors, I was able to succeed with the migration. This article should serve as the definitive guide you need to save you time and achieve fast results.</p>
<p>In this article, we'll delve into data management in MongoDB, data backup, and efficient data migration tools that ease up the entire process. This article is suited for people with intermediate to advanced knowledge of MongoDB and backend development. </p>
<p>If you have any difficulty with the terminologies used in this article, I would suggest studying the MongoDB documentation <a target="_blank" href="https://www.mongodb.com/docs/">here</a>. </p>
<p>Let’s begin.</p>
<h2 id="heading-introduction-to-mongodb">Introduction to MongoDB</h2>
<p>MongoDB is a non-relational NoSQL-based database that stores data via the document model in a JSON format. It’s quite popular, and ranks top among the most used databases worldwide.</p>
<p>It's also more code-friendly as it's currently the default database used by many JavaScript-based full stack and backend developers.</p>
<p>It has various database options, comprising both local database servers and a cloud-based Database-As-A-Platform. </p>
<p>A good example of this is the MongoDB Atlas. MongoDB Atlas is a flexible and scalable MongoDB implementation with strong cloud security.</p>
<p>It provides indexing, load balancing, and sharding, among other features. More information regarding it can be found <a target="_blank" href="https://www.mongodb.com/features">here</a>.</p>
<h2 id="heading-how-to-initialize-the-mongodb-server">How to Initialize the MongoDB Server</h2>
<p>You should have the MongoDB local server already installed. However, if you haven’t installed it, it can be downloaded <a target="_blank" href="https://www.mongodb.com/try/download/community">here</a>.</p>
<p>The MongoDB server can then be easily executable by adding its path to the environmental variables on Windows.</p>
<p>To initialize the MongoDB application, activate the command prompt and type in<br><code>Mongod</code></p>
<p><img src="https://hackmd.io/_uploads/r1aAf6gCp.jpg" alt="Mongo DB server running" width="600" height="400" loading="lazy">
<em>MongoDb server running</em></p>
<p>To explore the databases on the MongoDB server, open the MongoDB command shell and type <code>show dbs</code>  </p>
<p><img src="https://hackmd.io/_uploads/rJY2G6eC6.jpg" alt="The databases in my mongodb server" width="600" height="400" loading="lazy">
<em>The databses on the MongoDB server</em></p>
<p>This displays all the databases on the MongoDB server.</p>
<p>With this, let's go on to migrate one of these databases to the cloud.</p>
<h2 id="heading-how-to-back-up-data">How to Back Up Data</h2>
<p>To efficiently upload the database collections to the cloud, they must first be backed up.</p>
<p>To back up your database, you'll have to install an additional tool. Navigate back to the MongoDB downloads site and download the MongoDB database administration <a target="_blank" href="https://www.mongodb.com/try/download/database-tools">tools</a>.</p>
<p>This package contains a lot of database tools, such as <code>MongoExport</code>, <code>MongoImport</code>, <code>MongoDump</code>, and <code>MongoRestore</code>. </p>
<p>The above settings are applicable for users who have a version of MongoDB above version 4.4. MongoDB decided to release it as a stand-alone tool. For users whose version is less than version 4.4, these tools can be pre-installed in the MongoDB package.</p>
<p>Now, let's go on to the two major tools that would help facilitate the migration process: <code>MongoDump</code> and <code>MongoRestore</code>.</p>
<p>When <code>MongoDump</code> is executed on a database, it helps to create a backup database file in a binary-encoded JSON format (BSON). While the <code>MongoRestore</code> helps to return the backed-up database to MongoDB for usage.</p>
<p>Moving on, ensure that their package path is included in the environmental variables so as to guarantee efficient execution.</p>
<p>In order to back up a local database, open the MongoDB shell and then enter this command:</p>
<pre><code>Mongodump --db={TheNameOFYourDB} --collection={TheNameOfYourCollection} –out={The name <span class="hljs-keyword">of</span> the folder the backed up <span class="hljs-built_in">JSON</span> files would be located}
</code></pre><p>With this execution, you have successfully backed up your local MongoDB database.</p>
<h2 id="heading-how-to-set-up-a-mongodb-atlas">How to Set Up a MongoDB Atlas</h2>
<p>MongoDB Atlas is MongoDB cloud Database-As-A-Service cloud option accessible to its users at all times with little to no disruption.</p>
<p>Also, for most production apps that utilize the power of MongoDB on the server as a database tool, the easiest and most convenient provider of this solution is the MongoDB Atlas.</p>
<p>Hence, it is our choice to back up our MongoDB data to the cloud. I would assume you already have a MongoDB Atlas account, but you can still create one and then create a database that would serve as the recipient of the local database.</p>
<p>To set the account up, kindly navigate to the Atlas home page <a target="_blank" href="https://www.mongodb.com/atlas/database">here</a>. Create an account and you'll be directed to a dashboard where you can create new databases.  </p>
<p><img src="https://hackmd.io/_uploads/S15QNeGAp.jpg" alt="atllas" width="600" height="400" loading="lazy">
<em>MongoDb Atlas home page</em></p>
<p>You can, however, name it with any name you want. To complete the upload of the local MongoDB data to the cloud, navigate to the settings tab on the MongoDB Atlas database and click on the migrate data option. With this successfully done, let's now go on to complete the migration process.</p>
<h2 id="heading-how-to-migrate-your-data-to-the-cloud">How to Migrate Your Data to the Cloud</h2>
<p>To migrate your backed-up database to the cloud, <code>MongoImport</code> and <code>MongoExport</code> will be invoked.</p>
<p>In the command prompt, paste the migration code copied from the Atlas, and then execute it on the command prompt. With that, you should see a success text.</p>
<p>You can then check and refresh your cloud database to see the new files that have been uploaded there. Thereafter, you can connect the new cloud database to your backend application and run it successfully to get the same results on your local computer.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>With this, we have come to the end of the tutorial. We hope you’ve learned about data management and migration in MongoDB, tools involved and all its intricacies. </p>
<p>Feel free to drop comments and questions, and also check out my other articles <a target="_blank" href="https://www.freecodecamp.org/news/author/oluwatobi/">here</a>. Till next time, keep on coding!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ AWS Cloud Practitioner Salary – Amazon Certification Guide ]]>
                </title>
                <description>
                    <![CDATA[ More and more companies are making a shift towards cloud services and cloud-based systems these days, resulting in cloud computing being one of the most in-demand tech skills. AWS is currently the most popular cloud service provider, as it owns aroun... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/aws-cloud-practitioner-salary-2023-amazon-certification-guide/</link>
                <guid isPermaLink="false">66b1e3c66f537a6f7e7212bb</guid>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Cloud Services ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Dionysia Lemonaki ]]>
                </dc:creator>
                <pubDate>Wed, 03 May 2023 06:51:34 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/04/ethan-yrGn-av5WF8-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>More and more companies are making a shift towards cloud services and cloud-based systems these days, resulting in cloud computing being one of the most in-demand tech skills.</p>
<p>AWS is currently the most popular cloud service provider, as it owns around 33% of the cloud market.</p>
<p>Companies and organizations are looking for candidates with AWS skills. A way to showcase your AWS knowledge is by obtaining an AWS certification.</p>
<p>In this article, I will list the current AWS certifications and go into more detail about the Cloud Practitioner certification.</p>
<p>Let's get into it!</p>
<h2 id="heading-what-is-aws-amazon-web-services-explained">What Is AWS? Amazon Web Services Explained</h2>
<p>Amazon Web Services (or AWS for short) is a cloud computing platform offered by Amazon.</p>
<p>The platform provides on-demand cloud computing services such as hosting for servers, storage, database management, networking, and security, to name just a few of them.</p>
<p>Many businesses use AWS, including big companies such as Airbnb, Netflix, LinkedIn, and Twitter. With that said, it is also used for personal projects.</p>
<h2 id="heading-what-is-an-aws-certification">What Is an AWS Certification?</h2>
<p>An AWS certification is a credible way to demonstrate to an employer that you have the specific technical skills and competence to design, build, deploy, migrate, operate, and maintain well-architected AWS systems.</p>
<p>Obtaining an AWS certification and gaining cloud architecture expertise is a great way to kickstart a new career in tech and open doors in a fast-growing industry.</p>
<h2 id="heading-an-overview-of-the-different-aws-certification-types-levels-of-aws-certifications">An Overview of the Different AWS Certification Types – Levels of AWS Certifications</h2>
<p>Currently, there are four types of AWS certifications.</p>
<p>There is one <strong>foundational</strong> level certification – the <a target="_blank" href="https://aws.amazon.com/certification/certified-cloud-practitioner/?ch=sec&amp;sec=rmg&amp;d=1">Cloud Practitioner</a> certification.</p>
<p>There are three <strong>associate</strong> level certifications – the <a target="_blank" href="https://aws.amazon.com/certification/certified-solutions-architect-associate/?ch=sec&amp;sec=rmg&amp;d=1">Solutions Architect</a>, the <a target="_blank" href="https://aws.amazon.com/certification/certified-developer-associate/?ch=sec&amp;sec=rmg&amp;d=1">Developer</a> and the <a target="_blank" href="https://aws.amazon.com/certification/certified-sysops-admin-associate/?ch=sec&amp;sec=rmg&amp;d=1">SysOps Administrator</a> certifications.</p>
<p>There are also two <strong>professional</strong> level certifications – the <a target="_blank" href="https://aws.amazon.com/certification/certified-solutions-architect-professional/?ch=sec&amp;sec=rmg&amp;d=1">Solutions Architect</a> and <a target="_blank" href="https://aws.amazon.com/certification/certified-devops-engineer-professional/?ch=sec&amp;sec=rmg&amp;d=1">DevOps Engineer</a> certifications.</p>
<p>And lastly, there are six <strong>specialty</strong> level certifications – the <a target="_blank" href="https://aws.amazon.com/certification/certified-advanced-networking-specialty/?ch=sec&amp;sec=rmg&amp;d=1">Advanced Networking</a>, <a target="_blank" href="https://aws.amazon.com/certification/certified-data-analytics-specialty/?ch=sec&amp;sec=rmg&amp;d=1">Data Analytics</a>, <a target="_blank" href="https://aws.amazon.com/certification/certified-database-specialty/?ch=sec&amp;sec=rmg&amp;d=1">Database</a>, <a target="_blank" href="https://aws.amazon.com/certification/certified-machine-learning-specialty/?ch=sec&amp;sec=rmg&amp;d=1">Machine Learning</a>, <a target="_blank" href="https://aws.amazon.com/certification/certified-security-specialty/?ch=sec&amp;sec=rmg&amp;d=1">Security</a> and <a target="_blank" href="https://aws.amazon.com/certification/certified-sap-on-aws-specialty/?ch=sec&amp;sec=rmg&amp;d=1">SAP on AWS</a> certifications.</p>
<p>Choosing an AWS certification will depend on your experience level, professional goals, and interests.</p>
<p>Now, let's go into more detail on the fundamental AWS certification – the Cloud Practitioner certification.</p>
<h2 id="heading-what-does-an-aws-cloud-practitioner-do">What Does an AWS Cloud Practitioner Do?</h2>
<p>An AWS cloud practitioner is responsible for the organization's cloud computing architecture. They resolve scalability challenges and handle high-risk issues.</p>
<p>The practitioner understands AWS's core design principles and best practices for architecture.</p>
<p>They know how to design, build, deploy, and monitor applications on the cloud within AWS platforms.</p>
<p>They gather insights into end-users' problems and pain points, leverage software and hardware systems to address those problems, and come up with solutions.</p>
<h2 id="heading-what-is-the-average-salary-for-an-aws-cloud-practitioner">What Is the Average Salary for an AWS Cloud Practitioner?</h2>
<p>According to data from Glassdoor, the estimated total pay for a cloud practitioner in the USA for 2023 is around $91,038 per year, with an average salary of $83,679 per year.</p>
<p>With that said, compensation is relative and will depend on your field and chosen industry, demand, previous experience, skills, and location. The average salary for a cloud practitioner may be higher in different regions in the USA and lower in other countries.</p>
<h2 id="heading-aws-cloud-practitioner-certification-prerequisites">AWS Cloud Practitioner Certification Prerequisites</h2>
<p>The AWS Cloud Practitioner certification is a great place to start your cloud computing learning journey and a new career in the cloud.</p>
<p>It is an entry-level certification intended to provide fundamental knowledge and a general overview of AWS and its infrastructure. It doesn't require any previous experience or specific prerequisites.</p>
<p>With that said, having an understanding of the AWS platform and cloud computing terminology and concepts can be helpful during your learning process.</p>
<p>To understand the core concepts of cloud computing and AWS, you can read through the <a target="_blank" href="https://aws.amazon.com/getting-started/cloud-essentials/">AWS Cloud Essentials Guide</a> by AWS.</p>
<h2 id="heading-aws-cloud-practitioner-certification-curriculum">AWS Cloud Practitioner Certification Curriculum</h2>
<p>The four major topics you will learn while studying for the AWS Cloud Practitioner certification fall into the following categories:</p>
<ul>
<li><p><strong>Cloud concepts</strong> (26%), such as learning about cloud computing topics, how cloud-based applications work and scale, the AWS core infrastructure, and its architectural principles.</p>
</li>
<li><p><strong>Security and compliance</strong> (25%), such as learning security and compliance best practices for the AWS platform.</p>
</li>
<li><p><strong>Technology</strong> (33%), such as learning about AWS services and tools and their use cases.</p>
</li>
<li><p><strong>Billing and pricing</strong> (16%), such as learning about AWS billing, pricing models, support, and account management.</p>
</li>
</ul>
<p>To learn more about the curriculum, AWS provides a <a target="_blank" href="https://d1.awsstatic.com/training-and-certification/docs-cloud-practitioner/AWS-Certified-Cloud-Practitioner_Exam-Guide.pdf">complete exam guide</a>, which covers the key modules in detail.</p>
<h2 id="heading-aws-cloud-practitioner-certification-study-materials">AWS Cloud Practitioner Certification Study Materials</h2>
<p>You first need to create an <a target="_blank" href="https://aws.amazon.com/resources/create-account/">AWS account</a>.</p>
<p>AWS provides a <a target="_blank" href="https://aws.amazon.com/free/?all-free-tier&amp;all-free-tier.sort-by=item.additionalFields.SortRank&amp;all-free-tier.sort-order=asc&amp;awsf.Free%20Tier%20Types=*all&amp;awsf.Free%20Tier%20Categories=*all">free 12-month subscription</a> to become familiar with the AWS console and its services.</p>
<p>When it comes to courses, you can use the <a target="_blank" href="https://aws.amazon.com/training/learn-about/cloud-practitioner/">AWS cloud essentials learning plan</a> built by AWS, which goes over the recommended curriculum. This course covers AWS cloud, services, pricing, and security.</p>
<p>freeCodeCamp also offers an extensive <a target="_blank" href="https://www.freecodecamp.org/news/aws-certified-cloud-practitioner-certification-study-course-pass-the-exam/">13-hour study course</a>.</p>
<p>It's also a good idea to go through some <a target="_blank" href="https://d1.awsstatic.com/training-and-certification/docs-cloud-practitioner/AWS-Certified-Cloud-Practitioner_Sample-Questions.pdf">practice questions</a> and <a target="_blank" href="https://aws.amazon.com/certification/certification-prep/">practice exams</a> by the official page on Amazon to test whether you are prepared enough for the certification exam.</p>
<h2 id="heading-aws-cloud-practitioner-certification-exam-details">AWS Cloud Practitioner Certification Exam Details</h2>
<p>Once you've created your AWS certification account, to schedule the AWS Cloud Practitioner exam, sign in to <a target="_blank" href="https://www.aws.training/">aws.training</a> and click "Certification", where you can register and schedule the exam online or at a location near you.</p>
<p>The exam level is foundational, and the exam code is CLF-C01.</p>
<p>The exam costs $100 and is available in English, French, German, Indonesian, Italian, Japanese, Korean, Portuguese, Simplified Chinese, Spanish, and Traditional Chinese.</p>
<p>The exam is 90 minutes long and consists of 65 multiple-choice, multiple-response questions. The minimum passing score is 700 points.</p>
<p>Lastly, the AWS certifications are valid for three years, and you will need to renew them once they expire.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Hopefully, you found this article helpful and have a better understanding of what the AWS Cloud Practitioner certification entails.</p>
<p>Thank you for reading, and best of luck on your exam.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
