<?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" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sai Manasa on Medium]]></title>
        <description><![CDATA[Stories by Sai Manasa on Medium]]></description>
        <link>https://medium.com/@saimanasak?source=rss-58cca66b39b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nRXW8D-90wQ0xIQqkXRxUQ@2x.jpeg</url>
            <title>Stories by Sai Manasa on Medium</title>
            <link>https://medium.com/@saimanasak?source=rss-58cca66b39b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:58:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saimanasak/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ Amazon Bedrock: Building a Simple Blog Summarizer ]]></title>
            <link>https://medium.com/@saimanasak/amazon-bedrock-building-a-simple-blog-summarizer-cddcc9fd672f?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cddcc9fd672f</guid>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[amazon-bedrock]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Wed, 17 Jun 2026 02:46:46 GMT</pubDate>
            <atom:updated>2026-06-17T02:46:46.403Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; A hands-on introduction to Amazon Bedrock using Lambda, API Gateway, CDK, and GitHub Actions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*tzzhmALgbUFnNIHoMU8ICg.gif" /><figcaption>Amazon Bedrock: Building a Simple Blog Summarizer by Sai Manasa</figcaption></figure><p>Hello World…when learning a new service, I always like to start with something small and practical before diving into more advanced concepts. Amazon Bedrock is no different. In this blog, we’ll build a simple Blog Summarizer using Amazon Bedrock and Amazon Nova Lite. The application accepts an article as input and generates key points, a five-bullet summary, and a conclusion. Along the way, we’ll also use AWS Lambda, API Gateway, CDK, and GitHub Actions to automate the deployment process. It’s a beginner-friendly project that provides a hands-on introduction to building Generative AI applications on AWS. Let’s get started! 🚀</p><h4>Table of Contents</h4><ul><li>Overview</li><li>Solution Architecture</li><li>Why Amazon Bedrock?</li><li>Flow</li><li>Project Structure</li><li>Step-by-step Implementation</li></ul><h4>Overview</h4><p>In this project, we’ll build a simple <strong>Blog Summarizer</strong> using <strong>Amazon Bedrock</strong> and <strong>Amazon Nova Lite</strong>. The application accepts a blog article as input and generates:</p><ul><li>Key points from the article</li><li>A five-bullet summary</li><li>A concise conclusion</li></ul><p>To make the application more practical, we’ll also expose it through an <strong>HTTP API Gateway</strong>, use <strong>AWS Lambda</strong> to invoke the Bedrock model, define the infrastructure using <strong>AWS CDK</strong>, and automate deployments using <strong>GitHub Actions.</strong></p><h4>Why Amazon Bedrock?</h4><ul><li>Amazon Bedrock allows developers to build Generative AI applications without managing underlying infrastructure.</li><li>It provides access to multiple foundation models through a unified API.</li><li>Benefits:<br>Fully managed service<br>No GPU management<br>Serverless experience<br>Supports multiple model providers<br>Easy integration with AWS services</li></ul><h4>Flow:</h4><pre>Git Push<br> ↓<br>GitHub Actions<br> ↓<br>CDK Deploy<br> ↓<br>API Gateway<br> ↓<br>Lambda<br> ↓<br>Amazon Bedrock (Nova Lite)<br> ↓<br>Structured JSON Response</pre><h4>Project Structure</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*6XwzEr7IGplKQ-73HsWacw.png" /></figure><p>This separation keeps infrastructure and application code independent.</p><h4>Step-by-Step Implementation</h4><h4>Step 1: Create the Repository Structure</h4><p>First, create a repository to organize all Amazon Bedrock projects.</p><pre>amazon-bedrock/<br>│<br>├── .github/<br>│   └── workflows/<br>│<br>└── 01-blog-summarizer/<br>    ├── infra/<br>    └── lambda/</pre><p>This structure separates:</p><ul><li>Infrastructure code (CDK)</li><li>Application code (Lambda)</li><li>CI/CD workflows (GitHub Actions)</li></ul><h4>Step 2: Initialize the CDK Application</h4><p>Navigate to the infra folder.</p><pre>cd 01-blog-summarizer/infra</pre><p>Initialize CDK.</p><pre>cdk init app --language python</pre><p>Install dependencies.</p><pre>pip install -r requirements.txt</pre><p>Bootstrap CDK.</p><pre>cdk bootstrap</pre><p>This prepares your AWS env for CDK deployments.</p><h4>Step 3: Create the Lambda Function</h4><ul><li><strong><em>Repository:</em></strong></li></ul><p><a href="https://github.com/saimanasak/amazon-bedrock">GitHub - saimanasak/amazon-bedrock: amazon-bedrock | aws generative-ai | genai | llm | rag bedrock-agents | prompt-engineering | aws-lambda | aws-cdk | github-actions | python</a></p><ul><li>Create a folder for Lambda code.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4c54cec9d4134508bcb9a41faea5ef6/href">https://medium.com/media/d4c54cec9d4134508bcb9a41faea5ef6/href</a></iframe><h4>Step 4: Define Infrastructure Using CDK</h4><p><strong>Stack:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d6a39fac2937439d8a951a6b169d7b6/href">https://medium.com/media/7d6a39fac2937439d8a951a6b169d7b6/href</a></iframe><p><strong>app.py:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/740032302ea9976791a462e29b6ae7e8/href">https://medium.com/media/740032302ea9976791a462e29b6ae7e8/href</a></iframe><h4>Step 5: Configure GitHub Actions</h4><p>Create a workflow file.</p><pre>.github/workflows/01-blog-summarizer.yaml</pre><p>The pipeline performs:</p><ul><li>Checkout code</li><li>Install dependencies</li><li>Configure AWS credentials</li><li>Run CDK Synth</li><li>Run CDK Deploy</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e5b005831b91570f230f5e84a3b816e/href">https://medium.com/media/0e5b005831b91570f230f5e84a3b816e/href</a></iframe><p>Every push to the repository automatically deploys the infrastructure.</p><h4>Step 6: Test the Application</h4><p>Send a POST request.</p><pre>POST /summarize</pre><p>Request body:</p><pre>{<br>    &quot;article&quot;: &quot;Kubernetes is an open-source container orchestration platform...&quot;<br>}</pre><p>Sample response:</p><pre>{<br>    &quot;key_points&quot;: [<br>        &quot;...&quot;,<br>        &quot;...&quot;<br>    ],<br>    &quot;five_bullet_summary&quot;: [<br>        &quot;...&quot;,<br>        &quot;...&quot;,<br>        &quot;...&quot;,<br>        &quot;...&quot;,<br>        &quot;...&quot;<br>    ],<br>    &quot;conclusion&quot;: &quot;...&quot;<br>}</pre><p>The application successfully generates a structured summary using Amazon Bedrock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sC3gHLaAgcGDP5bxpURJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8EG90acg1KExZLtAK73W5w.png" /></figure><h4>Let’s Connect</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><p>Happy Learning :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cddcc9fd672f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ From Disk to API — Part 2: How Linux Controls Access ]]></title>
            <link>https://medium.com/@saimanasak/from-disk-to-api-part-2-how-linux-controls-access-c40e1d8d018c?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c40e1d8d018c</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[permission]]></category>
            <category><![CDATA[acces]]></category>
            <category><![CDATA[filesystem]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 02:21:10 GMT</pubDate>
            <atom:updated>2026-04-07T02:21:10.144Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; Understanding users, groups, and permissions — and how Linux decides who can read, write, or execute data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*6YMxFYjRPpgeiFWwfmlhCg.gif" /><figcaption>How Linux Controls Access by Sai Manasa</figcaption></figure><p>Hello World… Welcome back! In the previous part, we explored how Linux stores data — from directories and files to inodes and data blocks. We built a clear understanding of <strong>where data lives</strong> in a Linux system.</p><p><a href="https://saimanasak.medium.com/from-disk-to-api-part-1-how-linux-stores-data-d68ac9a4e42a">💾 From Disk to API - Part 1: How Linux Stores Data 🔗</a></p><p>But storing data is only half the story. The next critical question is:</p><p><strong>Who is allowed to access this data?</strong></p><p>In real-world systems, not every user or application should have access to every file. Linux solves this using a powerful permission model that controls <strong>who can read, write, or execute a file</strong>.</p><p>In this blog, we’ll explore how Linux manages access using <strong>users, groups, and permissions</strong>, and understand how these controls directly impact applications and APIs. This is especially important in DevOps, where many failures — like “permission denied” errors — are not application issues, but access control problems.</p><p>Let’s dive in and understand how Linux decides <strong>who gets access and who doesn’t</strong>… 🔐</p><h4>Overview:</h4><ul><li>How Linux permissions work (rwx model)</li><li>Users, groups, and ownership</li><li>Managing permissions using chmod and chown</li><li>Hands-on examples to understand access control</li></ul><h4>Understanding Linux Permissions (rwx Model)</h4><ul><li>Every file and directory in Linux has an answer to a simple question: <em>who can do what?</em></li><li>The permission system is how Linux enforces that answer.</li><li>It’s one of the most important concepts for anyone working with Linux -whether you’re a curious beginner or a developer securing a production server.</li><li><strong>r → read <br>w → write<br>x → execute</strong></li></ul><pre>| Permission      | Meaning                   |<br>| --------------- | ------------------------- |<br>| r (read)        | View file contents        |<br>| w (write)       | Modify or delete the file |<br>| x (execute)     | Run the file as a program |</pre><ul><li>How permissions are represented? <br>When you run the command:</li></ul><pre># command to show a long listing format of files and directories<br>ls -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*A4GUyQAWtEtkPwIZTsXRQA.png" /></figure><ul><li>Breakdown of the output:</li></ul><pre><strong>-rw-r--r--. 1 ec2-user ec2-user 0 Apr  7 00:58 sample.txt</strong><br><br>sample.txt is an empty file owned by ec2-user,<br>the owner can read &amp; write, everyone else can only read,<br>and it was last modified on April 7 at 12:58 AM.</pre><ol><li><strong>-rw-r — r — . → File Type + Permissions</strong></li></ol><p>First character: Gives info about the type of file<br>- refers to file <br>d refers to directory</p><p>Next 9 characters: Info about the permissions<br>This is split into 3 parts.</p><pre>  rw-          r--          r--<br>(Owner)     (Group)      (Others)</pre><p>Final dot: <br>. indicates <strong>extended attributes / SELinux context</strong> is present (common on systems like Amazon Linux)</p><p>2. <strong>1 → Number of Links</strong></p><ul><li>This file has <strong>1 hard link</strong></li><li>Means only one filename points to this file</li></ul><p>3. <strong>ec2-user → Owner</strong></p><ul><li>This file is owned by ec2-user</li></ul><p>4. <strong>ec2-user → Group</strong></p><ul><li>This file belongs to the group ec2-user</li></ul><p>5. <strong>0 → File Size</strong></p><ul><li>Size is <strong>0 bytes</strong></li><li>This means the file is <strong>empty</strong></li></ul><p>6. <strong>Apr 7 00:58 → Last Modified Time</strong></p><ul><li>Last changed on:<br>Month: April<br>Day: 7<br>Time: 00:58 (12:58 AM)</li></ul><p>7. <strong>sample.txt → File name</strong></p><ul><li>The name of the file</li></ul><h4>Users, Groups, and Ownership</h4><ul><li>Permissions alone don’t decide access — they always work together with:</li><li>User (Owner) + Group + Others</li><li>Every file and directory in Linux has an <strong>owner</strong> and an associated <strong>group</strong>.</li></ul><p><strong>User (Owner)</strong></p><ul><li>The user who created the file</li><li>Has primary control over it</li><li>Gets the <strong>first set of permissions</strong></li></ul><pre>rwx------<br><br>Here, Owner has full access</pre><p><strong>Group</strong></p><ul><li>A collection of users</li><li>Used to share access between multiple users</li><li>Gets the <strong>second set of permissions</strong></li></ul><pre>---rwx---<br><br>Here, Group members can access the file</pre><p><strong>Others</strong></p><ul><li>Everyone else on the system</li><li>Gets the <strong>last set of permissions</strong></li></ul><pre>------r--<br><br>Here, Others has only read access</pre><p>How it all connects:</p><pre>User (Owner) → First 3 bits (rwx)<br>Group        → Next 3 bits<br>Others       → Last 3 bits</pre><h4>Permission Representation (Numeric / Octal Mode)</h4><ul><li>In real-world usage, permissions are often set using <strong>numbers</strong>.</li><li>This is called the <strong>numeric (octal) representation</strong>.</li><li>Each permission has a value:</li></ul><pre>| Permission  | Value |<br>| ----------- | ----- |<br>| Read (r)    | 4     |<br>| Write (w)   | 2     |<br>| Execute (x) | 1     |</pre><ul><li>Permissions are calculated by adding values:</li></ul><pre>| Combination | Value         |<br>| ----------- | ------------- |<br>| r--         | 4             |<br>| rw-         | 6 (4 + 2)     |<br>| rwx         | 7 (4 + 2 + 1) |<br>| r-x         | 5 (4 + 1)     |</pre><ul><li>Example:</li></ul><pre>-rwxr-xr--<br><br>rwx   r-x   r--<br> 7     5     4<br><br>Final numeric form: 754<br><br>[Owner][Group][Others]<br>   7       5       4</pre><h4>Managing Permissions</h4><ul><li>Understanding permissions is important - but in real-world scenarios, we’ll often need to <strong>modify and control them</strong>.</li><li>Linux provides the <strong>chmod</strong> command to change permissions in two ways:</li><li><strong>Symbolic mode</strong> (human-readable)<br><strong>Numeric (octal) mode</strong> (number-based)</li></ul><p><strong>1. Symbolic Mode</strong></p><p>Symbolic mode is more intuitive and readable. It uses:</p><ul><li>u → user (owner)</li><li>g → group</li><li>o → others</li><li>a → all</li></ul><p>And operators:</p><ul><li>+ → add permission</li><li>- → remove permission</li><li>= → set exact permission</li></ul><p>Examples:</p><pre># Add execute permission to owner<br>chmod u+x file.txt<br><br># Remove write permission from group<br>chmod g-w file.txt<br><br># Give read permission to everyone<br>chmod a+r file.txt<br><br># chmod a+r file.txt<br>chmod u=rwx,g=rx,o=r file.txt</pre><p><strong>2. Numeric (Octal) Mode</strong></p><p>Numeric mode is faster and commonly used in scripts and automation.</p><p>Each permission is represented as:</p><ul><li>Read = 4</li><li>Write = 2</li><li>Execute = 1</li></ul><p>Example:</p><pre># Owner → full access<br># Group &amp; Others → read + execute<br><br>chmod 755 script.sh</pre><h4>Hands-On: Managing Permissions</h4><p><strong>Step 1:</strong> Create a File</p><pre>touch sample.txt<br>ls -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*k05KhnE6cA6I4Ksks-9o3g.png" /></figure><p><strong>Step 2:</strong> Remove Permissions</p><pre>chmod 000 sample.txt<br>ls -l<br>cat sample.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*SLSFYeB_8Q5R-9JlB_cEew.png" /></figure><p><strong>Step 3:</strong> Restore Permissions</p><pre>chmod 644 sample.txt<br>ls -l<br>cat sample.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*uAE14InMsLmc7G-_4Ikgxw.png" /></figure><ul><li><em>Linux doesn’t care who you are — it checks permissions first. If the rules don’t allow access, the operation fails.</em></li><li>Common patterns:</li></ul><pre>| Use Case     | Permission |<br>| ------------ | ---------- |<br>| Config files | 600        |<br>| Scripts      | 755        |<br>| Public files | 644        |</pre><h4>Managing Ownership</h4><ul><li>In Linux, permissions alone are not enough — every file also has an <strong>owner (user)</strong> and a <strong>group</strong>.</li><li>The <strong>chown</strong> command is used to change this ownership.</li><li>Even if permissions look correct, access can fail if → the file belongs to a different user</li><li>Example:<br>File owned by root<br>Application runs as ec2-user<br>Result → Permission denied</li><li>Basic Syntax:</li></ul><pre>chown user file.txt</pre><pre># command to update both ownership values in a single command<br><br>sudo chown user:group /path/to/file</pre><h4>Hands-On: Managing Ownership</h4><p><strong>Step 1: </strong>Check Current Ownership</p><pre>ls -l sample.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*FJ5VoHqXg0tKpQCHz078NA.png" /></figure><ul><li>Here, ec2-user is the owner of the file sample.txt</li></ul><p><strong>Step 2:</strong> Change Ownership</p><pre>sudo chown root sample.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*1tMhwYTKcAAc69OIay0r-w.png" /></figure><ul><li>Changing the owner to root.</li><li>chown usually requires <strong>sudo/root access</strong></li></ul><p><strong>Step 3:</strong> Verify</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*aVmgN5WeuKj-qVG2oh-ifQ.png" /></figure><ul><li>Permissions define access, but ownership decides who those permissions apply to - both must align for systems to work correctly.</li></ul><h4>Flow:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*UuMe6oql-ALM0AffFFhMYA.png" /></figure><h4>Conclusion:</h4><ul><li>Linux permissions are not just a security feature — they are fundamental to how systems operate.</li><li>From controlling who can read a file to ensuring applications can access the resources they need, permissions play a critical role in both system stability and security.</li><li>Understanding how rwx, ownership, and commands like chmod and chown work together allows you to confidently debug issues and design systems that behave correctly in real-world environments.</li></ul><p><strong><em>Now that we know where data lives and who can access it, the final step is understanding how Linux actually serves that data to applications</em></strong></p><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><p>Happy Learning 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c40e1d8d018c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ From Disk to API — Part 1: How Linux Stores Data ]]></title>
            <link>https://medium.com/@saimanasak/from-disk-to-api-part-1-how-linux-stores-data-d68ac9a4e42a?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d68ac9a4e42a</guid>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[linux-file-system]]></category>
            <category><![CDATA[inode-linux]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Mon, 30 Mar 2026 03:17:57 GMT</pubDate>
            <atom:updated>2026-03-30T03:17:57.559Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; Basic u<em>nderstanding of filesystems, inodes, and directory structure and how data is actually stored in Linux systems</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*9jSB52T-sIDYb2vDg5uhPg.gif" /><figcaption>How Linux Stores Data by Sai Manasa</figcaption></figure><p>Hello World… In most tutorials, we focus on building APIs, deploying applications, and scaling systems. But there’s one fundamental question that often gets overlooked - <strong>where does all this data actually live, and how does Linux manage it behind the scenes?</strong></p><p>This blog is the <strong>first part of a series</strong> where we break down how Linux handles data end-to-end — from how it is stored, to how access is controlled, and finally how it is served to applications and APIs.</p><p>In this part, we’ll focus on the foundation: <strong>how Linux stores data</strong>. What looks like a simple file to us is actually a structured system involving inodes, data blocks, and a well-defined directory hierarchy. Understanding this is crucial, especially in real-world environments where issues like disk space, missing files, or unexpected application behavior often trace back to the filesystem.</p><p>By the end of this blog, you’ll have a clear mental model of how data is organized in Linux - something that will make debugging, system design, and even API-level understanding much stronger. Let’s get started… 🚀</p><h4>Overview:</h4><ul><li>How Linux represents files (inodes, data blocks, filenames)</li><li>Hands-On: Basic Understanding How Files Really Work in Linux</li><li>Filesystem types (ext4, xfs, tmpfs)</li><li>Hands-On: Exploring Filesystems in Linux</li><li>Linux directory structure</li><li>Few Basic Real-world Insights</li></ul><h4>How Linux Represents Files:</h4><ul><li>At first glance, a file in Linux looks very simple:</li></ul><pre>notes.txt</pre><ul><li>We think of it as:<br>A name<br>Some content inside it</li><li>But internally, Linux does <strong>not</strong> see files this way.</li><li>Instead, Linux breaks every file into three parts:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*PC1jgX7Jg5lHzKnj-gYCMQ.png" /></figure><ul><li>Understanding this flow is key to understanding how Linux actually stores data.</li></ul><h4>1. Filename (What We See)</h4><ul><li>The <strong>filename</strong> is just a label stored inside a directory.</li><li>It helps humans identify the file</li><li>It does <strong>not</strong> store any actual data</li><li>It simply points to something called an <strong>inode.</strong></li><li><em>A filename is just a reference, not the file itself.</em></li></ul><h4>2. Inode (The Brain of the File)</h4><ul><li>An <strong>inode</strong> is where Linux stores all the important information about a file.</li><li>Index Node</li><li>It contains:<br>File size<br>Owner (user and group)<br>Permissions<br>Timestamps (created, modified, accessed)<br>Pointers to data blocks</li><li><em>The inode does </em><strong><em>NOT store the filename</em></strong></li><li>Each file in Linux is identified internally by its <strong>inode number</strong>.</li></ul><h4>3. Data Blocks (The Actual Data)</h4><ul><li>This is where the real content of the file lives.</li><li>Stored in chunks on disk</li><li>Can be spread across different locations</li><li>Managed by the filesystem</li><li>Ex - If your file contains:</li></ul><pre>Hello World...</pre><ul><li>That content is stored in <strong>data blocks</strong>, not in the filename or inode.</li></ul><p><strong>Here’s what actually happens:</strong></p><pre>notes.txt<br>   ↓<br>inode #45231<br>   ↓<br>data blocks (actual content)</pre><p>So when you open a file:</p><ol><li>Linux looks up the filename in the directory</li><li>Finds the associated inode</li><li>Uses the inode to locate data blocks</li><li>Reads the actual content</li></ol><h4>Hands-On: Basic Understanding How Files Really Work in Linux</h4><p>Let’s see how Linux actually handles files behind the scenes using a simple example.</p><p><strong>Step 1:</strong> Create a File</p><pre># Creates (or overwrites) a file named notes.txt with the text &quot;Hello World...&quot;<br>echo &quot;Hello World...&quot; &gt; notes.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*RtyZaPz7z2iqtELfJzTqEA.png" /></figure><ul><li>This creates a file named notes.txt with some content.</li><li>List the files:</li></ul><pre># Lists all files and directories in the current folder in long format (showing details like permissions, owner, size, and modification date)<br>ls -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*NC3Tp_Hd3tsuZCpU5pmwLw.png" /></figure><p><strong>Step 2:</strong> Create a Hard Link</p><ul><li>The <strong><em>ln</em></strong> command in Linux is used to <strong>create links to files</strong>.</li><li>Just like<strong> Creating another name (or shortcut) for the same file</strong></li></ul><pre># Creates a hard link named new_notes.txt that points to the same file content as notes.txt<br># [options] &lt;source_file&gt; &lt;link_name&gt;<br>ln notes.txt new_notes.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*kLozQPd2-vM47HuSUelvnA.png" /></figure><ul><li>This creates another name (new_notes.txt) for the same file.</li><li>Verify the files:</li></ul><pre># Lists all files and directories in the current folder in long format (showing details like permissions, owner, size, and modification date)<br>ls -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*OLEpB7JASo5ZkS7KdnT7MA.png" /></figure><ul><li>Notice the number 2 → this is the <strong>link count</strong></li><li>It means <strong>2 filenames are pointing to the same data</strong></li></ul><p><strong>Step 3:</strong> Check Inode numbers</p><ul><li>List the files:</li></ul><pre># Lists files in long format with inode numbers (a unique ID for each file on the filesystem)<br>ls -li</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*Jr-9TZ-SFsomS4i_eQwsmg.png" /></figure><ul><li>Same inode number = same file internally</li><li>Here, it is 9354028</li></ul><p><strong>Step 4: </strong>Modify one file</p><pre># Appends (adds) &quot;Updated content&quot; to the end of notes.txt<br>echo &quot;Updated content&quot; &gt;&gt; notes.txt<br><br># Displays the content of new_notes.txt<br>cat new_notes.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*zykLm6qW_xgd9Ufi48ql5A.png" /></figure><ul><li>Changes in one file appear in the other.</li></ul><p><strong>Step 5:</strong> Delete one file</p><pre># Deletes the file name notes.txt (removes one hard link)<br>rm notes.txt<br><br># Lists files with details including inode numbers<br>ls -li</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*5dc4-AyWk6V2wmsYSMyZLg.png" /></figure><ul><li>The data is still available because one link still exists</li></ul><p><strong>Step 6:</strong> When is the File Actually Deleted?</p><ul><li>A file is only removed from disk when: <em>All links to its inode are deleted.</em></li></ul><pre>In Linux, files are not defined by their names --&gt; multiple names can point to the same underlying data through a shared inode.</pre><h4>Filesystem types (ext4, xfs, tmpfs)</h4><ul><li>Now that we understand how Linux represents files internally, the next step is to understand <strong>where and how this data is actually stored</strong>.</li><li>This is where <strong>filesystems</strong> come into play.</li><li>A filesystem defines:<br>How data is organized on disk<br>How files are stored and retrieved<br>How efficiently the system performs</li></ul><p><strong>What is a Filesystem?</strong></p><ul><li>Think it as a <em>method Linux uses to store and manage files on a disk.</em></li><li>Different filesystems are designed for different use cases like performance, reliability, or speed.</li></ul><p><strong>Common Filesystem Types:</strong></p><ol><li><strong><em>ext4</em></strong> (Extended Filesystem 4)</li></ol><ul><li>Most commonly used filesystem in Linux</li><li>Default in many distributions</li><li>Supports large files and volumes</li><li>Uses <strong>journaling</strong> (helps prevent data corruption)</li><li>Best for:<br>General-purpose systems<br>Everyday workloads</li></ul><p>2. <strong><em>xfs</em></strong> (High Performance Filesystem)</p><ul><li>Designed for high performance</li><li>Handles large files very efficiently</li><li>Common in enterprise and cloud environments</li><li>Best for:<br>Servers<br>High I/O workloads<br>Large-scale data systems</li></ul><p>3. <strong><em>tmpfs</em></strong> (Temporary Filesystem)</p><ul><li>Stored in <strong>RAM (memory)</strong> instead of disk</li><li>Extremely fast</li><li>Data is <strong>temporary</strong> (lost after reboot)</li><li>Ex: /tmp</li><li>Best for:<br>Temporary files<br>Caching<br>Fast operations</li></ul><h4>Hands-On: Exploring Filesystems in Linux</h4><p>Let’s explore how Linux uses different filesystems on your system.</p><p><strong>Step 1:</strong> Check Filesystem Types</p><pre># Shows disk space usage along with the filesystem type (like ext4, xfs, etc.) for each mounted filesystem<br>df -T</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*ydgiQ3ycDz__6aAMLHleCA.png" /></figure><ul><li>xfs → your main disk filesystem</li><li>tmpfs → memory-based filesystem</li></ul><p><strong>Step 2:</strong> Identify where data lives</p><pre># Displays disk space usage in a human-readable format (e.g., MB, GB) for each filesystem<br>df -h</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*uP0zp_qCawIrZe7f-V_PZg.png" /></figure><ul><li>Shows:<br>Disk usage<br>Available space</li></ul><p><strong>Step 3: </strong>Explore tmpfs (Memory Storage)</p><pre># Changes directory to /tmp (temporary files location)<br>cd /tmp<br><br># Creates temp.txt with the given text<br>echo &quot;This is temporary data&quot; &gt; temp.txt<br><br># Lists files in long format with details<br>ls -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*78Bblsn9A5fsw38DtfM3rQ.png" /></figure><ul><li>File is created in /tmp</li><li>Now check:</li></ul><pre># Shows the filesystem type and disk usage for the /tmp directory<br>df -T /tmp</pre><ul><li>After reboot, the temporary file will be gone.</li><li>What this proves?<br>/tmp often uses <strong>tmpfs<br></strong>Data is stored in <strong>RAM<br></strong>It is <strong>not persistent</strong></li></ul><p><strong>Step 4:</strong> Find What’s Taking Space</p><pre># Displays the size of each item inside /var in a human-readable summary format (e.g., KB, MB, GB)<br>du -sh /var/*</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*bEca15ImidoUukt7UH4NRQ.png" /></figure><ul><li>Helps you identify:<br>Large logs<br>Application data</li></ul><p><strong>Step 5:</strong> Check Root Filesystem Type</p><pre># Shows information about the root (/) filesystem mount, filtering the output to only that entry<br>mount | grep &#39; / &#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHxo7rRKsX4F9Tml9PWj1A.png" /></figure><ul><li>This output shows that the entire Linux system is built on a single filesystem, mounted at /, where all files, applications, and logs ultimately reside.</li><li>Shows which filesystem your system is using (ext4/xfs)</li></ul><h4>Linux directory structure</h4><ul><li>Now that we understand how Linux stores data and where it lives (filesystems), the next step is:</li><li>Where exactly is this data organized?</li><li>In Linux, everything starts from a single point:</li></ul><pre>/</pre><ul><li>This is called the <strong>root directory</strong>, and it acts as the starting point for the entire filesystem.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IkwF0oOW3jkOSC2pF52mqw.png" /></figure><ul><li>Each directory has a <strong>specific purpose </strong>and understanding this is key to debugging and system design.</li><li><strong>/bin<br></strong>Essential user commands (e.g., ls, cp, cat)<br>Required for basic system operation<br>Available even in minimal environments</li><li><strong>/boot</strong><br>Contains bootloader files<br>Stores kernel and initramfs<br>Required for system startup</li><li><strong>/dev</strong><br>Contains device files (disks, terminals, etc.)<br>Represents hardware as files<br>Ex: /dev/xvda</li><li><strong>/etc</strong><br>System and application configuration files<br>No executable binaries (mostly config text files)<br>Ex: /etc/ssh/sshd_config</li><li><strong>/home</strong><br>Personal directories for users<br>Stores user files, scripts, projects<br>Ex: /home/ec2-user</li><li><strong>/lib</strong><br>Essential shared libraries for /bin and /sbin<br>Needed for system to function<br>Used during boot</li><li><strong>/lib64</strong><br>64-bit versions of system libraries<br>Used by modern systems<br>Works alongside /lib</li><li><strong>/media</strong><br>Mount point for removable devices<br>USB drives, CDs, external disks<br>Automatically managed in many systems</li><li><strong>/mnt</strong><br>Temporary mount point for manual mounting<br>Used by admins for testing mounts<br>Not heavily used in production</li><li><strong>/opt</strong><br>Optional third-party software<br>Manually installed applications<br>Ex: custom tools, enterprise apps</li><li><strong>/proc</strong><br>Virtual filesystem (not real files)<br>Provides process and system info<br>Ex: /proc/cpuinfo</li><li><strong>/root</strong><br>Home directory for root user<br>Separate from /home<br>Has full system privileges</li><li><strong>/run</strong><br>Stores runtime system data<br>Temporary (cleared on reboot)<br>Used by system services</li><li><strong>/sbin</strong><br>System administration commands<br>Used by root/admin users<br>Ex: mount, reboot</li><li><strong>/srv</strong><br>Data for services provided by system<br>Ex: web server files<br>Not always heavily used</li><li><strong>/sys</strong><br>Virtual filesystem for kernel info<br>Used to interact with hardware<br>Similar to /proc but more structured</li><li><strong>/tmp</strong><br>Temporary files<br>Often stored in memory (tmpfs)<br>Cleared automatically</li><li><strong>/usr</strong><br>User-level programs and libraries<br>Contains most installed software<br>Ex: /usr/bin, /usr/lib</li><li><strong>/var</strong><br>Variable data (changes frequently)<br>Logs, databases, application data<br>Ex: /var/log, /var/lib</li><li><em>Each directory in Linux has a specific purpose and understanding this structure helps you quickly locate logs, debug issues, and manage applications efficiently.</em></li></ul><h4>Flow:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*_dQVLNBkgEWFvbl5Upz3eg.png" /></figure><h4>Few Insights:</h4><ul><li><strong>Case 1: File Deleted but Space Not Freed</strong><br>Filename removed → no<br>Inode still in use by a process → yes<br>Disk space is still occupied</li><li><strong>Case 2: Same File, Multiple Names (Hard Links)<br></strong>Multiple filenames → same inode<br>Same data, different names</li><li><strong>Case 3: Disk Issues Even When Space Looks Free<br></strong>Sometimes the issue is not storage<br>It’s <strong>inode exhaustion</strong></li><li><strong>Case 4: Why Systems Suddenly Break?</strong><br>Disk (/) full → apps crash<br>tmpfs full → runtime issues<br>Logs (/var/log) → biggest culprit</li></ul><p><strong><em>Now that we know where data lives in Linux, the next question is — who controls access to it? Let’s explore that in Part 2…</em></strong></p><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><p>Happy Learning 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d68ac9a4e42a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⎈Horizontal Pod Autoscaler⎈]]></title>
            <link>https://medium.com/@saimanasak/horizontal-pod-autoscaler-210d601c0f5f?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/210d601c0f5f</guid>
            <category><![CDATA[hpa]]></category>
            <category><![CDATA[kubernetes-metric-server]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-autoscaling]]></category>
            <category><![CDATA[kubernetes-hpa]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Mon, 23 Mar 2026 03:59:53 GMT</pubDate>
            <atom:updated>2026-03-23T03:59:53.105Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; <em>Auto Scaling Applications in Kubernetes using CPU and Memory Metrics</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JdZzhvI2SG32hHO3uj4oug.gif" /><figcaption>Horizontal Pod Autoscaler by Sai Manasa</figcaption></figure><p>Hello World… Welcome back to another hands-on Kubernetes project. In this guide, we’ll explore how applications in Kubernetes can automatically scale based on resource usage using the Horizontal Pod Autoscaler (HPA). In real-world environments, application traffic is never constant — it can spike unexpectedly or drop at any time. Manually adjusting the number of pods is not practical or efficient. Kubernetes solves this problem by enabling automatic scaling based on metrics like CPU and memory usage. In this project, we’ll deploy a simple Nginx application, configure resource requests, and implement HPA to dynamically scale pods based on both CPU and memory utilization. This approach helps ensure better performance, high availability, and efficient resource utilization. Let’s get started… 🚀</p><h4>Overview:</h4><ul><li>What is Horizontal Pod Autoscaler (HPA)?</li><li>Why do we need autoscaling in Kubernetes?</li><li>CPU and Memory-based scaling</li><li>Simple hands-on guide</li><li>Architecture Diagram</li></ul><h4>What is Horizontal Pod Autoscaler (HPA)?</h4><ul><li>The Horizontal Pod Autoscaler (HPA) is a Kubernetes resource that automatically adjusts the number of pod replicas in a workload, such as a Deployment, ReplicaSet, or StatefulSet, based on observed resource usage or metrics.</li><li>Instead of manually scaling applications, HPA continuously monitors metrics like CPU and memory and compares them with the target values defined in its configuration.</li><li>When the current usage exceeds the defined threshold, HPA increases the number of pods.</li><li>When the usage drops, it reduces the number of pods accordingly.</li><li>This automated scaling mechanism helps applications adapt to changing workloads in real time, ensuring better performance and efficient resource utilization without manual intervention.</li></ul><h4>Why do we need autoscaling in Kubernetes?</h4><ul><li>In real-world applications, traffic is unpredictable — it can increase suddenly during peak hours and decrease during off-peak times.</li><li>Manually scaling pods in such scenarios is not practical and can lead to performance issues or resource wastage.</li><li>Autoscaling in Kubernetes solves this problem by dynamically adjusting the number of pods based on demand.</li><li>Without autoscaling:<br>Applications may become slow or unresponsive during high traffic<br>Resources may be underutilized during low traffic<br>Manual intervention is required to manage scaling</li><li>With autoscaling:<br>Applications can handle traffic spikes automatically<br>Resources are used efficiently<br>System reliability and availability improve</li><li>This makes autoscaling a critical component in building scalable and production-ready cloud-native applications.</li></ul><h4>CPU and Memory-Based Scaling:</h4><ul><li>HPA can scale applications based on different types of metrics, and the most commonly used ones are CPU and memory utilization.</li><li>In CPU-based scaling, HPA monitors the average CPU usage across all pods and compares it with the defined target.</li><li>If the CPU usage exceeds the threshold (for example, 50%), it increases the number of pods to distribute the load.</li><li>Similarly, in memory-based scaling, HPA tracks memory usage and scales the application when memory consumption crosses a defined limit (for example, 60%).</li><li>When multiple metrics are defined, HPA uses an OR-based approach for scaling up.</li><li>This means that if either CPU or memory crosses its threshold, scaling will be triggered.</li><li>By combining CPU and memory metrics, applications can scale more intelligently and respond better to different types of workloads, making the system more robust and efficient.</li></ul><h4>Hands-On Guide:</h4><p><strong>Step 1:</strong> Create a Deployment</p><ul><li>To demonstrate how Horizontal Pod Autoscaler (HPA) works, we first need a simple application running inside Kubernetes.</li><li>In this project, we’ll use a lightweight Nginx application as our workload.</li><li>The key part of this step is defining <strong>resource requests and limits</strong>, because HPA relies on these values to calculate CPU and memory utilization. Without resource requests, autoscaling will not work.</li><li>Create a file named deployment.yaml and add the following configuration:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e644fc3e996896279212bcfa3552643/href">https://medium.com/media/9e644fc3e996896279212bcfa3552643/href</a></iframe><ul><li>In this configuration:<br>We deploy a simple Nginx container<br>The application starts with a single replica<br>CPU and memory requests are defined, which are required for HPA to function correctly<br>Limits are also set to control maximum resource usage</li><li>Apply the deployment using:</li></ul><pre># To create the deployment:<br>kubectl apply -f &lt;deploy-file-name&gt;<br><br># To delete the deployment, this deletes the replicas as well:<br>kubectl delete -f &lt;deploy-file-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*KxxfNG5hye7KZ79W_VCuqA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*9SIM0A_nyAnwQ28XssXQug.png" /></figure><p><strong>Step 2</strong>: Create a Service</p><ul><li>Now that the application is deployed, the next step is to expose it to the Kubernetes cluster so that other pods can communicate with it.</li><li>For this project, we’ll create a <strong>ClusterIP Service that enables</strong> internal communication between pods. This is important because our load generator (used later) will send requests to this service to simulate traffic and trigger autoscaling.</li><li>Create a file named service.yaml and add the following configuration:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e600953313c29ce159ae4b0ced044a9/href">https://medium.com/media/4e600953313c29ce159ae4b0ced044a9/href</a></iframe><ul><li>In this configuration:<br>The Service selects pods with the label app: my-hpa<br>It exposes port 80 in the cluster<br>Traffic sent to the Service is forwarded to the Nginx pods</li><li>Apply the service:</li></ul><pre># To create/apply the changes in the service:<br>kubectl apply -f &lt;service-file-name&gt;<br><br># To list the services in a namespace:<br>kubectl get svc -n &lt;namespace&gt;<br><br># To list all the services:<br>kubectl get svc - A<br><br># To list the endpoints:<br>kubectl get endpoints -n &lt;namespace-name&gt;<br><br># To delete a service:<br>kubectl delete svc &lt;service-name&gt; -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*dcYNa6mXR835NxAYMVhglw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*cl6unijnKTOgmTeV9id97g.png" /></figure><p><strong>Step 3:</strong> Create HPA</p><ul><li>Now that the application is running and accessible inside the cluster, the next step is to configure the Horizontal Pod Autoscaler (HPA) to scale the application based on CPU and memory usage automatically.</li><li>HPA continuously monitors resource utilization using the Metrics Server and adjusts the number of pod replicas to match the current workload.</li><li>Here, we will configure HPA to:<br>Scale up when CPU utilization exceeds <strong>50%<br></strong>Scale up when memory utilization exceeds <strong>60%<br></strong>Maintain a minimum of <strong>1 pod</strong> and a maximum of <strong>5 pods</strong></li><li>Create a file named hpa.yaml and add the following configuration:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/542bfbc022d5947dbdc4d35157c731af/href">https://medium.com/media/542bfbc022d5947dbdc4d35157c731af/href</a></iframe><ul><li>In this configuration:<br>The HPA targets the my-hpa-deploy Deployment<br>It monitors both CPU and memory utilization<br>Scaling is triggered if <strong>any metric crosses its threshold<br></strong>The number of pods is automatically adjusted between 1 and 5</li><li>Apply the HPA configuration:</li></ul><pre># To create/apply the changes in the hpa:<br>kubectl apply -f &lt;hpa-file-name&gt;<br><br># To list the hpa in a namespace:<br>kubectl get hpa -n &lt;namespace&gt;<br><br># To list all the hpa:<br>kubectl get hpa - A<br><br># To delete a hpa:<br>kubectl delete hpa &lt;hpa-name&gt; -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*uaAtut547OHOrSOQY_FU_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qSoCnT8rqHLNtNbxXGMC4g.png" /></figure><p><strong>Step 4:</strong> Enable Metrics Server</p><ul><li>Before testing autoscaling, Kubernetes needs a way to collect resource usage metrics such as CPU and memory.</li><li>This is done using the <strong>Metrics Server</strong>.</li><li>The Horizontal Pod Autoscaler (HPA) depends on these metrics to make scaling decisions.</li><li>Without the Metrics Server, HPA will not be able to retrieve CPU or memory usage, and scaling will not work.</li><li>In Minikube, the Metrics Server can be enabled easily using the addons feature.</li><li>Enable Metrics Server:</li></ul><pre># command to enable metrics-server<br>minikube addons enable metrics-server</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DxEDZE9vY-PBVHxwfNcFIQ.png" /></figure><ul><li>Verify that the metrics server is running:</li></ul><pre>kubectl get pods -n kube-system</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*8AGg9-c0ygbn9E2wVwvYTg.png" /></figure><ul><li>To confirm that metrics are being collected correctly, run:</li></ul><pre>kubectl top pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*pbtnrCT-q67HbNFNyStJ7g.png" /></figure><p><strong>Step 5:</strong> Verify all the resources</p><pre># To get deployments in a particular namespace<br>kubectl get deploy -n &lt;namespace-name&gt;<br>kubectl get deployments -n &lt;namespace-name&gt;<br><br># To get deployments in the default namespace<br>kubectl get deploy<br>kubectl get deployments<br><br><br># To get ReplicaSets in a particular namespace<br>kubectl get rs -n &lt;namespace-name&gt;<br>kubectl get replicaset -n &lt;namespace-name&gt;<br>kubectl get replicasets -n &lt;namespace-name&gt;<br><br><br># To get ReplicaSets in the default namespace<br>kubectl get rs<br>kubectl get replicaset<br>kubectl get replicasets<br><br><br># To get Pods in a particular namespace<br>kubectl get po -n &lt;namespace-name&gt;<br>kubectl get pods -n &lt;namespace-name&gt;<br><br><br># To get Pods in the default namespace<br>kubectl get po<br>kubectl get pods<br><br><br># To list all resources in a specific namespace<br>kubectl get all -n &lt;namespace-name&gt;<br><br><br># To list all resources in the default namespace<br>kubectl get all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vwvsBOCj_GCx9dXB80WEgw.png" /></figure><p><strong>Step 6:</strong> Generate Load and Test Autoscaling</p><ul><li>Now that the application, service, HPA, and Metrics Server are all set up, the next step is to simulate traffic and observe how Kubernetes automatically scales the pods.</li><li>To do this, we will create a temporary pod inside the cluster that continuously sends requests to our application.</li><li>This will increase CPU usage and trigger the HPA.</li><li>Run the following command to create a load generator pod:</li></ul><pre>kubectl run load-generator \<br>  --image=busybox \<br>  --restart=Never \<br>  --command -- \<br>  sh -c &quot;while true; do wget -q -O- http://my-hpa-service; done&quot;</pre><ul><li>This command creates a pod that continuously sends HTTP requests to the application using the service name.</li><li>Verify the new pod is running:</li></ul><pre>kubectl get po</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*T1bmXnf3_h-qTdiUYP7YAg.png" /></figure><ul><li>To monitor autoscaling, open a new terminal and watch the HPA in real time:</li></ul><pre>kubectl get hpa -w</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-w5J5CrQTyXCYzvpGce7SA.png" /></figure><ul><li>In another terminal, monitor the pods:’</li></ul><pre>kubectl get po -w</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*mOmKbWe7HQNcdIgy-gAw_w.png" /></figure><ul><li>Once you have observed scaling, stop the load generator:</li></ul><pre>kubectl delete pod load-generator</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*D07bR517u7Kkvn47TTkx1Q.png" /></figure><ul><li>After stopping the load, the CPU usage will drop. Kubernetes will gradually reduce the number of pods back to the minimum replica count.</li><li>Scaling down is not immediate. Kubernetes waits for a short stabilization period before reducing pods to avoid frequent scaling up and down.</li><li>Verify the pods now:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*rugIm5HFCDKVmnSFS8GrKg.png" /></figure><ul><li>And it’s done… 🙌</li></ul><h4>Architecture Diagram:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JdZzhvI2SG32hHO3uj4oug.gif" /></figure><h4>Repos:</h4><p>The repositories:</p><ul><li><a href="https://github.com/saimanasak/kubernetes/tree/main/autoscaling/hpa/basic_cpu_memory">Horizontal Pod Autoscaler</a></li><li><a href="https://github.com/saimanasak/kubernetes/tree/main">Kubernetes</a></li></ul><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><p>Happy Deploying 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=210d601c0f5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⎈Deploying a Flask Application using ConfigMaps and Secrets in Kubernetes⎈]]></title>
            <link>https://medium.com/@saimanasak/deploying-a-flask-application-using-configmaps-and-secrets-in-kubernetes-c0ac46ffedca?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0ac46ffedca</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[kubernetes-configmap]]></category>
            <category><![CDATA[kubernetes-secret]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[python-flask]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 02:43:36 GMT</pubDate>
            <atom:updated>2026-03-17T03:01:27.344Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; A Hands-On Guide to Managing Application Configuration and Sensitive Data using ConfigMaps, Secrets, Deployments, and NodePort Services</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*MjcXz3b6zrDeHnDvDpFvFA.gif" /><figcaption>Deploying a Flask Application using ConfigMaps and Secrets in Kubernetes by Sai Manasa</figcaption></figure><p>Hello World… Welcome back to the next hands-on Kubernetes project. In this project, we’ll look at how configuration is managed in Kubernetes using <strong>ConfigMaps</strong> and <strong>Secrets</strong>. In real-world applications, it’s not a good practice to keep configuration values or sensitive information like database credentials directly inside the application code. Instead, Kubernetes allows us to store and manage these values separately using dedicated resources. To see how this works in practice, we’ll deploy a simple <strong>Flask API</strong>, configure the application via a ConfigMap, and store sensitive data, such as database credentials, in a <strong>Secret</strong>. This approach keeps the application code clean while making deployments more flexible and secure. Let’s go… 🚀</p><h4>Overview:</h4><ul><li>What is ConfigMap?</li><li>What is Secret?</li><li>Simple hands-on guide</li><li>Architecture Diagram</li></ul><h4>What is ConfigMap?</h4><ul><li>A ConfigMap is a Kubernetes resource used to store non-sensitive configuration data as key–value pairs.</li><li>It allows you to keep application configuration separate from the container image so that the same application can run in different environments without modifying the code.</li><li>Instead of hardcoding values such as environment names, feature flags, or application settings within the application, store them in a ConfigMap and inject them into Pods as environment variables or mount them as configuration files.</li></ul><h4>What is Secret?</h4><ul><li>A Secret is a Kubernetes resource designed to store and manage sensitive information such as passwords, API keys, tokens, or database credentials.</li><li>While the data is stored in an encoded format (base64) in Kubernetes, it helps prevent sensitive information from being exposed directly in configuration files or container images.</li><li>Similar to ConfigMaps, Secrets can be injected into Pods as environment variables or mounted as files, allowing applications to securely access the data they need at runtime.</li></ul><h4>Simple Hands-On Guide:</h4><p><strong>Task Overview: </strong>Deploy a simple <em>Flask API</em> in Kubernetes to understand how application configuration can be managed using <em>ConfigMaps</em> and <em>Secrets</em>. Create a ConfigMap to store non-sensitive configuration values such as the application environment and color settings, and create a Secret to securely store sensitive information like database credentials. Deploy the Flask application using a Deployment and inject both the ConfigMap and Secret into the container as environment variables. Expose the application using a <em>NodePort </em>Service to access it from outside the cluster and verify that the application is correctly reading the configuration values provided by Kubernetes.</p><p><strong>Step 1:</strong> Create a Simple Flask Application</p><ul><li>To demonstrate how Kubernetes manages configuration using ConfigMaps and Secrets, we first need a simple application that can read configuration values from environment variables.</li><li>In this project, we’ll use a lightweight <strong>Flask API</strong> that returns a few configuration values when accessed through a browser.</li><li>The application will read four environment variables:<br>APP_ENV – represents the application environment (for example: dev or prod)<br>APP_COLOR – a sample configuration value used to demonstrate non-sensitive settings<br>DB_USER – database username (stored in a Secret)<br>DB_PASSWORD – database password (stored in a Secret)</li><li>In the next steps, these values will not be hardcoded. Instead, Kubernetes will inject them into the container using <strong>ConfigMaps and Secrets</strong>.</li><li>Create a file named <strong>app.py</strong> and add the following code:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5758b13e9af4659ec59a89c3bf2b0a9a/href">https://medium.com/media/5758b13e9af4659ec59a89c3bf2b0a9a/href</a></iframe><ul><li>This simple API reads environment variables using Python’s os.getenv() function and returns them as a JSON response.</li><li>Once deployed in Kubernetes, these values will be automatically populated using the ConfigMap and Secret resources we create later in the guide.</li></ul><p><strong>Step 2: </strong>Containerize the Flask Application</p><ul><li>Now that we have a simple Flask application, the next step is to package it into a <strong>Docker container image</strong> so that it can run inside Kubernetes.</li><li>Containerizing the application ensures that all required dependencies are included and the application runs consistently across different environments.</li><li>First, create a file named <strong>requirements.txt</strong> to define the Python dependencies required for the application:</li></ul><pre>flask</pre><ul><li>Next, create a <strong>Dockerfile</strong> to build the container image for the Flask application.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d22ec3c2127a2b582fdfc43c372a7e7/href">https://medium.com/media/3d22ec3c2127a2b582fdfc43c372a7e7/href</a></iframe><ul><li>This Dockerfile performs the following steps:<br>Uses a lightweight Python Alpine base image<br>Sets the working directory inside the container<br>Installs the Flask dependency<br>Copies the application code into the container<br>Exposes port <strong>5000</strong> for the Flask application<br>Starts the application when the container runs</li><li>After creating the Dockerfile, build the Docker image and push it to your Docker Hub repository so Kubernetes can pull it during deployment.</li></ul><pre># command to build the docker image<br># Syntax: docker build -t &lt;dockerhub-username&gt;/&lt;image-name&gt;:&lt;tag&gt; &lt;Dockerfile-Path&gt;&gt;<br>docker build -t saimanasak/flask-k8s-cm-secrets-demo:v1 .</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*-NzUi_kjg_wN83fP3k3x0Q.png" /></figure><ul><li>Verify the images after building is done:</li></ul><pre># command to list the docker images present<br>docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*4A4yZKKaAcuGnYrXAE8o5A.png" /></figure><ul><li>If Docker Desktop is present, you can directly push the image to Docker Hub.</li><li>If not, use the below command to log in to Docker Hub:</li></ul><pre># command to login<br>docker login</pre><ul><li>Now, push the Docker image built above to the Images Repo, like Docker Hub:</li></ul><pre># command to push the docker image<br># Syntax: docker push &lt;dockerhub-username&gt;/&lt;image-name&gt;:&lt;tag&gt;<br>docker push saimanasak/flask-k8s-cm-secrets-demo:v1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*wIVyC2OFhAbIeIitzur0qQ.png" /></figure><ul><li>Once the image is available in Docker Hub, we can use it in our Kubernetes deployment.</li></ul><p><strong>Step 3:</strong> Create a ConfigMap</p><ul><li>Now that the application image is ready, the next step is to store the application’s configuration using a <strong>ConfigMap</strong>.</li><li>ConfigMaps are used to store <strong>non-sensitive configuration values</strong> that an application might need at runtime.</li><li>Here, we’ll store two configuration values:<br>APP_ENV – defines the environment in which the application is running (for example: dev or prod)<br>APP_COLOR – a sample configuration value used to demonstrate how application settings can be managed externally</li><li>Instead of hardcoding these values inside the application, we’ll store them in a ConfigMap and later inject them into the container.</li><li>Create a file named <strong>configmap.yaml</strong> inside your Kubernetes manifests directory and add the following configuration:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c690235ac7f544950d18a9572033c41/href">https://medium.com/media/0c690235ac7f544950d18a9572033c41/href</a></iframe><ul><li>Now, apply the configmap:</li></ul><pre># command to apply the config map or any K8s manifest file<br># Syntax: kubectl apply -f &lt;file-name&gt;<br>kubectl apply -f configmap.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*ztYkwJvqXzz6uC5Oq8WyIg.png" /></figure><ul><li>Verify the configmap created:</li></ul><pre># command to list the configmaps present<br>kubectl get configmap<br>kubectl get cm</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*B5bF2jIlyIQz5bwVKcSptQ.png" /></figure><ul><li>Describe the configmap:</li></ul><pre># command to describe a particular configmap<br># Syntax: kubectl describe cm &lt;cm-name&gt;<br>kubectl describe cm my-flask-config<br>kubectl describe configmap my-flask-config</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/337/1*fmO-0nNPbj10ZgGDgviTPg.png" /></figure><ul><li>This ConfigMap now stores the application configuration, which will later be injected into the Flask container as environment variables during deployment.</li></ul><p><strong>Step 4</strong>: Create Secret</p><ul><li>Create a Secret to store sensitive information for the application.</li><li>Unlike ConfigMaps, which are used for non-sensitive configuration, Secrets are designed to hold confidential data such as passwords, API keys, or tokens.</li><li>Here, we’ll store the following database credentials:<br>DB_USER – database username<br>DB_PASSWORD – database password</li><li>Kubernetes Secrets store values in <strong>base64 encoded format</strong>, so we first need to encode the values before adding them to the manifest.</li><li>Generate the base64 values using the following commands:</li></ul><pre>echo -n &quot;root&quot; | base64 <br>echo -n &quot;mypassword&quot; | base64</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*9FNQT0Nw98h9UwlP_ud8Lg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/1*ZWh0tS3ZAEB-dJH9IU89BQ.png" /></figure><ul><li>Now, create a file named <strong>secret.yaml:</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dfbda44b417ce0ee705ac986f492bf5b/href">https://medium.com/media/dfbda44b417ce0ee705ac986f492bf5b/href</a></iframe><ul><li>Apply the secret:</li></ul><pre># command to apply the secret or any K8s manifest file<br># Syntax: kubectl apply -f &lt;file-name&gt;<br>kubectl apply -f secret.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*FInCR-gLfMeRBB0CLpxIbQ.png" /></figure><ul><li>Verify the secrets created:</li></ul><pre># command to list the secrets present<br>kubectl get secrets</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*bMYOHU0S4OzbkUd4ElbZSw.png" /></figure><ul><li>Describe the secret:</li></ul><pre># command to describe a particular secret<br># Syntax: kubectl describe secret &lt;secret-name&gt;<br>kubectl describe secret my-flask-secret</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*T2nuFoVTFqeBRh2y5fq5rA.png" /></figure><p><strong>Step 5: </strong>Deploy the Flask Application</p><ul><li>Create a Deployment that runs multiple replicas of the Flask application and pulls the container image from Docker Hub.</li><li>The Deployment will reference both the <strong>ConfigMap</strong> and <strong>Secret</strong>, allowing Kubernetes to automatically inject the configuration values and credentials as environment variables inside the container.</li><li>Create a file named <strong>deployment.yaml -</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f35946405eaafd9305a8c62c42654a58/href">https://medium.com/media/f35946405eaafd9305a8c62c42654a58/href</a></iframe><ul><li>Apply the deployment file configuration:</li></ul><pre># To create the deployment:<br>kubectl apply -f &lt;deploy-file-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*8m8mBcSwZenDxfZ-mNvhWA.png" /></figure><ul><li>Verify the resources created from the deployment:</li></ul><pre># To get deployments in a particular namespace<br>kubectl get deploy -n &lt;namespace-name&gt;<br>kubectl get deployments -n &lt;namespace-name&gt;<br><br># To get deployments in the default namespace<br>kubectl get deploy<br>kubectl get deployments<br><br><br># To get ReplicaSets in a particular namespace<br>kubectl get rs -n &lt;namespace-name&gt;<br>kubectl get replicaset -n &lt;namespace-name&gt;<br>kubectl get replicasets -n &lt;namespace-name&gt;<br><br><br># To get ReplicaSets in the default namespace<br>kubectl get rs<br>kubectl get replicaset<br>kubectl get replicasets<br><br><br># To get Pods in a particular namespace<br>kubectl get po -n &lt;namespace-name&gt;<br>kubectl get pods -n &lt;namespace-name&gt;<br><br><br># To get Pods in the default namespace<br>kubectl get po<br>kubectl get pods<br><br><br># To list all resources in a specific namespace<br>kubectl get all -n &lt;namespace-name&gt;<br><br><br># To list all resources in the default namespace<br>kubectl get all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*e7Ho5D_SRjnpotPkzMsaEA.png" /></figure><ul><li>Here, K8s will create the Flask application pods, pull the container image from Docker Hub, and inject the values from the <strong>ConfigMap</strong> and <strong>Secret</strong> as environment variables inside the container.</li></ul><p><strong>Step 6: </strong>Expose the App Using NodePort Service</p><ul><li>A NodePort Service opens a specific port on each node in the cluster and forwards incoming traffic to the application pods.</li><li>This allows us to access the application using the <strong>node’s IP address and the assigned NodePort</strong>.</li><li>Create a file named <strong>service.yaml</strong> -</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cf03b429ee6731020ec4b16cd73c9ad/href">https://medium.com/media/2cf03b429ee6731020ec4b16cd73c9ad/href</a></iframe><ul><li>Commands:</li></ul><pre># To create/apply the changes in the service:<br>kubectl apply -f &lt;service-file-name&gt;<br><br># To list the services in a namespace:<br>kubectl get svc -n &lt;namespace&gt;<br><br># To list all the services:<br>kubectl get svc - A<br><br># To list the endpoints:<br>kubectl get endpoints -n &lt;namespace-name&gt;<br><br># To delete a service:<br>kubectl delete svc &lt;service-name&gt; -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*FgGQYx6oMrqsjOJLTHjxGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*sPxnGJlik8mikJ2ne_PEfg.png" /></figure><ul><li>To access the application using minikube, please go through <strong><em>Steps 8 and 9</em></strong> of the blog below:</li></ul><p><a href="https://saimanasak.medium.com/helm-deployment-of-an-nginx-application-using-a-nodeport-service-in-kubernetes-a7547c31ef5b">⎈Helm Deployment of an Nginx Application Using a NodePort Service in Kubernetes⎈</a></p><ul><li>Output:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*47GZtRftAZKiM1qJVGNkSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*oeVkp-Yr9mV-L4DTqh9Ypw.png" /></figure><ul><li>Also, verify the environment variables of the created ConfigMap and Secrets using -</li></ul><pre>kubectl exec -it &lt;pod-name&gt; -- env</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*SgElZbnIX-7cd3Zo1hVrOQ.png" /></figure><ul><li>It’s done… 🙌</li></ul><h4>Architecture Diagram:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHgN6ZFUQ9qt4_AbgrYMSA.png" /><figcaption><strong>Deploying a Flask Application using ConfigMaps and Secrets by Sai Manasa</strong></figcaption></figure><h4>Repos:</h4><p>The repositories:</p><ul><li><a href="https://github.com/saimanasak/kubernetes/tree/main/battlefield/3-flask-configmap-secret">Deploying a Flask Application using ConfigMaps and Secrets</a></li><li><a href="https://github.com/saimanasak/kubernetes/tree/main">Kubernetes</a></li></ul><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><p>Happy Deploying 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0ac46ffedca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⎈Helm Deployment of an Nginx Application Using a NodePort Service in Kubernetes⎈]]></title>
            <link>https://medium.com/@saimanasak/helm-deployment-of-an-nginx-application-using-a-nodeport-service-in-kubernetes-a7547c31ef5b?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7547c31ef5b</guid>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes-service]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[node-port]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Sun, 15 Mar 2026 22:30:21 GMT</pubDate>
            <atom:updated>2026-03-15T22:30:21.061Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; A hands-on guide to deploying Nginx with Helm, exposing it externally using NodePort, and understanding Kubernetes service routing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ta5tSoAk8v8Fz4-vRr6C6g.gif" /><figcaption><strong>Helm Deployment of Nginx using NodePort Service by Sai Manasa</strong></figcaption></figure><p>Hello World… Welcome back to the next hands-on Kubernetes project. In the previous project, we deployed an Nginx application with multiple replicas and exposed it internally using a <strong>ClusterIP Service</strong>, allowing communication within the Kubernetes cluster. If you haven’t gone through that guide yet, I highly recommend starting there first, since it covers the fundamental Kubernetes building blocks such as <strong>Pods, Deployments, ReplicaSets, and Services</strong>. You can find the project guide here 👇</p><p><a href="https://saimanasak.medium.com/deployment-nginx-application-d59373e89ee3">⎈Deployment — Nginx Application⎈</a></p><p>In this project, we’ll take the next step and explore how to <strong>expose an application outside the cluster using a NodePort Service</strong>. We’ll deploy Nginx, create a NodePort Service to make the application accessible externally, and verify how Kubernetes automatically load balances traffic between Pods. To make the workflow closer to real-world DevOps practices, we’ll also package the application using <strong>Helm charts</strong>, making deployments easier to manage and upgrade. Let’s go… 🚀</p><h4>Overview:</h4><ul><li>What is Service — NodePort?</li><li>What is Helm Chart?</li><li>Simple hands-on guide</li><li>Architecture Diagram</li></ul><h4>What is Service — NodePort?</h4><ul><li>A <strong>NodePort Service</strong> is a Kubernetes service type that exposes an application running inside the cluster to <strong>external users</strong> by opening a specific port on each node.</li><li>When a NodePort service is created, Kubernetes allocates a port from the <strong>NodePort range (30000–32767)</strong> and forwards incoming traffic on that port to the corresponding service.</li><li>Users can access the application using the <strong>Node IP and the NodePort</strong>, for example: <a href="http://NodeIP:NodePort.">http://NodeIP:NodePort.</a></li><li>Internally, Kubernetes routes this traffic through the Service and <strong>load balances requests across all matching Pods</strong>.</li><li>NodePort is commonly used in <strong>development environments, testing setups, or bare-metal clusters</strong> where a cloud load balancer is not available.</li></ul><h4>What is Helm Chart?</h4><ul><li>A <strong>Helm Chart</strong> is a packaged collection of Kubernetes resources that defines how an application should be deployed in a Kubernetes cluster.</li><li>It allows you to bundle multiple Kubernetes manifests, such as <strong>Deployments, Services, ConfigMaps, and Secrets,</strong> into a single reusable package.</li><li>Helm charts use <strong>templates and a values file (</strong><strong>values.yaml)</strong>, making it easy to customize settings such as replica count, image versions, and service types.</li><li>Helm also simplifies application lifecycle management by supporting <strong>installations, upgrades, rollbacks, and version control of deployments</strong>.</li></ul><h4>Simple Hands-On Guide:</h4><p><strong>Task Overview:</strong> <em>Deploy an Nginx application</em> in Kubernetes using a <em>Deployment with 3 replicas</em> to understand how Kubernetes manages multiple application pods. Expose the application <em>externally using a NodePort Service</em> so it can be accessed outside the cluster through the node’s IP and port. Verify Kubernetes functionality by checking the created resources (Deployments, Pods, and Services) and confirming that traffic is <em>load-balanced across the pods.</em> Finally, package the application using a <em>Helm chart</em> to simplify deployment, configuration management, and future upgrades.</p><p><strong>Step 1:</strong> Create a Helm Chart</p><ul><li>Instead of manually creating Kubernetes YAML files for the Deployment and Service, we will use <strong>Helm</strong>, the package manager for Kubernetes.</li><li>Helm allows us to package Kubernetes resources into reusable units called <strong>charts</strong>, making deployments easier to manage, upgrade, and configure.</li><li>In this step, we will generate a <strong>Helm chart structure</strong> containing templates for our Nginx Deployment and NodePort Service.</li></ul><pre># Command to create helm chart<br># Syntax: helm create &lt;chart-name&gt;<br>helm create nginx-nodeport-chart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*x_mVPYKFcWCv2grTV5bOwg.png" /></figure><ul><li>The above command creates a default Helm chart structure:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*rwuWeKU_xqE4P9gB_VBh_A.png" /></figure><p><strong>Step 2:</strong> Configure Application Values</p><ul><li>After generating the Helm chart, Helm creates a default <strong>values.yaml</strong> file.</li><li>This file contains configuration values that will be used by the templates inside the templates/ directory.</li><li>Instead of hardcoding configurations inside the templates, Helm allows us to define parameters such as <strong>replica count, container image, and service configuration</strong> in the values.yaml file.</li><li>This makes the deployment <strong>flexible and easy to update</strong> without modifying the templates.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d61ad4c110f7d44639ad656f059dd00/href">https://medium.com/media/1d61ad4c110f7d44639ad656f059dd00/href</a></iframe><ul><li>By defining these values invalues.yaml, we can easily modify the application configuration during deployment or upgrades without editing the templates directly.</li></ul><p>Step 3: Configure the Deployment Template</p><ul><li>After defining the configuration values in values.yaml</li><li>The next step is to update the <strong>Deployment template</strong> so it uses those values.</li><li>Helm templates allow us to dynamically insert values from values.yaml into Kubernetes manifests using the {{ .Values }} syntax.</li><li>Navigate to the <strong>templates/nginx-deployment.yaml</strong> file inside the Helm chart and modify it to deploy the Nginx application with the values defined earlier.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7bd1f165ac372b07ec5278eed2049545/href">https://medium.com/media/7bd1f165ac372b07ec5278eed2049545/href</a></iframe><p><strong>Step 4:</strong> Configure the Service Template</p><ul><li>After configuring the Deployment template, the next step is to define how the application will be exposed outside the Kubernetes cluster.</li><li>For this, we will use a <strong>NodePort Service</strong>, which allows external users to access the application through the <strong>Node IP and a specific port</strong>.</li><li>Helm allows us to dynamically configure the Service using values from the <strong>values.yaml</strong> file.</li><li>This ensures that service configurations such as <strong>service type, port, and NodePort</strong> can be easily modified without changing the template itself.</li><li>Navigate to the <strong>templates/nginx-service.yaml</strong> file inside the Helm chart and modify it to deploy the Nginx application with the values defined earlier.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/42ec4d2465f4db0d977f9ed4ce2b36c7/href">https://medium.com/media/42ec4d2465f4db0d977f9ed4ce2b36c7/href</a></iframe><p><strong>Step 5:</strong> Validate and Render the Helm Chart</p><ul><li>Before deploying the Helm chart to the Kubernetes cluster, it is a good practice to validate the chart and preview the Kubernetes manifests that Helm will generate.</li><li>This helps ensure that the templates are correctly configured and prevent deployment errors.</li><li>First, run the below command to validate the chart structure and check for syntax issues:</li></ul><pre># Command to validate the helm chart<br># Syntax: helm lint &lt;chart-path&gt;<br>helm lint ./nginx-nodeport-chart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*Lyxel4wkyoSLAJLIsG-CbQ.png" /></figure><ul><li>If everything is configured correctly, Helm will confirm that the chart has no errors.</li><li>Next, render the Kubernetes manifests using the below command:</li></ul><pre># command used to preview the Kubernetes resources that Helm will generate from the chart<br># Syntx: helm template &lt;release-name&gt; &lt;chart-path&gt;<br>helm template nginx-release ./nginx-nodeport-chart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*QfwEmGH0HkUq35djv2HHkQ.png" /></figure><ul><li>This command processes the Helm templates and displays the final Kubernetes YAML that will be applied to the cluster.</li><li>It allows you to verify configurations such as the <strong>Deployment replicas, container image, and NodePort Service settings</strong> before installing the chart.</li><li>Previewing the rendered manifests is an important step in Helm-based workflows, as it ensures that the generated Kubernetes resources match the intended configuration.</li></ul><p><strong>Step 6:</strong> Install the Helm Chart</p><ul><li>After validating the chart and previewing the generated Kubernetes manifests, the next step is to <strong>deploy the application to the Kubernetes cluster using Helm</strong>.</li><li>Helm allows us to install the chart and create all required Kubernetes resources with a single command.</li></ul><pre># command to install the chart<br># Syntax: helm install &lt;release-name&gt; &lt;chart-path&gt;<br>helm install nginx-release ./nginx-nodeport-chart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*gjv0IlyjifC9tC1pWBxFQQ.png" /></figure><ul><li>Once the chart is installed, Helm will generate the Kubernetes resources such as the <strong>Deployment and NodePort Service</strong> defined in the chart templates.</li></ul><p><strong>Step 7:</strong> Verify the Deployment</p><ul><li>Can verify that the application has been successfully deployed by checking the created resources.</li></ul><pre># To get deployments in a particular namespace<br>kubectl get deploy -n &lt;namespace-name&gt;<br>kubectl get deployments -n &lt;namespace-name&gt;<br><br># To get deployments in the default namespace<br>kubectl get deploy<br>kubectl get deployments<br><br><br># To get ReplicaSets in a particular namespace<br>kubectl get rs -n &lt;namespace-name&gt;<br>kubectl get replicaset -n &lt;namespace-name&gt;<br>kubectl get replicasets -n &lt;namespace-name&gt;<br><br># To get ReplicaSets in the default namespace<br>kubectl get rs<br>kubectl get replicaset<br>kubectl get replicasets<br><br><br># To get Pods in a particular namespace<br>kubectl get po -n &lt;namespace-name&gt;<br>kubectl get pods -n &lt;namespace-name&gt;<br><br># To get Pods in the default namespace<br>kubectl get po<br>kubectl get pods<br><br><br># To list all resources in a specific namespace<br>kubectl get all -n &lt;namespace-name&gt;<br><br># To list all resources in the default namespace<br>kubectl get all<br><br><br># To create/apply the changes in the service:<br>kubectl apply -f &lt;service-file-name&gt;<br><br># To list the services in a namespace:<br>kubectl get svc -n &lt;namespace&gt;<br><br><br># To list all the services:<br>kubectl get svc - A<br><br><br># To list the endpoints:<br>kubectl get endpoints -n &lt;namespace-name&gt;<br><br><br># To delete a service:<br>kubectl delete svc &lt;service-name&gt; -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/1*wZcZOhRXPH-PEbObKoJ3Ow.png" /></figure><p>You should see:</p><ul><li>An <em>Nginx Deployment with 3 replicas</em></li><li><em>Three running Pods</em></li><li>A <em>NodePort Service</em> exposing the application</li><li>At this point, the Nginx application is successfully deployed using <strong>Helm</strong>, and Kubernetes is managing the Pods and routing traffic through the NodePort Service.</li></ul><p><strong>Step 8:</strong> Access the application</p><ul><li>After successfully deploying the Helm chart, the Nginx application is now running inside the Kubernetes cluster and exposed using a <strong>NodePort Service</strong>.</li><li>The next step is to access the application and confirm that it is reachable.</li><li>First, check the created service:</li></ul><pre># To list the services in a namespace:<br>kubectl get svc -n &lt;namespace&gt;<br><br># To list the services in a default namespace:<br>kubectl get svc <br><br># To list all the services:<br>kubectl get svc - A</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*BPSPFgHKNIIdqg8nT-8R5Q.png" /></figure><ul><li>This indicates that the application is exposed through <strong>NodePort 30007</strong>.</li><li>If you are using <strong>Minikube</strong>, you can access the service using the following command:</li></ul><pre># command automatically opens the service URL in your browser and creates a temporary tunnel from your local machine to the Kubernetes cluster<br># Syntax: minikube service &lt;service-name&gt;<br>minikube service my-nginx-service</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gg1atxPymjq7UG4YCtVmQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_4x0JWvOWGUl4WMSkzTcQQ.png" /></figure><ul><li>Once opened, you should see the default <strong>Nginx welcome page</strong>, confirming that the application is successfully running and accessible.</li></ul><p><strong>Step 9:</strong> Verify Load Balancing across Pods</p><ul><li>Since the Nginx application was deployed with <strong>3 replicas</strong>, Kubernetes automatically distributes incoming requests across these Pods through the Service.</li><li>To demonstrate this built-in load balancing, we can modify the response from each Pod and observe how the Service routes traffic between them.</li><li>First, check the running Pods:</li></ul><pre># To get Pods in a particular namespace<br>kubectl get po -n &lt;namespace-name&gt;<br>kubectl get pods -n &lt;namespace-name&gt;<br><br># To get Pods in the default namespace<br>kubectl get po<br>kubectl get pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*YKeCp9yi5BBIo-01s067sQ.png" /></figure><ul><li>You should see three Nginx Pods created by the Deployment.</li><li>Next, access each Pod and update the Nginx index.html file so that each Pod returns a unique response.</li><li>Example for the first Pod:</li></ul><pre># command to login to the pod<br># Syntax: kubectl exec -it &lt;pod-name&gt; -- bash<br>kubectl exec -it my-nginx-deploy-ddb6cc4b7-7ds8r -- bash<br><br># then...<br>echo &quot;Hello from Pod 1&quot; &gt; /usr/share/nginx/html/index.html<br>exit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*_d9-n9UOJe6KvzlKNxCEeA.png" /></figure><ul><li>Repeat the same process for the other Pods, updating the message accordingly (i.e., <strong>Hello from Pod 2</strong> and <strong>Hello from Pod 3</strong>).</li><li>Now access the application again using:</li></ul><pre># command automatically opens the service URL in your browser and creates a temporary tunnel from your local machine to the Kubernetes cluster<br># Syntax: minikube service &lt;service-name&gt;<br>minikube service my-nginx-service</pre><ul><li>Refresh the page multiple times.</li><li>You should notice the response changing between the different Pod messages, demonstrating how the Kubernetes Service <strong>load balances traffic across the available Pods</strong>.</li><li>This confirms that Kubernetes is successfully managing multiple application replicas and distributing requests automatically.</li></ul><h4><strong>Note on Load Balancing with Minikube:</strong></h4><ul><li>When testing the application using Minikube, you may notice that <strong>refreshing the browser does not always switch between Pods</strong>.</li><li>This happens because the minikube service command creates a temporary tunnel, and your browser may reuse the same connection, causing requests to be routed to the same Pod repeatedly.</li><li>To observe traffic being routed to different Pods, you can run the service command again.</li><li>Each time the command is executed, Minikube generates a new local URL and establishes a new connection to the service.</li><li>Accessing the application through this new URL may route the request to a different Pod.</li><li><strong><em>In production Kubernetes environments, external load balancers and ingress controllers typically distribute traffic more evenly across Pods without requiring repeated service commands.</em></strong></li></ul><h4>Alternate:</h4><ul><li><strong>Minikube with the Docker driver on Windows</strong> behaves differently.</li><li>Get the service URL once:</li></ul><pre>minikube service my-nginx-service --url</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1015/1*v2_1-YbmwTIDZmv7uzkGUQ.png" /></figure><ul><li>Keep this terminal open.</li><li>Now, use this URL in a separate terminal.</li><li>Can test load balancing using a command-line loop:</li></ul><pre># Place the URL obtained from the above service command below<br>while true; do curl &lt;URL&gt;; sleep 1; done</pre><ul><li>Now, we can see the response like:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7BavFYhOzs7Ph-tq-YUig.png" /></figure><ul><li>This confirms <strong>Kubernetes load balancing</strong>.</li><li><em>When using Minikube with the Docker driver on Windows, the </em><em>minikube service command creates a temporary tunnel to access the service.</em></li><li><em>The terminal running this command must remain open; otherwise, the connection to the service will close.</em></li><li>With the <strong>Docker driver on Windows</strong>, Minikube does:</li></ul><pre>Localhost<br>   │<br>Minikube tunnel<br>   │<br>NodePort Service<br>   │<br>Pods</pre><ul><li>And it’s done… 🙌</li></ul><p><strong>Step 10:</strong> Upgrade the Helm Release (optional)</p><ul><li>One of the major advantages of using Helm is the ability to <strong>easily upgrade an application deployment</strong> without manually modifying Kubernetes resources.</li><li>Helm allows us to update configurations such as the <strong>number of replicas, container image version, or service settings</strong> by modifying the values.yaml file and running a simple upgrade command.</li><li>Let’s update the <strong>replica count</strong> from 3 to 4 in the values.yaml file:</li></ul><pre>replicaCount: 4<br><br># Update the count to 4 from 3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*ejPU9JU4upmvQ5KGDHXYxQ.png" /></figure><ul><li>Now apply the change using the Helm upgrade command:</li></ul><pre># command to update an existing Helm release with the latest chart configuration<br># Syntax: helm upgrade &lt;release-name&gt; &lt;chart-path&gt;<br>helm upgrade nginx-release ./nginx-nodeport-chart</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*KyZwW12kMCjL9uU1udGzqQ.png" /></figure><ul><li>Verify the pods:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*wkCSCi2ffdnzGk_vzynbsw.png" /></figure><p><strong>Step 11:</strong> Remove the Helm Release</p><ul><li>Helm also makes it easy to completely remove an application and all the Kubernetes resources associated with it.</li><li>This is useful when you want to clean up the cluster after testing or redeploy the application from scratch.</li><li>Run the following command:</li></ul><pre># command to display all Helm releases installed in the current Kubernetes namespace<br>helm list<br><br># command to display from all the namespaces<br>helm list -A</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rkAwJKmZf217m5DYu2Ojw.png" /></figure><ul><li>Now, run the following command:</li></ul><pre># command to remove the Helm release and deletes all Kubernetes resources created by the chart<br># Syntax: helm uninstall &lt;release-name&gt;<br>helm uninstall nginx-release</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*IbQb93Kvl-JxDpI_pGkV2g.png" /></figure><ul><li>Verify the resources:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*DHxGg4pfdBZU2P2NZwAQEQ.png" /></figure><ul><li>You should no longer see the Nginx Pods or the NodePort Service, confirming that Helm has successfully cleaned up the deployment.</li></ul><h4>Architecture Diagram:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nFa2DfHNU9uuBW1R7_EmQ.png" /></figure><h4>Repos:</h4><p>The repositories:</p><ul><li><a href="https://github.com/saimanasak/kubernetes/tree/main/battlefield/2-simple-nodeport-nginx-helm">Helm Deployment of Nginx using NodePort Service</a></li><li><a href="https://github.com/saimanasak/kubernetes/tree/main">Kubernetes</a></li></ul><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7547c31ef5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⎈Deployment — Nginx Application⎈]]></title>
            <link>https://medium.com/@saimanasak/deployment-nginx-application-d59373e89ee3?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d59373e89ee3</guid>
            <category><![CDATA[kubernetes-replicaset]]></category>
            <category><![CDATA[kubernetes-pods]]></category>
            <category><![CDATA[kubernetes-service]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-deployment]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Mon, 09 Mar 2026 01:55:35 GMT</pubDate>
            <atom:updated>2026-03-14T22:54:26.090Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; A Beginner-Friendly Hands-On Guide to Understanding Deployments, ReplicaSets, Pods, and ClusterIP Services</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DgSRExvqpgxoz8wR1YUP5w.gif" /><figcaption>Deployment — Nginx Application by Sai Manasa</figcaption></figure><p>Hello World… Welcome to this <strong>hands-on Kubernetes project</strong> where we deploy and manage a simple <strong>Nginx application</strong> inside a Kubernetes cluster. In this guide, we’ll walk through the core building blocks of Kubernetes — <strong>Pods, Deployments, ReplicaSets, and Services. </strong>By the end of this project, you will not only deploy an application with multiple replicas but also expose it internally via a <strong>ClusterIP Service</strong> and test inter-cluster communication. Let’s go…..🚀</p><h4>Overview:</h4><ul><li>What is a Pod?</li><li>What is a Deployment?</li><li>What is a ReplicaSet?</li><li>What is a Service?</li><li>Simple hands-on guide</li><li>Architecture Diagram</li></ul><h4>What is a Pod???</h4><ul><li>A <strong>Pod</strong> is the smallest deployable unit in Kubernetes.</li><li>It represents a running instance of an application and usually contains <strong>one container</strong>, though it can contain multiple containers that share the same network and storage.</li><li>Each Pod gets its own <strong>IP address</strong>, and containers inside the Pod communicate with each other using <strong>localhost</strong>.</li><li>In simple terms, a Pod is <strong>where your application actually runs in Kubernetes</strong>.</li></ul><h4>What is a Deployment???</h4><ul><li>A <strong>Deployment</strong> is a Kubernetes resource used to manage Pods.</li><li>It ensures that the desired number of Pods are always running.</li><li>With Deployments, you can:<br>Create and manage multiple Pods<br>Update applications without downtime<br>Automatically replace failed Pods<br>Scale the number of Pods up or down</li><li>In short, a Deployment <strong>manages the lifecycle of Pods</strong>.</li></ul><h4>What is a ReplicaSet???</h4><ul><li>A <strong>ReplicaSet</strong> ensures that a specified number of Pod replicas are always running in the cluster.</li><li>For example, if you specify <strong>3 replicas</strong>, the ReplicaSet will <strong>ensure that 3 Pods are always running</strong>.</li><li>If one Pod fails or gets deleted, Kubernetes automatically creates a new one.</li><li>ReplicaSets are usually <strong>managed by Deployments</strong>, so we rarely create them directly.</li></ul><h4>What is a Service???</h4><ul><li>A <strong>Service</strong> provides a stable network endpoint for accessing Pods.</li><li>Since Pods can be created or destroyed at any time, their <strong>IP addresses may change</strong>.</li><li>A Service solves this problem by providing a <strong>permanent IP address and DNS name</strong> that routes traffic to the correct Pods.</li><li>In this project, we use a <strong>ClusterIP Service to enable communication between Pods within the cluster</strong>.</li></ul><h4><strong>ClusterIP:</strong></h4><ul><li>A <strong>ClusterIP Service</strong> is the default service type in Kubernetes that exposes an application <strong>only inside the Kubernetes cluster</strong>.</li><li>It provides a <strong>stable internal IP address and DNS name</strong> that other Pods can use to communicate with the application.</li><li>Since Pods are temporary and their IP addresses can change when they restart or are recreated, a ClusterIP Service acts as a <strong>reliable internal endpoint</strong> that routes traffic to the appropriate Pods.</li><li>In this project, we use a ClusterIP Service to allow internal communication within the cluster while keeping the Nginx application <strong>inaccessible from outside the cluster</strong>.</li></ul><h4>Simple hands-on guide:</h4><p><strong>Task Overview: </strong><em>Deploy an Nginx application</em> in K8s using a <em>Deployment with 3 replicas</em> to understand how K8s manages application pods. <em>Expose the application internally using a ClusterIP Service</em> to enable communication between pods inside the Kubernetes cluster. <em>Verify Kubernetes functionality</em> by checking the created resources (Deployments, ReplicaSets, Pods) and testing application accessibility within the cluster.</p><p><strong>Step 1: </strong>Create the Deployment Manifest</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9118572a86007b28ee9a60b2bfc2482d/href">https://medium.com/media/9118572a86007b28ee9a60b2bfc2482d/href</a></iframe><ul><li>A <strong>Deployment manifest</strong> is a configuration file that defines how an application should run in a Kubernetes cluster.</li><li>This manifest creates a Deployment that runs <strong>three replicas of an Nginx container</strong>, ensuring the application is always available. Kubernetes automatically manages the Pods through a <strong>ReplicaSet</strong>, replacing any failed Pods to maintain the desired state.</li><li>Each Pod created by this Deployment runs the <strong>Nginx web server</strong> and exposes port <strong>80</strong> for incoming traffic.</li><li>The labels defined in the manifest help Kubernetes identify and manage Pods, and Services use them to route traffic to the correct application Pods.</li></ul><pre>NOTE: spec.selector.matchLabels == spec.template.metadata.labels</pre><ul><li>Commands to deploy:</li></ul><pre># To create the deployment:<br>kubectl apply -f &lt;deploy-file-name&gt;<br><br># To delete the deployment, this deletes the replicas as well:<br>kubectl delete -f &lt;deploy-file-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*VV0b6UIhN5Mk5DjZjcjA6g.png" /></figure><p><strong>Step 2: </strong>Check the status of the pods.</p><ul><li>Commands to check the status:</li></ul><pre># To get deployments in a particular namespace<br>kubectl get deploy -n &lt;namespace-name&gt;<br>kubectl get deployments -n &lt;namespace-name&gt;<br><br># To get deployments in the default namespace<br>kubectl get deploy<br>kubectl get deployments<br><br><br># To get ReplicaSets in a particular namespace<br>kubectl get rs -n &lt;namespace-name&gt;<br>kubectl get replicaset -n &lt;namespace-name&gt;<br>kubectl get replicasets -n &lt;namespace-name&gt;<br><br><br># To get ReplicaSets in the default namespace<br>kubectl get rs<br>kubectl get replicaset<br>kubectl get replicasets<br><br><br># To get Pods in a particular namespace<br>kubectl get po -n &lt;namespace-name&gt;<br>kubectl get pods -n &lt;namespace-name&gt;<br><br><br># To get Pods in the default namespace<br>kubectl get po<br>kubectl get pods<br><br><br># To list all resources in a specific namespace<br>kubectl get all -n &lt;namespace-name&gt;<br><br><br># To list all resources in the default namespace<br>kubectl get all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*Ds6M1Be5jJhVuofpajrSmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*B0NrF3hWqSMflGpYmEC-Cg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*kXv7yUaQDoorNy9Aqt0IOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*bgRE5LU0lKYXj_XRwEKGaw.png" /></figure><p><strong>Step 3:</strong> Create a Service manifest file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d1b9c7a1c4aa2a3a79cb542906250b1/href">https://medium.com/media/4d1b9c7a1c4aa2a3a79cb542906250b1/href</a></iframe><ul><li>A Service in Kubernetes is like a front door that provides a reliable address for accessing the different parts of an application or multiple applications within a Kubernetes cluster.</li><li>It hides the complex networking details and ensures smooth, consistent communication between these parts.</li><li>This creates a service named ‘my-nginx-service’ of the type ‘ClusterIP’.</li><li>Commands:</li></ul><pre># To create/apply the changes in the service:<br>kubectl apply -f &lt;service-file-name&gt;<br><br># To list the services in a namespace:<br>kubectl get svc -n &lt;namespace&gt;<br><br># To list all the services:<br>kubectl get svc - A<br><br># To list the endpoints:<br>kubectl get endpoints -n &lt;namespace-name&gt;<br><br># To delete a service:<br>kubectl delete svc &lt;service-name&gt; -n &lt;namespace&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*V9qcqiHiZHqudIImvbJ9mw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*wCToXt4MA2hwQBNyEfCghQ.png" /></figure><p><strong>Step 4:</strong> Test the connectivity.</p><ul><li>Since <strong>ClusterIP services are only accessible inside the cluster</strong>, we will create a temporary pod to test connectivity.</li><li>Run the following commands:</li></ul><pre># Creates a temporary pod named &quot;test-pod&quot; using the BusyBox image<br># -it allows interactive terminal access<br># --rm automatically deletes the pod when you exit<br># sh starts a shell inside the container so you can run commands<br>kubectl run test-pod --image=busybox -it --rm -- sh</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*1Rdlc1Tc2NhJCu5NYiOKYw.png" /></figure><pre>kubectl exec -it test-pod -- sh<br># Executes a command inside the running pod &quot;test-pod&quot;<br># -it opens an interactive terminal session<br># -- separates kubectl options from the command being executed<br># sh starts a shell inside the container so you can run commands within the pod<br><br>wget -qO- http://my-nginx-service<br># Sends a request to the ClusterIP Service from inside the test pod<br># -q runs wget in quiet mode (suppresses extra output)<br># -O- prints the response directly to the terminal<br># If the service works correctly, it will display the Nginx welcome page</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*zYwh55oKInPolZ801T8jPg.png" /></figure><ul><li>If everything is working correctly, you should see the <strong>Nginx welcome page</strong>.</li><li>And it’s done… 🙌</li></ul><h4>Architecture Diagram:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gbnuCbDyWFqX1Y34P5YA-Q.png" /></figure><h4>Repos:</h4><p>The repositories:</p><ul><li><a href="https://github.com/saimanasak/kubernetes/tree/main/battlefield/1-simple-nginx-deployment-clusterip">Deployment — Nginx Application</a></li><li><a href="https://github.com/saimanasak/kubernetes/tree/main">Kubernetes</a></li></ul><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><p>Happy Deploying 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d59373e89ee3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⚓ Kubernetes: Container Probe — Readiness]]></title>
            <link>https://medium.com/@saimanasak/kubernetes-container-probe-readiness-2739c5205218?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2739c5205218</guid>
            <category><![CDATA[container-probe]]></category>
            <category><![CDATA[readinessprobe]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 01:06:26 GMT</pubDate>
            <atom:updated>2026-03-02T01:06:26.339Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; Making Sure Your Application Is Ready Before Users Reach It</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*m4xqdmyEtbERe1SGrS2WEw.gif" /><figcaption>Container Probe: Readiness by Sai Manasa</figcaption></figure><p>Hello World…<strong> </strong>A probe is a tool or mechanism used to inspect, monitor, or measure the status or condition of something. It is typically used to gather information without changing the subject being examined. In Kubernetes, a probe is a diagnostic mechanism that checks the health and status of a container within a pod. Probes are performed periodically by the kubelet to determine the current state of a container. Based on the probe result, Kubernetes can decide whether to restart a container, keep it running, or control the flow of traffic to it.</p><p>In this blog, I’ll dive into another important type of probe in Kubernetes: the <strong>Readiness Probe</strong>. While a container may be running, it doesn’t always mean it is ready to serve requests. The readiness probe ensures that traffic is routed only to fully prepared containers. This plays a crucial role in maintaining smooth traffic flow, high availability, and a seamless user experience in Kubernetes applications. So, let’s get started…</p><h4>Overview:</h4><ul><li>Readiness Probe</li><li>Why???</li><li>When to use</li><li>Example: Restaurant</li><li>Example: Technical</li><li>Flow</li></ul><h4>Readiness Probe:</h4><ul><li>A Readiness Probe in Kubernetes checks whether a container is ready to accept and handle incoming traffic.</li><li>It ensures that the application inside the container has fully started and is prepared to serve requests.</li><li>If a readiness probe fails, Kubernetes marks the container as not ready and temporarily removes the pod from service endpoints, preventing traffic from being routed to it.</li><li>Once the probe succeeds again, the pod is added back to the service, ensuring smooth traffic management and high application availability.</li></ul><h4>Why???</h4><ul><li>Applications inside containers may be running, but not always ready to serve user requests.</li><li>A readiness probe ensures that traffic is sent only to fully prepared containers.</li><li>This helps maintain application stability, reliability, and a smooth user experience.</li><li><strong>Controlling Traffic Flow:</strong> When a container starts, it may take time to initialize, load configurations, or establish database connections. During this period, sending user requests to the application may result in errors. A readiness probe checks if the container is ready, and only then allows Kubernetes to route traffic to it. This ensures that users interact only with fully prepared applications.</li><li><strong>Preventing User-Facing Errors:</strong> If traffic is sent to a container that is still starting or temporarily unavailable, users may experience failures or delays. Readiness probes prevent this by keeping the pod&#39;s out-of-service endpoints until it is ready. This reduces downtime and failed requests, improving the overall user experience.</li><li><strong>Smooth Handling of Temporary Issues: </strong>Applications sometimes encounter temporary issues, such as database disconnections, high load, or dependency failures. Instead of restarting the container immediately, Kubernetes uses readiness probes to temporarily stop sending traffic to that pod. Once the issue is resolved and the probe succeeds again, traffic is automatically restored. This ensures smooth recovery without unnecessary restarts.</li><li><strong>Supporting Zero-Downtime Deployments:</strong> During rolling updates or deployments, new pods take time to become ready. Readiness probes ensure that Kubernetes sends traffic only to new pods after they are fully initialized. At the same time, old pods continue serving traffic until new ones are ready. This enables zero-downtime deployments and seamless updates.</li><li><strong>Improving System Reliability:</strong> By ensuring that only ready containers receive traffic, readiness probes improve application reliability and maintain consistent performance. They help Kubernetes manage traffic intelligently, keeping services available and responsive even during failures or updates.</li></ul><h4>When To Use?</h4><p>Readiness probes are useful when:</p><ul><li>An application may be running but not yet ready to handle incoming requests, and we want Kubernetes to wait before sending traffic to it.</li><li>An application depends on external services such as databases, APIs, or caches, and should receive traffic only after these dependencies are available.</li><li>We want to temporarily stop traffic to a container during high load, maintenance, or temporary failures without restarting it.</li><li>We need to ensure smooth rolling updates and zero-downtime deployments by sending traffic only to fully ready pods.</li><li>We want to route user requests only to healthy and prepared containers to maintain reliability and a better user experience.</li></ul><h4>Example: Restaurant</h4><ul><li>Imagine a busy restaurant kitchen.</li><li>There is a <strong>Manager (Kubernetes)</strong> and a <strong>Chef (Container/Application)</strong>.</li><li>The chef has arrived at the restaurant and is alive and working in the kitchen.</li><li>But that doesn’t always mean the chef is ready to serve customers.</li><li>This is exactly how a <strong>readiness probe</strong> works.</li><li><strong>Scenario:</strong> The chef is present in the kitchen (container running), but -Ingredients are still being cut<br>The stove is being heated<br>Food preparation not completed<br>Waiting for grocery delivery</li><li>Customers are entering the restaurant.</li><li>The manager must decide: <em>“Should customers be sent to this chef now?”</em></li><li>What manager does (Readiness Check)</li><li>The manager periodically asks: <em>“Chef, are you ready to serve food?”</em></li><li>This regular check = <strong>Readiness Probe</strong></li><li>If the chef says, “Yes, Ready!”<br>The manager allows customers to enter<br>Orders start going to the chef<br>The restaurant serves food normally</li><li>This means the container is <strong>ready </strong>and traffic is allowed.</li><li>If the chef says, “Not Ready Yet.”</li><li>Maybe: <br>Food not prepared<br>Kitchen setup incomplete<br>Waiting for supplies</li><li>The manager does NOT fire the chef.<br>Chef is still employed and working.</li><li>Instead:<br>The manager stops sending customers<br>Waits until the chef is ready<br>Kitchen continues preparation</li><li>After some time, when the chef is ready again, they say, <em>“Now I’m ready!”</em></li><li>Manager immediately:<br>Allows customers again<br>Orders resume<br>The restaurant works smoothly</li><li>Traffic automatically resumes — no replacement needed.</li></ul><h4>Example: Manifest</h4><ul><li>A simple example of a readiness probe using an NGINX container in Kubernetes.</li><li>Here, the readiness probe checks an HTTP endpoint provided by the NGINX container.</li><li>This helps Kubernetes determine whether the container is ready to receive traffic.</li><li>Instead of restarting the container on failure, Kubernetes temporarily removes the pod from service endpoints until it becomes ready again.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0b7a4786fbfd5ca4f297be8b8dc7aa4/href">https://medium.com/media/d0b7a4786fbfd5ca4f297be8b8dc7aa4/href</a></iframe><h4>Explanation: Manifest</h4><ul><li>The above manifest defines a Pod named <strong>readiness-pod</strong> that runs a single container called <strong>nginx-container</strong> using the nginx image.</li><li>The container exposes port 80 and has a readiness probe configured to perform an HTTP GET request on the root path (/) every 5 seconds.</li><li>Kubernetes waits for 5 seconds after the container starts before performing the first readiness check. This delay allows the application some time to initialize before being evaluated for readiness.</li><li>The readiness probe attempts to access the container within a 2-second timeout for each check. If the container fails to respond successfully, Kubernetes marks the pod as <strong>Not Ready</strong>.</li><li>If the readiness probe fails 3 consecutive times, the pod is removed from the service endpoints and will not receive any traffic. However, the container continues running and is not restarted.</li><li>Once the container responds successfully again, Kubernetes marks the pod as <strong>Ready</strong> and adds it back to the service endpoints, allowing traffic to be routed to it again.</li><li>This ensures that traffic is only sent to containers that are fully prepared to handle requests, improving application reliability and user experience.</li><li>Detailed line-by-line explanation of the code can be found here: <a href="https://github.com/saimanasak/kubernetes/blob/main/containers/probes/readiness/basic-nginx-example/basic-example.md">GitHub</a></li></ul><h4>Example: Testing</h4><p><strong>Step 1:</strong> <strong>Create a Pod</strong></p><ul><li>Using the below command, create a pod:</li></ul><pre>kubectl apply -f basic-example.yaml</pre><pre># Command to create a pod:<br>kubectl apply -f &lt;manifest-file-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/0*id3rsmtJ08DSdMlr.png" /></figure><p><strong>Step 2:</strong> <strong>Check Pod Status</strong></p><ul><li>Check the status of the pod using the command below:</li></ul><pre>kubectl get pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*R7dBmJ4jPOwyONyK.png" /></figure><p><strong>Step 3:</strong> <strong>View Pod Details</strong></p><ul><li>See the details of the pod using the command below:</li></ul><pre>kubectl describe pod readiness-pod</pre><pre># Command to describe a specific pod:<br>kubectl describe pod &lt;pod-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6sDi1WF-Ja566yHI.png" /></figure><p><strong>Step 4:</strong> <strong>Simulate A Failure</strong></p><ul><li>To test the readiness probe, you can simulate a condition in which NGINX is temporarily unable to serve requests.</li><li>Log in to the pod’s container:</li></ul><pre>kubectl exec -it readiness-pod -- sh</pre><pre># Command to login to the pod&#39;s container:<br>kubectl exec -it &lt;pod-name&gt; -- &lt;terminal&gt;</pre><ul><li>Rename or delete the default HTML directory:</li></ul><pre>mv /usr/share/nginx/html /usr/share/nginx/html-bak</pre><ul><li>This will cause NGINX to return a 404 Not Found response to requests to /, triggering readiness probe failures.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*zYAirWDJuMGHT4Re.png" /></figure><p><strong>Step 5:</strong> <strong>Monitor the Readiness Probe</strong></p><ul><li>Check the details of the pod, events section:</li></ul><pre>kubectl describe pod readiness-pod</pre><pre># Command to describe a specific pod:<br>kubectl describe pod &lt;pod-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*drDQ_tsBk4AJ-xNA.png" /></figure><p><strong>Step 6:</strong> <strong>Observe Pod Restarts</strong></p><ul><li>Check the pod status:</li></ul><pre>kubectl get pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/0*AjBPBRTHmCLu2WA1.png" /></figure><p><strong>Step 7:</strong> <strong>Resolve the failure</strong></p><ul><li>Log in to the pod’s container:</li></ul><pre>kubectl exec -it readiness-pod -- sh</pre><pre># Command to login to the pod&#39;s container:<br>kubectl exec -it &lt;pod-name&gt; -- &lt;terminal&gt;</pre><ul><li>Rename or create the default HTML directory:</li></ul><pre>mv /usr/share/nginx/html-bak /usr/share/nginx/html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*HcPCoz0U4YjbPqow7GtvhQ.png" /></figure><p><strong>Step 8:</strong> <strong>Check pod status again</strong></p><ul><li>Check the pod status:</li></ul><pre>kubectl get pods</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*pvRbP1QLUVyXSqUoMqW3yg.png" /></figure><p><strong>Step 9:</strong> <strong>Cleanup</strong></p><ul><li>Command to delete the above-created pod:</li></ul><pre>kubectl delete pod readiness-pod</pre><pre>#Command to delete a specific pod:<br>kubectl delete pod &lt;pod-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/0*4srP0_sEcGa9Xkr2.png" /></figure><h4>Flow:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*sppQcEKIp_yYPi0dDUYG2Q.png" /></figure><ul><li><strong>Container Running: </strong>The process begins when a container is running inside a Kubernetes Pod.</li><li><strong>Readiness Probe Check: </strong>Kubernetes periodically checks the container using the configured readiness probe (such as an HTTP request, TCP socket check, or command execution) to determine if the container is ready to accept traffic.</li><li><strong>Success: </strong>If the readiness probe succeeds (i.e., the container is ready to handle requests), Kubernetes marks the pod as Ready and adds it to the service endpoints, allowing traffic to be routed to it. Kubernetes continues to perform readiness checks at regular intervals.</li><li><strong>Failure: </strong>If the readiness probe fails (i.e., the container is not ready to handle requests), Kubernetes marks the pod as Not Ready and removes it from the service endpoints.</li><li><strong>Traffic Stopped: </strong>Once the pod is removed from the service endpoints, no traffic is routed to that container. However, the container continues running inside the pod.</li><li><strong>Periodic Checks Continue: </strong>Kubernetes periodically runs readiness probes to determine whether the container becomes ready again.</li><li><strong>Success Again: </strong>If the readiness probe succeeds in a subsequent check, Kubernetes marks the pod as Ready again and adds it back to the service endpoints.</li><li><strong>Traffic Resumes: </strong>Once added back to the service, traffic is routed to the container again, and normal operation continues with ongoing readiness checks.</li></ul><h4>Repos:</h4><p>The repositories:</p><ul><li><a href="https://github.com/saimanasak/kubernetes/tree/main/containers/probes">Container Probes</a></li><li><a href="https://github.com/saimanasak/kubernetes/tree/main">Kubernetes</a></li></ul><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak/">saimanasak - Overview</a></p><p>Happy Learning 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2739c5205218" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ The Science Behind Smart Machines]]></title>
            <link>https://medium.com/@saimanasak/the-science-behind-smart-machines-f12245d2eb4b?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f12245d2eb4b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[mls]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Sun, 01 Mar 2026 03:15:48 GMT</pubDate>
            <atom:updated>2026-03-01T03:20:21.468Z</atom:updated>
            <content:encoded><![CDATA[<h4>&gt;&gt;&gt; Understanding How Modern Technology Learns and Thinks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*mAQ3ZZJOXnHMGDroXEOouQ.png" /><figcaption>Artificial Learning vs Machine Learning vs Deep Learning by Sai Manasa</figcaption></figure><p>Hello World… We are living in a world where machines can talk, recommend movies, recognize faces, and even drive cars. From shopping apps suggesting products to voice assistants answering our questions, intelligent technology has become a part of our daily lives. But have you ever wondered how these systems actually work and how machines become so smart? This blog will take you through the simple journey of how modern machines learn, think, and make decisions. By the end, you will clearly understand how intelligent systems evolve from basic smart behavior to advanced human-like understanding, explained in the easiest way possible. Let’s go…</p><h3>Overview:</h3><ul><li>What is AI?</li><li>What is ML?</li><li>What is Deep Learning?</li><li>Simple example to understand the differences</li><li>When to use what?</li></ul><h3>What is AI?</h3><ul><li>Artificial Intelligence</li><li>Means making machines <strong>think and act smart like humans</strong>.</li><li>It allows computers or machines to:<br>Understand<br>Learn<br>Make decisions<br>Solve problems automatically</li><li><strong>AI = When machines are trained to think and work like humans</strong></li></ul><h3>What is ML?</h3><ul><li>Machine Learning</li><li>It is a part of Artificial Intelligence.</li><li>Machines <strong>learn from data and experience</strong> instead of being manually programmed.</li><li><strong>ML = Teaching machines using data so they improve automatically</strong></li></ul><h3>What is Deep Learning?</h3><ul><li>It is a part of Machine Learning.</li><li>It is an advanced approach in which machines learn using <strong>neural networks</strong> (inspired by the human brain).</li><li>It is used when data is huge and complex, like:<br>Images<br>Voice<br>Videos<br>Text</li><li><strong>Deep Learning = Machine learning using brain-like neural networks to understand complex data</strong></li></ul><h3>Example: Amazon</h3><h4>Artificial Intelligence:</h4><ul><li>When Amazon behaves <strong>smart like a human shopkeeper</strong>, that is <strong>Artificial Intelligence</strong>.</li><li>When you open Amazon and it:<br>Suggests products<br>Shows “Recommended for you.”<br>Understands what you want<br>Helps you search quickly</li><li>It feels like Amazon is thinking.</li><li>That smart behavior = <strong>Artificial Intelligence</strong></li><li>Imagine a shopkeeper in a store.</li><li>You enter the store, and he says:<br><em>“You bought shoes last week, do you want socks?”</em></li><li>Here, the shopkeeper is using his brain and memory to help you.</li><li>Amazon also does the same → but instead of a human brain, it uses technology.</li><li>Making machines behave smart like humans = <strong>AI</strong></li></ul><h4>Machine Learning:</h4><ul><li>How did Amazon become smart?<br>Answer: <strong>Machine Learning</strong></li><li>It means Amazon learns from data.</li><li>How Amazon learns (ML)?</li><li>Amazon observes:<br>What you search<br>What you click<br>What you buy<br>How long have you seen a product</li><li>Then it learns patterns like:<br><em>People who buy a phone also buy a phone cover<br>You mostly search for skincare<br>You like black clothes</em></li><li>So next time, it predicts: “You may like this.”</li><li>No human is manually checking you → But the machine is learning automatically from your data.</li><li>That learning from experience/data = <strong>Machine Learning</strong></li></ul><h4>Deep Learning:</h4><ul><li>Now comes the most advanced level.</li><li>Deep Learning helps Amazon understand things <strong>the way a human brain does</strong>.</li><li>Not just data, but images, text, and behavior deeply.</li><li>How does Deep Learning work at Amazon?</li><li>Suppose you search: <br><em>“Red party dress”</em></li><li>Deep Learning understands:<br>Color = red<br>Clothing = dress<br>Occasion = party</li><li>It also studies:<br>Dress images<br>Reviews text<br>Fashion trends<br>Your past choices</li><li>Then shows exactly what you want.</li><li>Even if you type: <em>“Dress like Alia Bhatt party look.”</em></li><li>It can understand style ;)</li><li>This deep understanding is made possible by neural networks.</li><li>That brain-like learning = <strong>Deep Learning</strong></li></ul><h4>Another Simple Memory Trick:</h4><ul><li>Think of it like cooking</li><li><strong>AI → Cooking food</strong><br> The goal is to make tasty food (smart result).</li><li><strong>Machine Learning → Learning recipes from experience</strong><br> You cook many times, learn what works, what doesn’t, and improve.</li><li><strong>Deep Learning → Becoming a master chef</strong><br> Now you don’t just follow recipes — <br> You understand taste and ingredients, and you create new dishes perfectly.</li></ul><h3>When to Use What?</h3><h4>Use Intelligent Systems (AI) when:</h4><ul><li>When you want machines to behave smartly and automate tasks.</li><li>Use it when the goal is:<br>Automating work<br>Making decisions<br>Creating smart systems<br>Improving user experience</li><li><strong>Examples:<br></strong>Chatbots answering customer questions<br>Smart home devices<br>Navigation systems<br>Basic automation in apps</li><li>Use when you want systems to <strong>act smart.</strong></li></ul><h4>Use Data Learning Systems (Machine Learning) when:</h4><ul><li>When you have data and want the system to learn from it and make predictions.</li><li>Use it when:<br>Data is available<br>Predictions are needed<br>The system must improve over time<br>User behavior needs analysis</li><li><strong>Examples:<br></strong>Product recommendations (shopping apps)<br>Movie/music suggestions<br>Spam email detection<br>Sales prediction</li><li>Use when you want systems to <strong>learn from data and improve</strong></li></ul><h4>Use Deep Understanding Systems (Deep Learning) when:</h4><ul><li>The system must understand complex data, as humans do.</li><li>Use it when:<br>Data is huge<br>Images need recognition<br>Voice needs understanding<br>Text needs interpretation<br>High accuracy required</li><li><strong>Examples:<br></strong>Face recognition<br>Voice assistants<br>Self-driving cars<br>Image recognition<br>ChatGPT-like systems</li><li>Use when systems must <strong>understand deeply, like humans</strong></li></ul><h4>Simple Decision Guide:</h4><ul><li>Ask these 3 questions:<br><strong>1. Just need a smart system?</strong> → Use AI<br><strong>2. Need predictions from data?</strong> → Use Machine Learning<br><strong>3. Need human-like understanding (image/voice/text)?</strong> → Use Deep Learning</li><li>Use intelligent systems for smart automation, data-learning systems for predictive analytics, and deep-understanding systems when machines must understand complex information as humans do.</li></ul><h3>Wrapping Up:</h3><ul><li>Smart technology is already a part of our everyday existence; thus, it is no longer the future.</li><li>Intelligent robots may be found everywhere, from speech and picture recognition systems to internet recommendations.</li><li>Knowing how these technologies operate not only makes it easier for us to use them but also prepares us for a time when they will be used even more.</li><li>Learning these ideas now is the first step toward joining the intelligent world of tomorrow, as technology continues to develop.</li></ul><h3>Let’s Connect:</h3><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p>Happy Training 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f12245d2eb4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ IIS — Hosting the first simple web app]]></title>
            <link>https://medium.com/@saimanasak/iis-hosting-the-first-simple-web-app-9915c52c8e04?source=rss-58cca66b39b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9915c52c8e04</guid>
            <category><![CDATA[rdp-client]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[isis]]></category>
            <dc:creator><![CDATA[Sai Manasa]]></dc:creator>
            <pubDate>Mon, 10 Feb 2025 02:30:06 GMT</pubDate>
            <atom:updated>2025-02-10T02:30:06.556Z</atom:updated>
            <content:encoded><![CDATA[<h3>🌐 IIS — Hosting the first simple web app</h3><h4>&gt;&gt;&gt; A complete guide on hosting a simple web application on the server</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k9xc_TyFqZn79otiqoc5jQ.gif" /><figcaption>Hosting Web App by Sai Manasa</figcaption></figure><p>Hello World… IIS provides a stable and scalable platform for hosting websites and applications on Windows Server, making it an ideal choice for developers and businesses alike.</p><p>In this guide, we will walk you through <strong>deploying a simple web application</strong> (HTML) on IIS inside your <strong>AWS EC2 Windows Server</strong>. This includes configuring IIS, uploading your website files, and verifying that your web app is accessible. So, let’s get started…</p><ul><li>Steps for launching an EC2 Windows server and Installing IIS on the server: <a href="https://medium.com/@saimanasak/iis-installation-2c63d6e424de">Blog</a></li></ul><h4>Step1: Create a simple web page</h4><ul><li>Below is the HTML code snippet for a simple web page.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8d592ae51a8e6e1fd230ca67a1f90e4/href">https://medium.com/media/b8d592ae51a8e6e1fd230ca67a1f90e4/href</a></iframe><ul><li>Make sure the file name is index.html.</li><li>Because: IIS is configured to look for default files like index.html, index.htm, or default.aspx in a directory when no specific file is requested. If no such file exists, IIS may return a <strong>403 Forbidden</strong> or <strong>404 Not Found</strong> error.</li></ul><h4>Step2: Hosting the Web App</h4><ul><li>Initially, we need to add a website.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*Tv4_wZY7eZMLb33FPr3aDQ.png" /></figure><ul><li>Fill out the fields.</li><li><strong>Site Name:</strong> Sample</li><li><strong>Physical Path:</strong> Browse the location of the web application folder.</li><li>We need to store the web app files in the C:\inetpub\wwwroot directory. Because:<br>IIS is pre-configured to serve files from wwwroot, so placing files here ensures they are accessible without extra configuration.<br>The wwwroot folder has built-in security permissions that restrict unauthorized access while allowing IIS to serve files securely.<br>wwwroot is the standard directory for web hosting on Windows servers, making it easier for developers and administrators to manage and maintain web applications.</li><li>We can also store the files outside this directory, but we need to configure IIS accordingly.</li><li><strong>Binding:</strong><br>Type: HTTP<br>IP Address: All Unassigned<br>Port: 81 (The IIS is already hosted on port 80 if the IIS default web server is removed we can then use the 80 OR we need to configure the hosts when we want to access the new app on 80 though the default IIS browser is present)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*crRnNPdkcELv10rXRGLSYw.png" /></figure><ul><li>We can browse our website in the below ways or using the “<strong>http://localhost:81</strong>” URL.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dnK97Ds9pnZYFJNcynkgEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xWQJPGXxGjsdXO2mhGMe3g.png" /></figure><ul><li>Finally, the app is hosted 🙌</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pdQC9-BStU_FDouR4F86Sw.png" /></figure><h4>Let’s Connect:</h4><p>Feel free to get in touch, share your ideas or feedback, or ask any questions. I’m excited to engage with you and learn from each other as we navigate this exciting field!</p><p>LinkedIn: <a href="https://www.linkedin.com/in/saimanasak/">Sai Manasa</a></p><p>GitHub: <a href="https://github.com/saimanasak/">Sai Manasa</a></p><p><a href="https://github.com/saimanasak">saimanasak - Overview</a></p><p>Happy Host-ing 😄🌐</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9915c52c8e04" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>