<?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 Lahiruavishka on Medium]]></title>
        <description><![CDATA[Stories by Lahiruavishka on Medium]]></description>
        <link>https://medium.com/@lahiruavishka747?source=rss-137497e13859------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*mgiNDDhtlCksTliz</url>
            <title>Stories by Lahiruavishka on Medium</title>
            <link>https://medium.com/@lahiruavishka747?source=rss-137497e13859------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:38:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lahiruavishka747/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[Understanding the Linux File System Hierarchy: A Practical Guide for DevOps Engineers]]></title>
            <link>https://medium.com/@lahiruavishka747/understanding-the-linux-file-system-hierarchy-a-practical-guide-for-devops-engineers-0668e2f3f633?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/0668e2f3f633</guid>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[filesystem]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[rhel]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 14:57:00 GMT</pubDate>
            <atom:updated>2026-10-24T14:57:00.074Z</atom:updated>
            <content:encoded><![CDATA[<p>Understanding the Linux File System Hierarchy: A Practical Guide for DevOps Engineers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ClLMzcMgtUw7sqlssDFjdw.png" /></figure><p>Everything in Linux is a file, and every file lives somewhere under “/”. Knowing where is half the battle.</p><p>If you have ever SSH’d into a production server at 2 a.m. hunting for a log file or a misbehaving config, you already know this: navigating the Linux file system confidently is a core engineering skill.</p><p>Unlike Windows, which splits storage into drive letters (C:, D:), Linux organizes everything in a single hierarchical tree that begins at the Root directory ( / ). Files, directories, hard drives, and even hardware devices all live under this one root.</p><p>The layout is standardized by the Filesystem Hierarchy Standard (FHS), which keeps things consistent across distributions such as RHEL, Ubuntu, Debian, and Fedora. Learn it once, and it transfers everywhere.</p><p>Let’s walk through it.</p><p>🔹 1. THE CORE DIRECTORIES</p><p>▪️ / (Root): The top of the tree. Every file and directory starts here. Only the root user can write to it.</p><p>▪️ /bin (Binaries): Essential command-line programs needed for single-user mode and maintenance, such as ls, cp, cat, and bash.</p><p>▪️ /sbin (System Binaries): Administrative programs intended for the root user, such as iptables, reboot, and fdisk.</p><p>▪️ /etc (Configuration): System-wide configuration files and scripts. No binaries belong here.</p><p>▪️ /home (User Homes): Personal directories for regular users, for example /home/john.</p><p>▪️ /root (Root Home): The home directory of the root user, kept separate from /home.</p><p>💡 Good to know: On many modern distributions, /bin is simply a symbolic link to /usr/bin, and /sbin links to /usr/sbin.</p><p>💡 Why it matters: /etc is where you will spend most of your troubleshooting time. Network settings, user accounts (/etc/passwd), and service configurations all live here, which makes it the first place to look when a service misbehaves.</p><p>🔹 2. SYSTEM DATA AND RESOURCES</p><p>▪️ /usr (Unix System Resources): User-space utilities and applications. Holds read-only, shareable data: /usr/bin, /usr/lib, and /usr/share.</p><p>▪️ /var (Variable Data): Files that change constantly during normal operation: logs (/var/log), caches (/var/cache), mail spools, print queues, and databases.</p><p>▪️ /lib and /lib64 (Libraries): Shared libraries and kernel modules required by the programs in /bin and /sbin.</p><p>▪️ /opt (Optional Software): Third-party software that does not follow the standard package layout, such as Google Chrome or Zoom.</p><p>💡 Why it matters: /var/log is your best friend during incident response. When disk usage spikes unexpectedly, /var is often the culprit, since runaway logs and caches tend to pile up there.</p><p>🔹 3. TEMPORARY AND DYNAMIC FILES</p><p>▪️ /tmp (Temporary): Files created by applications or the OS. Often cleared on reboot or after a set period.</p><p>▪️ /dev (Devices): Device files that represent hardware, such as /dev/sda for a hard drive or /dev/null. In Linux, hardware is treated as files.</p><p>▪️ /proc (Process Information): A virtual file system exposing runtime system and process details as text files. It takes up no physical disk space.</p><p>▪️ /sys (System): Another virtual file system that exposes kernel, device, and driver information to userspace tools.</p><p>💡 Why it matters: /proc and /sys make Linux wonderfully transparent. You can inspect CPU details and memory usage just by reading files, which is how tools like top and ps work under the hood.</p><p>Try these: cat /proc/cpuinfo cat /proc/meminfo</p><p>🔹 4. MOUNT POINTS</p><p>▪️ /mnt (Mount): A temporary mount point traditionally used by administrators to manually mount external or secondary storage.</p><p>▪️ /media (Media): The default automatic mount point for removable media like USB drives, CDs, and external disks on desktop environments.</p><p>▪️ /srv (Service Data): Site-specific data served by your system, such as web server files (Apache) or FTP data.</p><p>💡 Why it matters: When you attach a new disk, such as an extra volume on a cloud VM, you will typically format it and mount it under a path like /mnt or a custom directory. Understanding mount points is the foundation for working with LVM, EBS volumes, and persistent storage.</p><p>Example: sudo mount /dev/sdb1 /mnt/data df -h</p><p>🔹 QUICK REFERENCE: WHERE DO I LOOK?</p><p>✅ Service misbehaving? Check /etc for config and /var/log for logs.</p><p>✅ Disk filling up? Investigate /var and /tmp.</p><p>✅ Need a third-party app’s files? Look in /opt.</p><p>✅ Debugging a process or hardware? Explore /proc, /sys, and /dev.</p><p>✅ Adding storage? Mount it under /mnt or a dedicated path.</p><p>✅ Hosting web content? Look in /srv or your web server’s defined directory.</p><p>🔹 KEY TAKEAWAYS</p><p>1️⃣ One tree, one root. Everything begins at /.</p><p>2️⃣ The FHS keeps things predictable across major distributions.</p><p>3️⃣ Separation of concerns: binaries, configs, logs, and user data each have a dedicated home.</p><p>4️⃣ Everything is a file. Even hardware and kernel data are accessible through the file system.</p><p>5️⃣ Know the hot spots: /etc, /var/log, /home, and /tmp cover most day-to-day troubleshooting.</p><p>🔹 FINAL THOUGHTS</p><p>The Linux file system may look intimidating at first, but its logic is consistent and elegant. Once you internalize what belongs where, debugging, automation, and infrastructure work all become faster and more intuitive. Whether you are managing servers, building CI/CD pipelines, or working with cloud infrastructure, this knowledge is the bedrock everything else rests on.</p><p>Which directory do you find yourself in most often when troubleshooting? Share your go-to in the comments 👇</p><p>#Linux #DevOps #SysAdmin #CloudComputing #OpenSource #RHEL #InfrastructureAsCode #TechLearning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0668e2f3f633" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debugging a Broken Nginx + PHP-FPM Pod in Kubernetes: A Practical Lesson in Volumes, ConfigMaps…]]></title>
            <link>https://medium.com/@lahiruavishka747/debugging-a-broken-nginx-php-fpm-pod-in-kubernetes-a-practical-lesson-in-volumes-configmaps-beb8c2a5ddbd?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/beb8c2a5ddbd</guid>
            <category><![CDATA[kodekloudengineer]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes-learning]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Wed, 16 Sep 2026 11:23:47 GMT</pubDate>
            <atom:updated>2026-09-16T11:23:47.026Z</atom:updated>
            <content:encoded><![CDATA[<h3>Debugging a Broken Nginx + PHP-FPM Pod in Kubernetes: A Practical Lesson in Volumes, ConfigMaps, and FastCGI</h3><p><em>A hands-on walkthrough of a real Kubernetes troubleshooting scenario, and the mental model that makes it click.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H_uRuS3GDsuQwOAAYzAIZA.png" /></figure><p>If you have ever hit a Kubernetes lab where Nginx and PHP-FPM sit in the same Pod and refuse to talk to each other, this article is for you. The goal here is not to memorize a sequence of kubectl commands. It is to actually understand what is happening, so the next multi-container Pod problem you see (and there will be one) feels familiar instead of scary.</p><p>By the end of this article you will understand Pods, containers, volumes, ConfigMaps, the Nginx-to-PHP-FPM relationship, and how to systematically debug a mount path mismatch.</p><h3>The Architecture</h3><p>The Pod in question is nginx-phpfpm, and it runs two containers side by side:</p><pre>Pod: nginx-phpfpm<br>              ┌───────────────────────────┐<br>              │                           │<br>              │  nginx-container          │<br>              │  ┌─────────────────────┐  │<br>Browser ─────►│  │       Nginx         │  │<br>              │  └──────────┬──────────┘  │<br>              │             │             │<br>              │             │ FastCGI     │<br>              │             ▼             │<br>              │  php-fpm-container        │<br>              │  ┌─────────────────────┐  │<br>              │  │      PHP-FPM        │  │<br>              │  └─────────────────────┘  │<br>              │                           │<br>              │      Shared Volume        │<br>              │      /var/www/html        │<br>              └───────────────────────────┘</pre><p>Two containers, one Pod:</p><pre>nginx-container<br>php-fpm-container</pre><p>Because they live inside the same Pod, they share a network namespace and can talk to each other over localhost. That is the entire reason this pattern exists.</p><h3>What Nginx Actually Does</h3><p>Nginx is the web server. It is the front door for every request.</p><pre>Browser<br>   ↓<br>Nginx</pre><p>For a static file like /index.html, Nginx serves it directly from disk. No drama.</p><p>For /index.php, Nginx does <strong>not</strong> execute PHP itself. It never has, and it never will. Instead, it hands the request off to PHP-FPM:</p><pre>Browser<br>   ↓<br>Nginx<br>   ↓<br>PHP-FPM<br>   ↓<br>PHP result<br>   ↓<br>Browser</pre><p>This handoff is the whole reason PHP-FPM exists.</p><h3>What PHP-FPM Actually Does</h3><p>PHP-FPM stands for <strong>PHP FastCGI Process Manager</strong>. A simple way to think about the division of labor:</p><p>Role Component Receptionist Nginx PHP worker PHP-FPM</p><p>Nginx receives GET /index.php and effectively says: <em>&quot;This is PHP. PHP-FPM, please process it.&quot;</em></p><p>The ConfigMap in this lab contains the piece that makes this possible:</p><pre>location ~ \.php$ {<br>    include fastcgi_params;<br>    fastcgi_param REQUEST_METHOD $request_method;<br>    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>    fastcgi_pass 127.0.0.1:9000;<br>}</pre><p>The line that matters most:</p><pre>fastcgi_pass 127.0.0.1:9000;</pre><p>PHP-FPM listens on port 9000, and because both containers share the Pod&#39;s network namespace, 127.0.0.1:9000 reaches PHP-FPM directly.</p><h3>The Root Directive: Where This Usually Breaks</h3><p>The ConfigMap also says:</p><pre>root /var/www/html;</pre><p>This single line is doing a lot of work. It tells Nginx: <em>“Website files live in </em><em>/var/www/html.&quot;</em></p><p>So when a browser requests /index.php, Nginx looks for it at:</p><pre>/var/www/html/index.php</pre><p>This is exactly why the lab instructs you to copy the PHP file there:</p><pre>kubectl cp /home/thor/index.php nginx-phpfpm:/var/www/html -c nginx-container</pre><p>If that path is wrong or unmounted, nothing downstream matters.</p><h3>Understanding volumeMounts</h3><p>This is where most of the confusion in this lab comes from: two containers, and seemingly two different mount paths.</p><p>A correctly configured Pod spec looks like this:</p><pre>containers:<br>- name: nginx-container<br>  volumeMounts:<br>  - name: shared-volume<br>    mountPath: /var/www/html</pre><pre>- name: php-fpm-container<br>  volumeMounts:<br>  - name: shared-volume<br>    mountPath: /var/www/html</pre><p>Both containers mount the <strong>same underlying volume</strong>:</p><pre>shared-volume<br>                     │<br>             ┌───────┴───────┐<br>             │               │<br>             ▼               ▼<br>      nginx-container   php-fpm-container<br>      /var/www/html     /var/www/html</pre><p>So when Nginx sees /var/www/html/index.php, PHP-FPM sees the exact same file at the exact same path. That shared visibility is the entire point of the volume.</p><h3>Why Two mountPaths Exist in the First Place</h3><p>Each container has its own isolated filesystem, even though they run in the same Pod:</p><pre>nginx-container            php-fpm-container<br>├── /etc                   ├── /etc<br>├── /usr                   ├── /usr<br>├── /var                   ├── /var<br>└── /var/www/html          └── /var/www/html</pre><p>They are separate filesystems by default. A shared volume is what bridges them, and each container declares where that shared volume should appear inside its own filesystem, via its own volumeMounts block.</p><h3>The Rule to Always Ask</h3><p>Whenever you see a volumeMounts block in a multi-container Pod, ask one question:</p><blockquote><strong><em>Which container does this belong to?</em></strong></blockquote><p>For example:</p><pre>- name: nginx-container<br>  volumeMounts:<br>  - name: shared-volume<br>    mountPath: /usr/share/nginx/html</pre><p>This mount belongs to nginx-container. If the task states that Nginx&#39;s document root is /var/www/html, this is the exact mount you need to investigate and likely fix.</p><h3>How to Identify the Right Mount</h3><p>Do not look at mountPath in isolation. Look at the container block it sits under.</p><pre>containers:<br>- name: nginx-container<br>  image: nginx:latest<br>  volumeMounts:<br>  - name: shared-volume<br>    mountPath: /usr/share/nginx/html</pre><pre>- name: php-fpm-container<br>  image: php:8.2-fpm<br>  volumeMounts:<br>  - name: shared-volume<br>    mountPath: /var/www/html</pre><p>Reading this correctly:</p><p>Container mountPath nginx-container /usr/share/nginx/html php-fpm-container /var/www/html</p><p>Now the mismatch becomes obvious.</p><h3>The Actual Bug in This Lab</h3><p>The ConfigMap declares:</p><pre>root /var/www/html;</pre><p>But the Nginx container’s volume was mounted at:</p><pre>mountPath: /usr/share/nginx/html</pre><p>That is the mismatch:</p><pre>Nginx configuration<br>        ↓<br>/var/www/html<br>        ❌<br>        │<br>        │ no shared volume here<br>        │<br>/usr/share/nginx/html<br>        ↑<br>        shared volume</pre><p>Nginx is asking for /var/www/html/index.php, but the shared volume, and the file you copy into it, lives somewhere Nginx never looks.</p><h3>The Correct Relationship</h3><p>What you actually want is a straight, unbroken chain:</p><pre>nginx.conf<br>    │<br>    │ root<br>    ▼<br>/var/www/html<br>    ▲<br>    │<br>    │ volume mounted here<br>    │<br>shared-volume<br>    │<br>    ├── index.php<br>    │<br>    └── other website files</pre><p>To get there, the Nginx container’s mount needs to be:</p><pre>volumeMounts:<br>- name: shared-volume<br>  mountPath: /var/www/html</pre><h3>Why You Don’t Just Change Every mountPath</h3><p>Because mountPath is scoped to a specific container, and changing the wrong one fixes nothing (or breaks something else).</p><pre>containers:<br>- name: nginx-container<br>  volumeMounts:<br>  - mountPath: /usr/share/nginx/html</pre><pre>- name: php-fpm-container<br>  volumeMounts:<br>  - mountPath: /var/www/html</pre><p>The problem statement is specifically about <strong>Nginx’s</strong> document root, so the investigation path is:</p><pre>nginx-container → volumeMounts → mountPath</pre><p>PHP-FPM’s configuration is untouched. Editing it would be solving a problem that does not exist.</p><h3>Breaking Down kubectl cp</h3><p>This command has more moving parts than it looks like:</p><pre>kubectl cp /home/thor/index.php nginx-phpfpm:/var/www/html -c nginx-container</pre><p>Part Meaning /home/thor/index.php Source file, on the jump host nginx-phpfpm Destination Pod /var/www/html Destination directory inside the container -c nginx-container Destination container (Pods can have more than one)</p><p>Read it as a sentence: <em>copy </em><em>index.php from the jump host into </em><em>/var/www/html, inside the </em><em>nginx-container of Pod </em><em>nginx-phpfpm.</em></p><h3>A Debugging Process You Can Reuse</h3><p>Don’t start editing YAML on instinct. Work through it methodically.</p><h3>Step 1: Identify the objects</h3><pre>kubectl get pods<br>kubectl get configmap</pre><p>You should see:</p><pre>Pod<br>└── nginx-phpfpm</pre><pre>ConfigMap<br>└── nginx-config</pre><h3>Step 2: Inspect the configuration</h3><pre>kubectl describe configmap nginx-config</pre><p>Look for the root directive:</p><pre>root /var/www/html;</pre><p>That is your expected document root, and your ground truth for the rest of the debugging session.</p><h3>Step 3: Inspect the Pod spec</h3><pre>kubectl get pod nginx-phpfpm -o yaml</pre><p>Find the containers list, locate nginx-container, and read its volumeMounts block.</p><h3>Step 4: Compare</h3><pre>Nginx root                 Volume mount</pre><pre>/var/www/html        VS    /usr/share/nginx/html</pre><p>A mismatch here is the bug.</p><h3>Step 5: Fix the mount</h3><p>Update the Nginx container’s mountPath from /usr/share/nginx/html to /var/www/html.</p><h3>Step 6: Recreate the Pod</h3><pre>kubectl replace -f /tmp/nginx.yaml --force</pre><h3>Step 7: Copy the PHP file</h3><pre>kubectl cp /home/thor/index.php nginx-phpfpm:/var/www/html -c nginx-container</pre><h3>Step 8: Verify</h3><pre>kubectl exec nginx-phpfpm -c nginx-container -- ls -l /var/www/html<br>kubectl exec nginx-phpfpm -c nginx-container -- nginx -t</pre><p>If the file is listed and the config test passes, the request path is complete end to end.</p><h3>Core Concepts Recap</h3><p>Concept Simple meaning Pod Smallest deployable unit in Kubernetes Container An application process running inside a Pod ConfigMap Stores configuration data outside the container image Volume Storage that can be shared across containers or persisted volumeMount Where a volume gets attached inside a specific container mountPath The directory the volume appears at Nginx Web server, handles the incoming HTTP request PHP-FPM Executes PHP code FastCGI The protocol Nginx and PHP-FPM use to communicate kubectl cp Copies files between a local machine and a container kubectl exec Runs a command inside a running container</p><h3>The One Rule Worth Remembering</h3><blockquote><strong><em>Configuration path and volume mount path must agree with each other.</em></strong></blockquote><p>Every debugging session in this lab collapses down to one chain:</p><pre>nginx.conf<br>    ↓<br>root /var/www/html<br>    ↓<br>Nginx expects files here<br>    ↓<br>Nginx volume must be mounted here<br>    ↓<br>/var/www/html<br>    ↓<br>index.php</pre><p>Once that chain is intact end to end, the task stops being a puzzle about kubectl replace and kubectl cp syntax. It becomes a straightforward application of a mental model you now own, and that model transfers directly to any sidecar or shared-volume pattern you meet next: log shippers, static asset containers, init containers that pre-populate data, all of it.</p><p><em>If this kind of multi-container debugging walkthrough is useful, I write regularly about Kubernetes and DevOps fundamentals from a learner’s perspective. Follow along for more.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=beb8c2a5ddbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Azure Network Security Groups (NSGs): A Practical Guide to Securing Azure Networks]]></title>
            <link>https://medium.com/@lahiruavishka747/azure-network-security-groups-nsgs-a-practical-guide-to-securing-azure-networks-8dca267e12d6?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dca267e12d6</guid>
            <category><![CDATA[network-security-group]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Thu, 13 Aug 2026 16:38:29 GMT</pubDate>
            <atom:updated>2026-08-13T16:38:29.296Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>When you deploy an application on Microsoft Azure, network security is one of the first things you need to think about.</p><p>Your app might run on Virtual Machines, containers, or databases but just placing them inside a Virtual Network (VNet) does not make them secure by default. You still need a way to control who can talk to your resources, and who cannot.</p><p>This is exactly what <strong>Azure Network Security Groups (NSGs)</strong> are for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMzE2yt7JqXwYsWwbhAWLw.png" /></figure><p>An NSG works like a <strong>basic firewall at the network layer</strong>. It decides which traffic is allowed in, and which traffic is allowed out, of your Azure resources. If you’re working toward a career in DevOps or Cloud Engineering, NSGs are one of the first networking concepts you should master, because they show up in almost every Azure architecture.</p><h3>What Is an Azure Network Security Group?</h3><p>An NSG is a set of security rules that controls <strong>inbound and outbound traffic</strong> to your Azure resources.</p><p>Picture a simple web server:</p><pre>Internet<br>    |<br>    | HTTP : 80<br>    v<br>+------------------+<br>|   Azure VM       |<br>|   Web Server     |<br>+------------------+</pre><p>For this server, you probably want:</p><ul><li>HTTP traffic → Allowed</li><li>HTTPS traffic → Allowed</li><li>SSH → Allowed only for administrators</li><li>Everything else → Denied</li></ul><p>An NSG lets you define exactly these kinds of rules.</p><h3>Where Can You Apply an NSG?</h3><p>An NSG can be attached to two different places:</p><p><strong>1. A Subnet</strong></p><pre>Virtual Network<br>│<br>├── Web Subnet     → NSG<br>├── App Subnet     → NSG<br>└── Database Subnet → NSG</pre><p>This controls traffic for every resource inside that subnet.</p><p><strong>2. A Network Interface (NIC)</strong></p><pre>Azure VM<br>   |<br>   └── NIC<br>        |<br>        └── NSG</pre><p>This gives you more precise, per-resource control.</p><p>You can use one, or both, depending on how tightly you want to control traffic.</p><h3>How an NSG Rule Works</h3><p>Every NSG is made up of individual <strong>security rules</strong>. Each rule defines:</p><ul><li>Source</li><li>Source port</li><li>Destination</li><li>Destination port</li><li>Protocol</li><li>Direction</li><li>Priority</li><li>Action</li></ul><p>Here’s an example rule that allows web traffic:</p><pre>Rule: Allow-HTTP<br>Source:              0.0.0.0/0<br>Source Port:         *<br>Destination:         *<br>Destination Port:    80<br>Protocol:            TCP<br>Direction:           Inbound<br>Priority:            100<br>Action:              Allow</pre><p>This means: allow any device on the internet to reach this resource on port 80 using TCP.</p><h3>Inbound vs Outbound Traffic</h3><p><strong>Inbound traffic</strong> is traffic coming <em>into</em> your resource.</p><pre>Internet --TCP 80--&gt; Azure VM</pre><p>Common inbound rules:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8IdyJC8whnOu5LDqo9IfNA.png" /></figure><p><strong>Outbound traffic</strong> is traffic <em>leaving</em> your resource.</p><pre>Azure VM --TCP 443--&gt; Internet</pre><p>Outbound rules matter too a resource that is well protected on the inbound side can still leak data if outbound traffic isn’t controlled.</p><h3>The Building Blocks of an NSG Rule</h3><p><strong>Source</strong> :where the traffic comes from. It can be an IP range, a specific IP, a Service Tag, or an Application Security Group.</p><p><strong>Destination</strong> :where the traffic is headed. Same options as source: Any, IP, Subnet, Service Tag, or Application Security Group.</p><p><strong>Port:</strong>the network service being targeted:</p><p>Service Port HTTP 80 HTTPS 443 SSH 22 RDP 3389 DNS 53 MySQL 3306 PostgreSQL 5432</p><p><strong>Protocol : </strong>TCP, UDP, ICMP, or Any. Most web traffic uses TCP.</p><p><strong>Priority</strong> : a number that decides the order rules are checked. <strong>Lower numbers are checked first.</strong> So a rule with priority 100 is evaluated before a rule with priority 200.</p><p><strong>Action</strong> : the rule either <strong>Allows</strong> or <strong>Denies</strong> the traffic.</p><h3>Example: Securing a Web Server</h3><p>Say you have a web server and you want:</p><ul><li>HTTP allowed</li><li>HTTPS allowed</li><li>SSH allowed only from your own IP</li><li>Everything else blocked</li></ul><p>Your rule set might look like this:</p><p>Priority Name Port Protocol Source Action 100 Allow-HTTP 80 TCP Internet Allow 110 Allow-HTTPS 443 TCP Internet Allow 120 Allow-SSH 22 TCP Admin IP Allow</p><p>Azure’s built-in default rules take care of everything not covered above.</p><h3>Default Rules and Rule Evaluation</h3><p>Azure automatically adds a set of <strong>default rules</strong> to every NSG for VNet traffic, Azure Load Balancer traffic, and general internet traffic.</p><p><strong>Your custom rules are always evaluated before the default rules.</strong></p><pre>Custom Rule (Priority 100)<br>     ↓<br>Custom Rule (Priority 200)<br>     ↓<br>Default Rules (Priority 65000+)</pre><p>You rarely need to touch the default rules directly.</p><p>When two rules conflict, the lower priority number wins. For example:</p><pre>Priority 100 → Allow TCP 22<br>Priority 200 → Deny TCP 22</pre><p>Here, SSH is <strong>allowed</strong>, because 100 is checked before 200 and Azure stops at the first match. This is why getting your priorities right matters so much a small mistake here can silently block or allow traffic you didn’t intend.</p><h3>NSG vs Azure Firewall</h3><p>Both tools filter traffic, but they solve different problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SIjdPqBI-wa70KK_tnysTA.png" /></figure><p><strong>NSGs</strong> are best for basic access control at the subnet or NIC level. <strong>Azure Firewall</strong> is built for centralized control, application-aware rules, and threat intelligence. In real architectures, they’re often used together rather than as alternatives.</p><h3>Application Security Groups (ASGs)</h3><p>Instead of writing rules against individual IP addresses, you can group resources by role using an <strong>Application Security Group</strong>.</p><pre>ASG: WebServers<br>       ├── Web VM 1<br>       ├── Web VM 2<br>       └── Web VM 3</pre><pre>ASG: AppServers<br>       ├── App VM 1<br>       └── App VM 2</pre><p>Now you can write a rule like:</p><pre>WebServers → AppServers : TCP 8080</pre><p>This is much easier to maintain than a list of IP addresses, especially as your infrastructure grows or changes.</p><h3>A Typical Three-Tier Architecture</h3><pre>Internet<br>                    |<br>              +-------------+<br>              | Load Balancer|<br>              +-------------+<br>                    |<br>        +-----------------------+<br>        |     Web Subnet        |<br>        |   Web Server 1/2      |<br>        +-----------------------+<br>                    | TCP 8080<br>        +-----------------------+<br>        |     App Subnet        |<br>        |   App Server 1/2      |<br>        +-----------------------+<br>                    | TCP 5432<br>        +-----------------------+<br>        |      DB Subnet        |<br>        |     PostgreSQL        |<br>        +-----------------------+</pre><p>Rules for this design:</p><pre>Internet → Web  : 80/443   (Allow)<br>Web      → App  : 8080     (Allow)<br>App      → DB   : 5432     (Allow)<br>Internet → DB   : —        (Deny)</pre><p>This layout follows the <strong>principle of least privilege</strong> each tier can only reach the tier it actually needs to talk to.</p><h3>The Principle of Least Privilege</h3><p>A simple rule to live by:</p><blockquote><em>Allow only the traffic that is actually required nothing more.</em></blockquote><p>For example, don’t expose your database directly to the internet:</p><pre>Internet → PostgreSQL : 5432   ❌</pre><p>Instead, only let the app tier reach it:</p><pre>App Subnet → Database : 5432   ✅</pre><p>The same logic applies to SSH avoid opening it to the whole internet:</p><pre>Internet     → SSH : 22   ❌<br>Trusted IP   → SSH : 22   ✅</pre><p>This one habit removes a large chunk of the attack surface on any Azure deployment.</p><h3>Creating an NSG with Azure CLI</h3><p>As a DevOps engineer, you’ll usually manage NSGs through code rather than the portal. Here’s how to do it with the Azure CLI.</p><p>Create the NSG:</p><pre>az network nsg create \<br>  --resource-group myResourceGroup \<br>  --name xfusion-nsg</pre><p>Add an HTTP rule:</p><pre>az network nsg rule create \<br>  --resource-group myResourceGroup \<br>  --nsg-name xfusion-nsg \<br>  --name Allow-HTTP \<br>  --protocol Tcp \<br>  --priority 100 \<br>  --direction Inbound \<br>  --access Allow \<br>  --source-address-prefixes 0.0.0.0/0 \<br>  --destination-port-ranges 80</pre><p>Add an SSH rule:</p><pre>az network nsg rule create \<br>  --resource-group myResourceGroup \<br>  --nsg-name xfusion-nsg \<br>  --name Allow-SSH \<br>  --protocol Tcp \<br>  --priority 110 \<br>  --direction Inbound \<br>  --access Allow \<br>  --source-address-prefixes 0.0.0.0/0 \<br>  --destination-port-ranges 22</pre><h3>Managing NSGs with Terraform</h3><p>For a DevOps workflow, NSGs are best managed as code — version-controlled in Git and deployed automatically, instead of clicked together manually in the portal.</p><pre>resource &quot;azurerm_network_security_group&quot; &quot;example&quot; {<br>  name                = &quot;xfusion-nsg&quot;<br>  location            = azurerm_resource_group.example.location<br>  resource_group_name = azurerm_resource_group.example.name</pre><pre>  security_rule {<br>    name                       = &quot;Allow-HTTP&quot;<br>    priority                   = 100<br>    direction                  = &quot;Inbound&quot;<br>    access                     = &quot;Allow&quot;<br>    protocol                   = &quot;Tcp&quot;<br>    source_port_range          = &quot;*&quot;<br>    destination_port_range     = &quot;80&quot;<br>    source_address_prefix      = &quot;0.0.0.0/0&quot;<br>    destination_address_prefix = &quot;*&quot;<br>  }</pre><pre>  security_rule {<br>    name                       = &quot;Allow-SSH&quot;<br>    priority                   = 110<br>    direction                  = &quot;Inbound&quot;<br>    access                     = &quot;Allow&quot;<br>    protocol                   = &quot;Tcp&quot;<br>    source_port_range          = &quot;*&quot;<br>    destination_port_range     = &quot;22&quot;<br>    source_address_prefix      = &quot;0.0.0.0/0&quot;<br>    destination_address_prefix = &quot;*&quot;<br>  }<br>}</pre><p>This is where NSGs become genuinely useful in a DevOps context they can be reviewed in a pull request, tested, and rolled out the same way as any other piece of infrastructure.</p><h3>Common NSG Mistakes to Avoid</h3><ol><li><strong>Opening SSH to the entire internet</strong> (0.0.0.0/0 → TCP 22). It works, but it&#39;s risky. Restrict it to a trusted IP whenever possible.</li><li><strong>Getting rule priority wrong.</strong> A higher-priority deny rule can silently block traffic you meant to allow.</li><li><strong>Forgetting outbound rules.</strong> Security isn’t only about what comes in.</li><li><strong>Treating NSGs as a full replacement for Azure Firewall.</strong> NSGs handle basic filtering — they’re not built for deep traffic inspection.</li><li><strong>Not understanding subnet vs NIC association.</strong> When NSGs exist at both levels, knowing how Azure evaluates them is key to troubleshooting.</li></ol><h3>Troubleshooting Checklist</h3><p>When a VM can’t reach another resource, work through this list:</p><ol><li>Is the NSG attached to the subnet?</li><li>Is the NSG attached to the NIC?</li><li>Is the required port actually allowed?</li><li>Is the protocol correct?</li><li>Is the source IP correct?</li><li>Is another rule denying the traffic first?</li><li>What’s the rule’s priority?</li><li>Are Azure’s default rules involved?</li><li>Is the application actually listening on that port?</li><li>Is the OS-level firewall blocking it too?</li></ol><p>Remember that traffic passes through several layers before reaching your app:</p><pre>Internet → Azure NSG → Network Interface → OS Firewall → Application</pre><p>Allowing a port in the NSG doesn’t guarantee the traffic will actually reach your application every layer needs to agree.</p><h3>Key Takeaways</h3><ul><li><strong>NSG</strong> = network traffic filter for Azure resources</li><li><strong>Inbound</strong> = traffic coming in, <strong>Outbound</strong> = traffic going out</li><li><strong>Lower priority number = higher priority</strong></li><li>Rules either <strong>Allow</strong> or <strong>Deny</strong> traffic</li><li>NSGs attach to <strong>subnets</strong> and/or <strong>network interfaces</strong></li><li>Always apply the <strong>principle of least privilege</strong></li><li>Don’t expose sensitive services (databases, SSH) directly to the internet</li><li>NSGs can be managed via Portal, CLI, PowerShell, or Terraform</li></ul><h3>Conclusion</h3><p>NSGs might look simple on the surface, but they’re one of the foundational building blocks of Azure network security. As soon as your architecture grows to include VMs, VNets, load balancers, app servers, databases, or Kubernetes clusters, NSGs are working quietly in the background to keep traffic where it should be.</p><p>As I continue building my DevOps and Cloud skills, understanding tools like NSGs is a reminder that the goal isn’t just to make an application <em>reachable</em> it’s to make it <strong>reachable securely</strong>.</p><p><strong>Build infrastructure that works. Build it securely. Automate it consistently.</strong></p><p>#Azure #MicrosoftAzure #CloudComputing #DevOps #CloudSecurity #Networking #NetworkSecurity #NSG #InfrastructureAsCode #Terraform #AzureDevOps #DevOpsEngineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dca267e12d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon S3 Deep Dive: The Storage Layer Behind Half the Internet]]></title>
            <link>https://medium.com/@lahiruavishka747/amazon-s3-deep-dive-the-storage-layer-behind-half-the-internet-3668ee347111?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/3668ee347111</guid>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[s3]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 15:09:34 GMT</pubDate>
            <atom:updated>2026-08-06T15:09:34.842Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOs0gsDCvHpGv34FsTWP2Q.png" /></figure><p>If you’ve worked in cloud infrastructure for more than a week, you’ve touched Amazon S3, often without thinking twice about it. It’s the quiet backbone behind data lakes, backup pipelines, static sites, and half the SaaS products we use daily.</p><p>But most engineers know S3 at the surface level: “it’s where you put files.” Underneath that simplicity is a storage architecture engineered for 99.999999999% durability, near infinite scale, and a feature set that spans security, cost optimization, and event driven automation.</p><p>Here’s the deep dive I wish I’d had when I started working with it.</p><h3>Object Storage, Not File Storage</h3><p>S3 doesn’t behave like the file systems most of us grew up with. There’s no real directory tree under the hood. Every object lives flat inside a bucket, identified by a unique <strong>key</strong>.</p><p>Each object is really three things bundled together:</p><ul><li><strong>The data itself</strong>: your image, video, backup file, or dataset</li><li><strong>Metadata</strong>: content type, size, creation date, encryption settings</li><li><strong>A unique key</strong>: the object’s full “path,” e.g. travel/japan/tokyo.jpg</li></ul><p>That folder structure you see in the AWS Console? It’s an illusion built entirely from prefixes in the key name. images/logo.png isn&#39;t a file inside a folder, it&#39;s one flat object whose key happens to contain a /.</p><h3>The Architecture, Top to Bottom</h3><p>The hierarchy is refreshingly simple:</p><p><strong>AWS Account &gt; Bucket &gt; Objects &gt; Metadata</strong></p><p>A <strong>bucket</strong> is a globally unique, region scoped container. Names must be 3–63 characters, lowercase, and hyphen friendly (no spaces, no uppercase, no underscores). Every bucket lives in a specific <strong>AWS Region</strong>, and that choice isn’t cosmetic. It directly affects latency, data residency obligations, cost, and your disaster recovery posture.</p><p>Individual <strong>objects</strong> can scale up to 5 TB in size. Anything north of roughly 100 MB is typically pushed through <strong>Multipart Upload</strong>, which splits the file into parts uploaded in parallel: faster, more resilient to network hiccups, and resumable if a transfer drops mid flight.</p><h3>What Makes S3 Genuinely Hard to Beat</h3><p>A few architectural guarantees are worth calling out specifically because they’re easy to take for granted:</p><p><strong>Eleven nines of durability.</strong> S3 redundantly stores objects across multiple devices within a region, making data loss statistically negligible. This is why it’s trusted for compliance archives and business critical backups alike.</p><p><strong>Strong read after write consistency.</strong> Every read, whether it’s a new object or an overwrite, reflects the latest write immediately. No eventual consistency surprises to design around.</p><p><strong>Event driven by design.</strong> S3 can trigger Lambda, SNS, SQS, or EventBridge the moment an object lands. Upload an image, Lambda resizes it, the thumbnail lands back in the bucket. This pattern alone powers a huge share of serverless architectures in production today.</p><h3>Storage Classes: Matching Cost to Access Pattern</h3><p>This is where S3 really separates itself from “just a bucket to dump files in.” Instead of one price tier, AWS gives you a spectrum:</p><p>Storage Class Best For Retrieval <strong>S3 Standard</strong> Frequently accessed, hot data Instant, no charge <strong>Intelligent-Tiering</strong> Unpredictable access patterns Auto optimized, small monitoring fee <strong>Standard-IA</strong> Infrequent access, must stay available Instant, retrieval fee applies <strong>One Zone-IA</strong> Recreatable/secondary copies Instant, lower resilience (single AZ) <strong>Glacier Instant Retrieval</strong> Archives needing millisecond access Instant, retrieval fee applies <strong>Glacier Flexible Retrieval</strong> Long-term backups Minutes to hours <strong>Glacier Deep Archive</strong> Compliance/legal retention Up to 12 hours</p><p>The underrated one here is <strong>Intelligent-Tiering</strong>. It removes the guesswork entirely by auto shifting objects between tiers based on actual usage, no lifecycle rule engineering required.</p><h3>Governance Features That Actually Save You in Production</h3><p><strong>Versioning</strong> keeps a full history of every object, so an accidental overwrite or delete is recoverable, not catastrophic. Pair it with <strong>Lifecycle Policies</strong> to automatically age data down the cost curve: say, Standard for 30 days, Standard-IA for the next 60, Glacier after 90, deletion after a year, all without manual intervention.</p><p><strong>Replication</strong> adds resilience across two dimensions:</p><ul><li><strong>Same-Region Replication (SRR)</strong>: for log aggregation, dev/test environments, or sharing data across teams</li><li><strong>Cross-Region Replication (CRR)</strong>: for disaster recovery, regulatory requirements, or cutting latency for a globally distributed user base</li></ul><h3>Security: Layered, Not Optional</h3><p>S3 security is built in layers, and knowing which tool to reach for matters:</p><ul><li><strong>IAM policies</strong>: control what a specific user or role can do</li><li><strong>Bucket policies</strong>: JSON based, resource level rules (e.g., enforce HTTPS only access, restrict uploads to encrypted objects)</li><li><strong>ACLs</strong>: the legacy mechanism; AWS now recommends IAM and bucket policies over ACLs for new workloads</li><li><strong>Block Public Access</strong>: should stay enabled by default unless you have an explicit, reviewed reason not to</li></ul><p>On encryption, you’ve got four options depending on how much control you need: <strong>SSE-S3</strong> (AWS managed keys, simplest), <strong>SSE-KMS</strong> (customer managed keys with full audit trail via CloudTrail), <strong>SSE-C</strong> (you supply the key), or <strong>client side encryption</strong> (encrypted before it ever leaves your application).</p><h3>Performance Levers Worth Knowing</h3><ul><li><strong>Multipart Upload</strong>: parallelized, resumable uploads for large objects</li><li><strong>Transfer Acceleration</strong>: routes traffic through AWS’s edge network for faster long distance uploads/downloads</li><li><strong>Byte-Range Fetches</strong>: pull just a slice of an object, critical for video streaming or partial reads on large datasets</li></ul><h3>Where S3 Actually Shows Up</h3><p>Data lakes, static website hosting behind CloudFront, backup and DR targets, CloudTrail/ELB/VPC Flow Log storage, ML training datasets, software artifact repositories, IoT ingestion: S3 is rarely the star of the architecture diagram, but it’s almost always load bearing.</p><h3>The Practical Checklist</h3><p>If I had to compress this into what actually matters day to day:</p><ul><li>Enable <strong>Versioning</strong> before you need it, not after an incident</li><li>Leave <strong>Block Public Access</strong> on unless there’s a documented reason to turn it off</li><li>Default to <strong>SSE-KMS</strong> for anything sensitive, you get the audit trail for free</li><li>Let <strong>Lifecycle Policies</strong> do the cost optimization instead of manual cleanup scripts</li><li>Turn on <strong>CloudTrail Data Events</strong> or <strong>Server Access Logging</strong> for anything audit relevant</li><li>Use <strong>S3 Storage Lens</strong> to actually see your usage patterns instead of guessing</li></ul><p>S3 looks deceptively simple from the outside, “just a bucket.” But the depth is in the details: consistency guarantees, storage class economics, replication topology, and security layering. Getting these right is often the difference between an architecture that just works and one that scales cleanly, stays compliant, and doesn’t blow up the cloud bill.</p><p>What’s the S3 feature or gotcha you wish more engineers understood before their first production incident? Drop it in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3668ee347111" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop re-Googling the same Terraform commands every time a pipeline breaks or a state file locks. ]]></title>
            <link>https://medium.com/@lahiruavishka747/stop-re-googling-the-same-terraform-commands-every-time-a-pipeline-breaks-or-a-state-file-locks-7e37853a7d88?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e37853a7d88</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cheatsheet]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 16:08:01 GMT</pubDate>
            <atom:updated>2026-07-28T16:08:01.621Z</atom:updated>
            <content:encoded><![CDATA[<p>Bookmark this it’s the Terraform CLI cheatsheet I keep coming back to as a DevOps/Cloud engineer. 📌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ioov2O2uUjhKKAN-kfN7bA.png" /></figure><p><strong>🛠️ The Daily Workflow</strong></p><ul><li>terraform init → Prep the directory &amp; pull provider plugins</li><li>terraform fmt -recursive → Auto-format code to HCL standards</li><li>terraform validate → Catch syntax &amp; structural issues early</li><li>terraform plan -out=tfplan → Dry-run changes, save the plan</li><li>terraform apply &quot;tfplan&quot; → Deploy exactly what was reviewed</li></ul><p><strong>🔍 Inspection &amp; Debugging</strong></p><ul><li>terraform state list → See every resource in state</li><li>terraform state show &lt;resource&gt; → Inspect a resource&#39;s live attributes</li><li>terraform console → Test expressions &amp; functions interactively</li><li>terraform graph | dot -Tpng &gt; graph.png → Visualize the dependency tree</li></ul><p><strong>⚡ Troubleshooting &amp; State Management</strong></p><ul><li>terraform taint &lt;resource&gt; → Force destroy + recreate on next apply</li><li>terraform import &lt;res_addr&gt; &lt;cloud_id&gt; → Bring existing infra under IaC</li><li>terraform state rm &lt;resource&gt; → Drop from state, keep the real resource</li><li>terraform force-unlock &lt;LOCK_ID&gt; → Break a stuck S3/DynamoDB lock (last resort)</li></ul><p><strong>💡 3 production habits worth stealing:</strong></p><ol><li>Run terraform fmt in pre-commit hooks or CI never skip it</li><li>Always use a locking remote backend (S3+DynamoDB, Azure Blob, GCS) no exceptions</li><li>Treat -target as an emergency escape hatch, not a workflow</li></ol><p>Save this for your next deploy. 🔖</p><p>What’s your go-to command when a Terraform run goes sideways? Drop it below 👇</p><p>#DevOps #Terraform #InfrastructureAsCode #CloudComputing #AWS #Azure #GCP #SRE #HashiCorp</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e37853a7d88" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux LVM: A Practical Guide to Logical Volume Management on RHEL 9]]></title>
            <link>https://medium.com/@lahiruavishka747/linux-lvm-a-practical-guide-to-logical-volume-management-on-rhel-9-2c5b0b4cc8ef?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c5b0b4cc8ef</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[lvm]]></category>
            <category><![CDATA[red-hat]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[logical-volume-management]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Sun, 19 Jul 2026 12:22:51 GMT</pubDate>
            <atom:updated>2026-07-19T12:32:47.217Z</atom:updated>
            <content:encoded><![CDATA[<p>Storage management is one of those skills that separates a Linux administrator from a Linux operator. Anyone can format a disk and mount it but knowing how to build a storage layer that can grow, shrink, and adapt without downtime is what makes you valuable in a production environment.</p><p>In this article, I’ll walk through <strong>Logical Volume Management (LVM)</strong> on <strong>RHEL 9</strong> what it is, why it matters, and how to build one from scratch using a real, hands-on example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xMVY7Cu56WHPi1z2_iHDZQ.png" /></figure><h3>What Is Logical Volume Management (LVM)?</h3><p>Traditional disk partitioning is rigid. Once you create a partition like /dev/sdb1, its size is essentially fixed resizing it later is risky and often requires downtime or data migration.</p><p><strong>LVM (Logical Volume Manager)</strong> solves this problem by adding a flexible abstraction layer between your physical disks and the filesystems your system actually uses. Instead of applications and mount points depending directly on a physical partition, they depend on a <em>logical volume</em> — which can be resized, moved, or extended across multiple physical disks with minimal disruption.</p><p>LVM works through three core building blocks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YkpH7nmZIWYvkQPETpl6LA.png" /></figure><p>This layered architecture is what gives LVM its power: storage capacity becomes a pool of resources you can allocate, reclaim, and reorganize on demand rather than fixed slices of disk you’re stuck with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogjz3YYUn8heGoZQXJPQiA.png" /></figure><h3>Why Use LVM?</h3><p>Before diving into the commands, it’s worth understanding <em>why</em> LVM is the standard in enterprise Linux environments:</p><ul><li><strong>Dynamic resizing</strong> -Extend or reduce logical volumes without unmounting the filesystem (in most cases)</li><li><strong>Multiple disk support</strong> -A single volume group can span multiple physical disks, letting you grow storage beyond a single device’s limit</li><li><strong>Snapshots</strong> -Take point-in-time snapshots of a volume for backups or testing</li><li><strong>Flexible naming and organization</strong> -Group and label volumes logically (e.g., by application or environment)</li><li><strong>No downtime for growth</strong> -Ideal for production systems like databases and application servers that can’t tolerate long maintenance windows</li></ul><p>Now let’s build one.</p><h3>Step 1: Create a Disk Partition</h3><p>Before LVM can use a disk, it needs a partition (or the whole disk) marked with the correct type. In this example, I’m working with a 15GB partition carved out of /dev/sdb, which will become /dev/sdb2.</p><p>Run fdisk against the target disk:</p><pre>fdisk /dev/sdb</pre><p>Inside the interactive fdisk prompt:</p><ol><li>Type n to create a new partition</li><li>Select p for a <strong>primary</strong> partition</li><li>Press <strong>Enter</strong> to accept the default first sector</li><li>Type +15G for the last sector, allocating 15GB to this partition</li><li>Press t to change the partition type, and set it to 8e (Linux LVM)</li><li>Press w to write the changes and exit</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*5DLhFLctGIEYMlvZxFplxA.png" /></figure><p>Once the partition is created, confirm it with a tree view of your block devices:</p><pre>lsblk</pre><p>This will confirm that /dev/sdb2 exists and is sized correctly, ready to be handed over to LVM.</p><h3>Step 2: Create a Physical Volume (PV)</h3><h3>What Is a Physical Volume?</h3><p>A <strong>Physical Volume (PV)</strong> is the foundational layer of LVM. It’s simply a disk or partition that has been initialized with an LVM header, allowing the LVM subsystem to recognize and manage it. Think of a PV as the raw material LVM pulls from when building storage pools every volume group is made up of one or more PVs.</p><p>Initialize /dev/sdb2 as a physical volume:</p><pre>pvcreate /dev/sdb2</pre><p>Verify the newly created PV:</p><pre>pvs</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*_J7StQQTQ0VxXLc07GzcrA.png" /></figure><h3>Step 3: Create a Volume Group (VG)</h3><h3>What Is a Volume Group?</h3><p>A <strong>Volume Group (VG)</strong> is a storage pool formed by combining one or more physical volumes into a single unit of manageable capacity. Once PVs are grouped into a VG, LVM no longer cares which physical disk the storage originally came from it treats the VG as one continuous pool. This is what enables you to later add more disks to expand the pool, or carve out multiple logical volumes from the same group.</p><p>Create a volume group named vg_app using the physical volume from Step 2:</p><pre>vgcreate vg_app /dev/sdb2</pre><p>Confirm the volume group was created successfully:</p><pre>vgs</pre><h3>Step 4: Create a Logical Volume (LV)</h3><p>With a volume group in place, we can now carve out a <strong>Logical Volume (LV)</strong> the actual “partition-like” object that gets formatted and mounted. A VG’s full capacity doesn’t have to be allocated at once; you can create multiple LVs from the same group and leave the rest as free space for future growth.</p><p>In this case, I’m allocating 10GB out of the 15GB available in vg_app:</p><pre>lvcreate -L 10G -n lv_app vg_app</pre><p>Verify the logical volume:</p><pre>lvs</pre><p>And confirm it in the block device tree:</p><pre>lsblk</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*NC8mJyYuI5AQ2yIwI99i5Q.png" /></figure><h3>Step 5: Format and Mount the Logical Volume</h3><h3>Get the Logical Volume Path</h3><p>Before formatting, retrieve the full device path of the LV:</p><pre>lvdisplay</pre><p>This will output details including the LV path (typically something like /dev/vg_app/lv_app).</p><h3>Format the Volume</h3><p>Format the logical volume with the ext4 filesystem:</p><pre>mkfs.ext4 /dev/vg_app/lv_app</pre><h3>Retrieve the UUID</h3><p>Every filesystem gets a unique identifier (UUID), which is the recommended way to reference it in /etc/fstab (rather than the device path, which can change):</p><pre>blkid</pre><p>Copy the UUID associated with /dev/vg_app/lv_app you&#39;ll need it in the next step.</p><h3>Create the Mount Point</h3><pre>mkdir /App</pre><h3>Configure Persistent Mounting via /etc/fstab</h3><p>To ensure the volume mounts automatically on every boot, edit the fstab file:</p><pre>vim /etc/fstab</pre><p>Add a new line with the following format:</p><pre>UUID=&lt;your-uuid-here&gt;   /App   ext4   defaults   0   0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*w2WUISm2im9GMmPLl6eWpA.png" /></figure><p>Then mount it immediately (without rebooting) to confirm it works:</p><pre>mount -a</pre><p>Verify with:</p><pre>df -h /App</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*xQVE3UbEVORsd1H64-8Dzg.png" /></figure><h3>Wrapping Up</h3><p>At this point, we’ve successfully built a complete LVM stack from the ground up on RHEL 9:</p><p><strong>Disk partition → Physical Volume → Volume Group → Logical Volume → Formatted &amp; Mounted Filesystem</strong></p><p>This gives /App the flexibility to grow later without the constraints of a traditional fixed partition. In a follow-up article, I&#39;ll cover how to <strong>extend and reduce</strong> logical volumes on the fly, including resizing the underlying filesystem, which is where LVM really proves its value in production environments.</p><p>If you’re preparing for RHCSA or working toward a DevOps/cloud engineering role, LVM is a foundational skill worth mastering it comes up constantly in real-world Linux administration, from database servers to containerized storage backends.</p><p>#Linux #RHEL #LVM #DevOps #SysAdmin #CloudEngineering #RedHat #LinuxAdministration</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c5b0b4cc8ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Git Push to Production: A Practical Guide to Jenkins Pipelines]]></title>
            <link>https://medium.com/@lahiruavishka747/from-git-push-to-production-a-practical-guide-to-jenkins-pipelines-db4944e4fd77?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/db4944e4fd77</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[jenkins-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Thu, 16 Jul 2026 17:13:43 GMT</pubDate>
            <atom:updated>2026-07-16T17:13:43.957Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><em>Jenkins is not just a CI/CD tool it is the automation engine that transforms manual software delivery into a reliable, repeatable, and scalable process.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2MFlAywjW3x92Z2DtVWNg.png" /></figure><p>Every team eventually hits the same wall: manual deployments. Someone SSHs into a server at 11 PM, runs a script they half-remember, and hopes nothing breaks. It works until it doesn’t. This is the exact problem Jenkins was built to solve, and understanding <em>how</em> it solves it is fundamental to working in any modern DevOps environment.</p><p>This article walks through the core concepts every DevOps engineer, SRE, or backend developer should understand about Jenkins not as a course summary, but as a practical map of how code moves from a developer’s laptop to production.</p><h3>1. Why Modern Software Delivery Needs CI/CD</h3><p>Before Jenkins, before automation, software delivery looked like this:</p><ul><li>A developer finishes a feature and manually zips or copies build artifacts</li><li>Someone manually runs tests (if at all) before shipping</li><li>Deployment happens via manual server access, often undocumented</li><li>Rollbacks are painful because no one is fully sure what changed</li></ul><p>This approach doesn’t scale. As teams grow and release frequency increases, manual processes become the bottleneck and the biggest source of production incidents.</p><p><strong>Continuous Integration (CI)</strong> solves the first half: every code change is automatically built and tested the moment it’s pushed, catching integration issues early instead of at release time.</p><p><strong>Continuous Delivery/Deployment (CD)</strong> solves the second half: once code passes CI, it’s automatically packaged and pushed toward staging or production, following a consistent, auditable process.</p><p>Together, CI/CD turns software delivery from an event into a pipelinepredictable, observable, and repeatable.</p><h3>2. What Is Jenkins?</h3><p>Jenkins is an open-source automation server that orchestrates the build, test, and deployment stages of software delivery. It has remained a cornerstone of DevOps tooling for over a decade for a few concrete reasons:</p><p>Strength Why It Matters <strong>Open-source &amp; self-hosted</strong> Full control over infrastructure and data, no vendor lock-in <strong>Massive plugin ecosystem</strong> 1,800+ plugins covering nearly every tool in the DevOps stack <strong>Deep integrations</strong> Native support for Git, Docker, Kubernetes, AWS, Slack, SonarQube, and more <strong>Pipeline as Code</strong> Build logic is version-controlled, not clicked together in a UI <strong>Extensible architecture</strong> Distributed builds via master/agent nodes for scale</p><p>In short, Jenkins doesn’t just <em>run</em> your builds it becomes the connective tissue between every other tool in your delivery chain.</p><h3>3. Jenkins Architecture at a Glance</h3><p>At a high level, Jenkins operates on a <strong>controller-agent (master-agent)</strong> model:</p><ul><li>The <strong>controller</strong> schedules jobs, manages configuration, and serves the web UI</li><li><strong>Agents</strong> (workers) execute the actual build/test/deploy steps, often in isolated environments or containers</li></ul><p>This separation lets teams scale horizontally spinning up ephemeral agents (e.g., Docker containers or Kubernetes pods) for each build rather than overloading a single machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DOM8yRWoJCbDlDQiASfIWw.png" /></figure><p>The single biggest shift Jenkins introduced is <strong>Pipeline as Code</strong>: instead of configuring jobs through a UI, the entire build/test/deploy process is defined in a Jenkinsfile a text file committed to the same repository as the application code.</p><p>This means your CI/CD logic is:</p><ul><li><strong>Version-controlled</strong> changes are tracked, reviewed, and reversible</li><li><strong>Portable</strong> the same pipeline definition works across environments</li><li><strong>Auditable</strong> no hidden, manually-configured jobs living only in the Jenkins UI</li></ul><p>A minimal <strong>Declarative Pipeline</strong> looks like this:</p><pre>pipeline {<br>    agent any</pre><pre>    stages {<br>        stage(&#39;Checkout&#39;) {<br>            steps {<br>                git branch: &#39;main&#39;, url: &#39;https://github.com/your-org/your-app.git&#39;<br>            }<br>        }<br>        stage(&#39;Build&#39;) {<br>            steps {<br>                sh &#39;mvn clean package&#39;<br>            }<br>        }<br>        stage(&#39;Test&#39;) {<br>            steps {<br>                sh &#39;mvn test&#39;<br>            }<br>        }<br>        stage(&#39;Deploy&#39;) {<br>            steps {<br>                sh &#39;./deploy.sh production&#39;<br>            }<br>        }<br>    }<br>}</pre><p>Every stage is explicit, ordered, and reproducible the same pipeline runs identically whether it’s triggered by you locally or by a webhook from GitHub.</p><h3>5. Integrating Jenkins with Git</h3><p>Jenkins pipelines are typically triggered by a <strong>Git push</strong>, closing the loop between “developer writes code” and “code gets validated automatically.”</p><p>The typical flow:</p><ol><li>Developer pushes a commit to a branch</li><li>A <strong>webhook</strong> notifies Jenkins of the change</li><li>Jenkins checks out the exact commit and runs the pipeline defined in the Jenkinsfile</li><li>Results (pass/fail) are reported back to the Git platform (e.g., as a GitHub check)</li></ol><p>Because the pipeline definition itself lives in the repo, every branch can have its own build logic useful for feature branches that need lighter validation than main.</p><h3>6. Automating Builds with Triggers</h3><p>Jenkins supports several ways to kick off a pipeline, each suited to different workflows:</p><p>Trigger Type Description Common Use Case <strong>Manual</strong> Triggered by a human clicking “Build Now” Ad-hoc testing, hotfix builds <strong>Git Webhook</strong> Push event immediately notifies Jenkins Standard CI on every commit <strong>Poll SCM</strong> Jenkins periodically checks the repo for changes Environments without webhook access <strong>Scheduled (CRON)</strong> Runs at fixed intervals Nightly builds, scheduled regression suites</p><p>Webhooks are the standard in modern setups they’re near-instant and avoid the wasted resource cost of constant polling.</p><h3>7. Secure Pipeline Design with Credentials</h3><p>This is where a lot of pipelines go wrong. Every real pipeline needs access to sensitive resources a GitHub token to check out private repos, SSH keys to reach deployment servers, AWS credentials to provision infrastructure, or a Docker Hub password to push images.</p><blockquote><strong><em>Never hardcode secrets inside a Jenkinsfile.</em></strong></blockquote><p>Jenkins solves this with its built-in <strong>Credentials Manager</strong>, which stores secrets securely and injects them into pipelines at runtime without exposing the raw values in logs or source code:</p><pre>pipeline {<br>    agent any<br>    stages {<br>        stage(&#39;Deploy to AWS&#39;) {<br>            steps {<br>                withCredentials([[<br>                    $class: &#39;AmazonWebServicesCredentialsBinding&#39;,<br>                    credentialsId: &#39;aws-prod-creds&#39;<br>                ]]) {<br>                    sh &#39;aws s3 sync ./build s3://production-bucket&#39;<br>                }<br>            }<br>        }<br>    }<br>}</pre><p>The credential ID (aws-prod-creds) is a reference the actual key and secret never appear in the pipeline code, and Jenkins automatically masks them in console output.</p><h3>8. Environment Variables for Dynamic Pipelines</h3><p>Jenkins exposes a set of built-in environment variables that make pipelines context-aware, so the same Jenkinsfile can adapt its behavior based on what triggered it:</p><pre>echo &quot;Build Number: ${env.BUILD_NUMBER}&quot;<br>echo &quot;Job Name: ${env.JOB_NAME}&quot;<br>echo &quot;Workspace: ${env.WORKSPACE}&quot;<br>echo &quot;Branch: ${env.BRANCH_NAME}&quot;</pre><p>Variable Purpose BUILD_NUMBER Unique, incrementing ID for each run — useful for tagging artifacts JOB_NAME Identifies which pipeline is running WORKSPACE Filesystem path where the build executes BRANCH_NAME Enables branch-specific logic (e.g., only deploy from main)</p><p>This is what allows a single pipeline definition to behave differently for a feature branch versus a production release no duplicated Jenkinsfiles required.</p><h3>9. Advanced Pipeline Concepts</h3><p>Once the basics are in place, production-grade pipelines typically add:</p><p><strong>Parallel and sequential stages</strong> running independent tasks (e.g., unit tests and a security scan) simultaneously to cut build time:</p><pre>stage(&#39;Parallel Checks&#39;) {<br>    parallel {<br>        stage(&#39;Unit Tests&#39;) {<br>            steps { sh &#39;mvn test&#39; }<br>        }<br>        stage(&#39;Security Scan&#39;) {<br>            steps { sh &#39;sonar-scanner&#39; }<br>        }<br>    }<br>}</pre><p><strong>Conditional execution</strong> running a stage only when certain conditions are met:</p><pre>stage(&#39;Deploy to Production&#39;) {<br>    when {<br>        branch &#39;main&#39;<br>    }<br>    steps {<br>        sh &#39;./deploy.sh production&#39;<br>    }<br>}</pre><p><strong>Parameters</strong> letting a pipeline accept input at trigger time, such as target environment or version:</p><pre>parameters {<br>    choice(name: &#39;ENVIRONMENT&#39;, choices: [&#39;staging&#39;, &#39;production&#39;], description: &#39;Deployment target&#39;)<br>    string(name: &#39;VERSION&#39;, defaultValue: &#39;latest&#39;, description: &#39;Version to deploy&#39;)<br>}</pre><p><strong>Manual approval gates</strong> pausing the pipeline before a critical step, requiring a human sign-off before deploying to production:</p><pre>stage(&#39;Approval&#39;) {<br>    steps {<br>        input message: &#39;Deploy to Production?&#39;, ok: &#39;Deploy&#39;<br>    }<br>}</pre><p>A pipeline combining these looks like:</p><pre>Pipeline<br>├── Checkout<br>├── Build<br>├── Test          (parallel)<br>├── Security Scan (parallel)<br>├── Docker Build<br>├── Approval (manual gate)<br>└── Deploy → Production</pre><h3>10. Jenkins Best Practices</h3><p>A handful of habits separate fragile pipelines from resilient ones:</p><ul><li><strong>Store the Jenkinsfile in Git</strong> pipeline logic should live and evolve alongside application code</li><li><strong>Use the Credentials Manager</strong> never hardcode secrets, ever</li><li><strong>Keep pipelines modular</strong> break large pipelines into reusable shared libraries</li><li><strong>Run automated tests at every stage</strong> catch failures before they reach production</li><li><strong>Prefer webhooks over polling</strong> faster feedback, lower resource usage</li><li><strong>Install only required plugins</strong> every plugin is a maintenance and security surface</li><li><strong>Use ephemeral agents where possible</strong> containerized agents keep builds clean and reproducible</li></ul><h3>Final Thoughts</h3><p>Jenkins is more than a build server it’s the foundation of modern DevOps automation. By combining source control, automated testing, secure credential management, and deployment pipelines, teams can deliver software faster, with greater confidence and fewer manual errors.</p><p>Understanding Jenkins isn’t about memorizing every plugin it’s about understanding the <em>shape</em> of a good pipeline: checkout, build, test, secure it, deploy, and gate the risky steps with approval. Once that shape clicks, every other CI/CD tool (GitLab CI, GitHub Actions, CircleCI) starts to look familiar, because they’re all solving the same problem in slightly different syntax.</p><p><em>If you’re working through Jenkins pipelines yourself, I’d love to hear what tripped you up first credentials, webhooks, or getting parallel stages to behave.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db4944e4fd77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning from Failure: AWS Auto Scaling Group & Application Load Balancer]]></title>
            <link>https://medium.com/@lahiruavishka747/learning-from-failure-aws-auto-scaling-group-application-load-balancer-1ae385507a9b?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ae385507a9b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[failure]]></category>
            <category><![CDATA[hands-on-learning]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[kodekloud]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 18:52:36 GMT</pubDate>
            <atom:updated>2026-07-07T18:52:36.489Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I worked on an AWS hands-on lab to deploy a highly available web application using an EC2 Launch Template, Auto Scaling Group (ASG), Application Load Balancer (ALB), and Nginx.</p><p>At first, I thought I had configured everything correctly:</p><p>✅ Launch Template</p><p>✅ EC2 User Data to install Nginx</p><p>✅ Target Group</p><p>✅ Application Load Balancer</p><p>✅ Auto Scaling Group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*26PcOKar3pqsLkXdJL52sw.png" /></figure><p>However, the lab validation kept failing with this message:</p><blockquote><em>“Scaling policy for ‘datacenter-asg’ is not set to 50% CPU utilization.”</em></blockquote><p><strong>What was my mistake?</strong></p><p>I was following an older tutorial where the CPU Target Tracking Scaling Policy was configured during the Auto Scaling Group creation itself.</p><p>But the AWS Management Console has changed.</p><p>In the latest console, the ASG creation wizard no longer includes a scaling policy configuration step. I assumed the default settings were sufficient, so I completed the ASG without creating a scaling policy at all.</p><p><strong>How I solved it</strong></p><p>After investigating, I discovered that the scaling policy must now be created <em>after</em> the Auto Scaling Group exists. The correct steps were:</p><ol><li>Open EC2 → Auto Scaling Groups</li><li>Select the Auto Scaling Group</li><li>Open the <strong>Automatic scaling</strong> tab</li><li>Create a <strong>Target Tracking Scaling Policy</strong></li><li>Select <strong>Average CPU Utilization</strong></li><li>Set the Target Value to <strong>50%</strong></li></ol><p>Once the correct scaling policy was added, the lab validation passed successfully.</p><p><strong>My key takeaway</strong></p><p>One lesson I’ve learned in cloud computing is that AWS evolves continuously. Tutorials and screenshots from a few months ago may not exactly match the current AWS Console.</p><p>Instead of assuming something is wrong with my own understanding, I learned to:</p><ul><li>Read the AWS documentation carefully</li><li>Adapt to UI changes rather than fight them</li><li>Verify configurations instead of relying only on older guides</li><li>Treat every failure as an opportunity to learn something new</li></ul><p>Every troubleshooting session improves my understanding of how AWS services work together.</p><p>#AWS #CloudComputing #DevOps #AmazonWebServices #EC2 #AutoScaling #ApplicationLoadBalancer #NGINX #LearningInPublic #KodeKloud #ContinuousLearning #CloudEngineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ae385507a9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Treating Your Database Like Code: A DevOps Guide to Schema Migrations]]></title>
            <link>https://medium.com/@lahiruavishka747/treating-your-database-like-code-a-devops-guide-to-schema-migrations-79ced3b15e1b?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/79ced3b15e1b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[dbms]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[career-development]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 15:35:30 GMT</pubDate>
            <atom:updated>2026-07-03T15:35:30.865Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85UacpV1zIcF3Si5m3ceUA.png" /></figure><p>Your application deployment finishes in 45 seconds. Your database migration takes 45 minutes and everyone is holding their breath.</p><p>If that sentence feels familiar, you’re not alone. Most DevOps teams have automated everything: infrastructure provisioning, application builds, testing, deployments. Yet the database the one component holding the actual state of the business often remains the last manual, high-risk step in the pipeline.</p><p>This is the gap that <strong>Database DevOps</strong> (also called <strong>Database-as-Code</strong>) exists to close. In this article, I’ll break down what it is, why it matters, and the practical tools and workflows you can start using today.</p><h3>1. Why Databases Are Different (And Harder)</h3><p>Infrastructure as Code succeeded because servers, networks, and containers are <strong>stateless</strong> you can destroy and recreate them without losing anything important. Databases are the opposite. They are <strong>stateful</strong>: every schema change, every migration, every rollback carries real production data with it.</p><p>This changes the rules:</p><ul><li>A bad terraform apply can be reverted by re-applying the previous state.</li><li>A bad schema migration that drops a column can mean <strong>permanent data loss</strong>.</li><li>Rolling back application code is instant. Rolling back a database migration halfway through a deployment can corrupt data integrity.</li></ul><p>This is exactly why DBMS management has lagged behind the rest of the DevOps toolchain and why closing that gap is one of the highest-leverage skills you can build right now.</p><h3>2. DBMS Types Every DevOps Engineer Should Recognize</h3><p>You don’t need to be a DBA, but you do need to know which database fits which job when you’re designing pipelines, provisioning infrastructure, or debugging production incidents.</p><p>DBMS Type Best Use Case in DevOps Key Examples <strong>Relational (RDBMS)</strong> Structured data, ACID compliance, transactional microservices PostgreSQL, MySQL, AWS Aurora <strong>NoSQL (Document / Key-Value)</strong> Unstructured data, rapid horizontal scaling, caching, session storage MongoDB, Redis, DynamoDB <strong>Time-Series / OLAP</strong> Observability, metrics pipelines, log analytics ClickHouse, InfluxDB, Prometheus TSDB</p><p>Knowing this table cold helps in interviews and in real incident response when someone asks “why is Redis down affecting checkout,” you should immediately understand it’s likely a session or cache-layer failure, not a data-loss event.</p><h3>3. Core Practices: Bringing DBMS Into the CI/CD Pipeline</h3><h3>3.1 Database-as-Code (Schema Migrations)</h3><p>The foundational shift is treating schema changes exactly like application code:</p><ul><li>Every schema change is written as a <strong>versioned migration script</strong>, not run manually against production.</li><li>Migrations are committed to Git and go through <strong>pull request review</strong>, just like any other code change.</li><li>Every environment (dev, staging, production) applies migrations <strong>in the same order, from the same source of truth</strong>.</li></ul><p>Example migration file using Flyway naming convention:</p><pre>V1__create_users_table.sql<br>V2__add_email_index_to_users.sql<br>V3__add_status_column_to_orders.sql</pre><p>Each file is immutable once merged you never edit a shipped migration, you write a new one. This single discipline eliminates the most common cause of “it works on staging but not production.”</p><h3>3.2 Automating the Pipeline (CI/CD for Databases)</h3><p>Database changes should be validated automatically, the same way you validate application code:</p><pre># Example CI stage for database migration testing<br>test-db-migration:<br>  stage: test<br>  image: docker:24<br>  services:<br>    - postgres:16<br>  script:<br>    - flyway -url=jdbc:postgresql://postgres:5432/testdb migrate<br>    - pytest tests/test_data_integrity.py<br>    - flyway -url=jdbc:postgresql://postgres:5432/testdb info</pre><p>The pattern here:</p><ol><li>Spin up an <strong>ephemeral database container</strong>.</li><li>Apply all pending migrations.</li><li>Run automated data integrity and schema validation tests.</li><li>Tear the container down.</li></ol><p>This catches broken migrations in CI, before they ever reach a real environment.</p><h3>3.3 Configuration Drift and Observability</h3><p>Drift happens when staging and production silently diverge an index added manually in prod, a column dropped only in staging. Left unchecked, this quietly breaks the promise that “if it works in staging, it works in prod.”</p><p>Mitigation practices:</p><ul><li>Run scheduled drift-detection jobs comparing schema state across environments.</li><li>Never allow direct manual ALTER TABLE access to production enforce migrations as the only change path.</li><li>Monitor query performance and connection pool health continuously with <strong>Prometheus</strong> and <strong>Grafana</strong>, so slow queries and connection exhaustion are caught before they cause an outage.</li></ul><h3>4. The Essential Database DevOps Toolkit</h3><p>Category Tools <strong>Migration &amp; Version Control</strong> Liquibase, Flyway, Alembic, Atlas <strong>Cloud-Native / Managed DBMS</strong> AWS RDS, Google Cloud SQL, Azure SQL Database <strong>Isolated Testing Environments</strong> Testcontainers (spin up real, disposable DB instances in Docker for integration tests)</p><p>A quick Testcontainers example in Python, showing how a real Postgres instance can be spun up just for a test run:</p><pre>from testcontainers.postgres import PostgresContainer</pre><pre>with PostgresContainer(&quot;postgres:16&quot;) as postgres:<br>    connection_url = postgres.get_connection_url()<br>    # Run migrations and integration tests against a real, disposable database</pre><p>No shared test databases, no flaky state between test runs every test gets a clean, real database instance.</p><h3>5. A Practical Starting Checklist</h3><p>If you’re introducing Database DevOps practices to your team, start small:</p><ul><li>[ ] Move all schema changes into version-controlled migration scripts.</li><li>[ ] Add a CI stage that spins up a database container and runs migrations automatically.</li><li>[ ] Ban direct manual changes to production schemas migrations only.</li><li>[ ] Set up basic query performance monitoring with Prometheus and Grafana.</li><li>[ ] Introduce Testcontainers (or equivalent) for integration testing.</li></ul><p>None of these require a rewrite of your existing stack. They’re incremental changes that compound into real reliability gains.</p><h3>6. Closing Thought</h3><p>DevOps matured application delivery by treating infrastructure and code as version-controlled, testable, automatable artifacts. Databases are the last frontier of that same discipline. Engineers who understand both the operational and data layer who can speak fluently about migrations, replication, and backups alongside CI/CD and Kubernetes are becoming disproportionately valuable in 2026’s job market.</p><p>If you’re a DevOps engineer who hasn’t yet worked schema migrations into your pipeline, that’s your next high-leverage skill to build.</p><p><em>What’s the worst database migration incident you’ve witnessed or caused? Drop it in the comments let’s normalize talking about these failures so we can design better pipelines around them.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79ced3b15e1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Datadog Has Become a Go-To Monitoring Platform for Modern DevOps Teams]]></title>
            <link>https://medium.com/@lahiruavishka747/why-datadog-has-become-a-go-to-monitoring-platform-for-modern-devops-teams-9d6554478632?source=rss-137497e13859------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d6554478632</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[datadog]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[sre]]></category>
            <dc:creator><![CDATA[Lahiruavishka]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 15:22:44 GMT</pubDate>
            <atom:updated>2026-06-23T15:22:44.678Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>As organizations increasingly adopt cloud computing, Kubernetes, microservices, and distributed architectures, maintaining visibility across systems becomes more challenging. Traditional monitoring tools often struggle to provide a unified view of modern infrastructure.</p><p>This is where Datadog has emerged as one of the leading observability platforms for DevOps, SRE, and Cloud Engineering teams.</p><p>Datadog enables organizations to monitor infrastructure, applications, logs, network traffic, security events, and user experiences from a centralized platform, helping teams quickly identify and resolve issues before they impact users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEm_E34jBBVeAklqh0XNHg.png" /></figure><h3>What is Datadog?</h3><p>Datadog is a cloud-based monitoring and observability platform designed to provide end-to-end visibility into modern IT environments.</p><p>It collects and analyzes data from:</p><ul><li>Cloud infrastructure</li><li>Containers and Kubernetes clusters</li><li>Applications and APIs</li><li>Logs and events</li><li>Network traffic</li><li>Security systems</li><li>CI/CD pipelines</li><li>End-user experiences</li></ul><p>By consolidating these monitoring capabilities into a single platform, Datadog helps engineering teams reduce operational complexity and improve system reliability.</p><h3>Why Monitoring Matters in Modern Systems</h3><p>Modern applications are no longer deployed on a single server.</p><p>Today, applications often consist of:</p><ul><li>Multiple microservices</li><li>Containers running in Kubernetes</li><li>Cloud-managed databases</li><li>Serverless functions</li><li>Third-party APIs</li></ul><p>A single user request may travel through dozens of services before generating a response.</p><p>When something fails, identifying the root cause can be difficult without proper observability tools.</p><p>Monitoring platforms like Datadog provide visibility into every layer of the technology stack, allowing teams to quickly understand what is happening inside their systems.</p><h3>What Can Datadog Monitor?</h3><h3>1. Cloud Infrastructure</h3><p>Datadog integrates with major cloud providers including:</p><ul><li>AWS</li><li>Microsoft Azure</li><li>Google Cloud Platform (GCP)</li></ul><p>Teams can monitor:</p><ul><li>CPU utilization</li><li>Memory consumption</li><li>Disk usage</li><li>Network traffic</li><li>Cloud service health</li></ul><p>This enables proactive detection of infrastructure issues before they affect users.</p><h3>2. Containers and Kubernetes</h3><p>Kubernetes environments generate large amounts of operational data.</p><p>Datadog provides visibility into:</p><ul><li>Pods</li><li>Nodes</li><li>Deployments</li><li>Namespaces</li><li>Cluster performance</li></ul><p>Engineers can quickly identify unhealthy workloads and resource bottlenecks.</p><h3>3. Application Performance Monitoring (APM)</h3><p>Datadog APM helps developers understand application behavior.</p><p>Key insights include:</p><ul><li>Request latency</li><li>Error rates</li><li>Service dependencies</li><li>Database performance</li><li>API response times</li></ul><p>This helps teams optimize application performance and troubleshoot production issues.</p><h3>4. Log Management</h3><p>Logs provide critical information during troubleshooting.</p><p>Datadog centralizes logs from multiple sources, making it easier to:</p><ul><li>Search logs</li><li>Filter events</li><li>Correlate logs with metrics</li><li>Investigate incidents</li></ul><p>Instead of checking multiple servers, engineers can analyze logs from one dashboard.</p><h3>5. Network Monitoring</h3><p>Network issues can significantly impact application performance.</p><p>Datadog helps monitor:</p><ul><li>Traffic flows</li><li>Service communication</li><li>Network latency</li><li>Packet loss</li></ul><p>This visibility helps teams identify connectivity problems quickly.</p><h3>6. Security Monitoring</h3><p>Security is becoming a core responsibility for modern DevOps teams.</p><p>Datadog provides:</p><ul><li>Threat detection</li><li>Security monitoring</li><li>Compliance visibility</li><li>Security event correlation</li></ul><p>This allows organizations to identify suspicious activities and improve security posture.</p><h3>7. Real User Monitoring (RUM)</h3><p>Infrastructure metrics alone do not reveal how users experience an application.</p><p>Real User Monitoring helps teams track:</p><ul><li>Page load times</li><li>User interactions</li><li>Browser performance</li><li>Frontend errors</li></ul><p>This enables organizations to improve customer experience using real-world data.</p><h3>Key Features of Datadog</h3><h3>Real-Time Dashboards</h3><p>Datadog dashboards provide live visibility into system performance.</p><p>Teams can create custom dashboards displaying:</p><ul><li>Infrastructure metrics</li><li>Application metrics</li><li>Logs</li><li>Business KPIs</li></ul><p>This creates a centralized monitoring experience.</p><h3>Intelligent Alerting</h3><p>Datadog allows teams to configure alerts based on:</p><ul><li>Threshold breaches</li><li>Anomaly detection</li><li>Service degradation</li><li>Error spikes</li></ul><p>Notifications can be sent through:</p><ul><li>Slack</li><li>Microsoft Teams</li><li>Email</li><li>PagerDuty</li></ul><p>This ensures rapid response to incidents.</p><h3>Extensive Integrations</h3><p>One of Datadog’s biggest strengths is its ecosystem.</p><p>Datadog supports over 800 integrations including:</p><ul><li>AWS</li><li>Kubernetes</li><li>Docker</li><li>Jenkins</li><li>GitHub</li><li>Terraform</li><li>NGINX</li><li>MySQL</li><li>PostgreSQL</li></ul><p>This enables organizations to connect their entire technology stack.</p><h3>A Real-World DevOps Scenario</h3><p>Imagine a Kubernetes pod suddenly begins consuming excessive CPU resources.</p><p>Without proper monitoring:</p><ul><li>Users experience slow response times.</li><li>Application performance degrades.</li><li>Engineers spend hours investigating the issue.</li></ul><p>With Datadog:</p><ol><li>Real-time alerts are triggered.</li><li>Infrastructure metrics immediately reveal abnormal CPU usage.</li><li>Logs provide additional context.</li><li>Distributed traces show affected requests.</li><li>Engineers quickly identify the root cause.</li></ol><p>The result is faster troubleshooting and reduced downtime.</p><h3>Datadog and Mean Time To Resolution (MTTR)</h3><p>One of the primary goals of observability is reducing Mean Time To Resolution (MTTR).</p><p>Datadog contributes by:</p><ul><li>Detecting incidents earlier</li><li>Correlating metrics, logs, and traces</li><li>Providing centralized visibility</li><li>Simplifying root cause analysis</li></ul><p>Lower MTTR leads to:</p><ul><li>Improved reliability</li><li>Better customer experience</li><li>Reduced operational costs</li></ul><h3>A Typical DevOps Monitoring Architecture</h3><p>A common monitoring workflow looks like this:</p><p>AWS Infrastructure</p><p>↓</p><p>Datadog Agent</p><p>↓</p><p>Metrics + Logs + Traces</p><p>↓</p><p>Datadog Platform</p><p>↓</p><p>Dashboards &amp; Alerts</p><p>↓</p><p>Slack / Incident Response Tools</p><p>This architecture provides end-to-end visibility across infrastructure and applications.</p><h3>Datadog vs Traditional Monitoring</h3><p>Traditional MonitoringDatadogSeparate monitoring toolsUnified platformLimited visibilityFull-stack observabilityManual correlationAutomatic correlationReactive troubleshootingProactive detectionComplex managementCentralized dashboards</p><p>This is one reason many organizations are adopting observability platforms over traditional monitoring approaches.</p><h3>Why DevOps Engineers Should Learn Datadog</h3><p>As cloud-native technologies continue to grow, observability skills are becoming increasingly valuable.</p><p>Learning Datadog helps engineers understand:</p><ul><li>Monitoring fundamentals</li><li>Cloud infrastructure visibility</li><li>Kubernetes observability</li><li>Application performance analysis</li><li>Incident response workflows</li><li>Reliability engineering concepts</li></ul><p>These skills are highly relevant for careers in:</p><ul><li>DevOps Engineering</li><li>Site Reliability Engineering (SRE)</li><li>Cloud Engineering</li><li>Platform Engineering</li><li>Infrastructure Operations</li></ul><h3>Conclusion</h3><p>Modern applications generate enormous amounts of operational data. Without proper observability, identifying issues can be time-consuming and costly.</p><p>Datadog provides a comprehensive platform for monitoring infrastructure, applications, logs, networks, security events, and user experiences from a single location.</p><p>By combining metrics, logs, traces, dashboards, and alerting, Datadog helps DevOps teams improve visibility, accelerate troubleshooting, and build more reliable systems.</p><p>As I continue my DevOps learning journey, understanding observability platforms such as Datadog, Prometheus, and Grafana is becoming increasingly important for managing cloud-native environments and ensuring system reliability at scale.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d6554478632" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>