<?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 Harikrishnan M on Medium]]></title>
        <description><![CDATA[Stories by Harikrishnan M on Medium]]></description>
        <link>https://medium.com/@harykryshnan?source=rss-cfd1e665fb55------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k3_PEDghs-B1Ef0Awe_0Ug.jpeg</url>
            <title>Stories by Harikrishnan M on Medium</title>
            <link>https://medium.com/@harykryshnan?source=rss-cfd1e665fb55------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:03:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harykryshnan/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[ CIDR Made Simple: The Easiest Way to Understand IP Ranges for Cloud & DevOps]]></title>
            <link>https://harykryshnan.medium.com/cidr-made-simple-the-easiest-way-to-understand-ip-ranges-for-cloud-devops-22e17d2063e4?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/22e17d2063e4</guid>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[subnet]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cidr]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Thu, 14 May 2026 08:39:45 GMT</pubDate>
            <atom:updated>2026-05-14T08:39:45.222Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re stepping into <strong>Cloud, Networking, or DevOps</strong>, you’ve probably seen something like:</p><pre>10.0.0.0/16<br>192.168.1.0/24</pre><p>And thought:</p><p>👉 <em>“What does </em><em>/24 even mean?”</em></p><p>Don’t worry — let’s break <strong>CIDR (Classless Inter-Domain Routing)</strong> down in the simplest way possible.</p><h3>🚀 What is CIDR?</h3><p>At its core:</p><p>👉 <strong>CIDR tells you how many IP addresses are in a network</strong></p><p>Example:</p><pre>192.168.1.0/24</pre><ul><li>192.168.1.0 → Starting point of the network</li><li>/24 → Size of the network</li></ul><h3>🏠 Imagine This (Real-Life Analogy)</h3><p>Think of CIDR like <strong>house numbers on a street</strong>:</p><ul><li>A <strong>big CIDR block</strong> = long street → many houses (IPs)</li><li>A <strong>small CIDR block</strong> = short street → fewer houses</li></ul><p>👉 So:</p><ul><li>/16 = a huge neighborhood</li><li>/24 = a street</li><li>/30 = just a couple of houses</li></ul><h3>🔢 The Only Concept You Need</h3><p>IPv4 addresses have <strong>32 bits total</strong>.</p><p>CIDR works like this:</p><pre>32 bits total<br>→ CIDR (/24) = network portion<br>→ Remaining bits = number of IPs</pre><h3>🔥 The Super Simple Formula</h3><p>You don’t need to overcomplicate it:</p><pre>Total IPs = 2^(32 - CIDR)</pre><h3>✅ Example 1: /24</h3><pre>32 - 24 = 8<br>2^8 = 256 IP addresses</pre><p>👉 Usable = 254 (2 are reserved)</p><h3>✅ Example 2: /26</h3><pre>32 - 26 = 6<br>2^6 = 64 IP addresses</pre><p>👉 Usable = 62</p><h3>⚠️ Why 2 IPs Are Always Reserved</h3><p>Every network keeps:</p><ul><li>1 → Network address</li><li>1 → Broadcast address</li></ul><p>👉 So:</p><pre>Usable IPs = Total - 2</pre><h3>🧠 The Shortcut DevOps Engineers Actually Use</h3><p>Nobody calculates everything every time.</p><p>👉 Just remember this:</p><p>CIDRTotal IPsUsable IPs/24256254/25128126/266462/273230/281614</p><h3>💡 Golden Trick (Super Important)</h3><p>👉 Moving CIDR up/down:</p><ul><li>Increase CIDR → divide IPs by 2</li><li>Decrease CIDR → multiply IPs by 2</li></ul><h3>Example:</h3><p>CIDRIPs/24256/25128/2664</p><h3>☁️ Why CIDR Matters in Cloud</h3><p>CIDR is used <em>everywhere</em>:</p><h3>✅ 1. VPC (Virtual Private Cloud)</h3><p>Example:</p><pre>VPC: 10.0.0.0/16</pre><p>👉 This gives:</p><ul><li>65,536 IP addresses</li></ul><h3>✅ 2. Subnets</h3><p>Inside the VPC:</p><pre>10.0.1.0/24<br>10.0.2.0/24</pre><p>👉 Each subnet:</p><ul><li>256 IPs</li><li>Used for EC2, services, databases</li></ul><h3>✅ 3. Security Rules</h3><p>Example:</p><pre>Allow: 192.168.1.0/24</pre><p>👉 Means: ✔ Allow all devices in that network</p><h3>✅ 4. Kubernetes (Very Important for DevOps)</h3><ul><li>Each node gets a CIDR block</li><li>Pods are assigned IPs from it</li></ul><h3>🧩 Real DevOps Explanation</h3><p>Think like this:</p><pre>/16 → your entire company network<br>/24 → each team or service<br>/28 → small internal services</pre><h3>🎯 One-Line Understanding</h3><p>👉 <strong>CIDR = The size of your network (number of IPs available)</strong></p><ul><li>Smaller CIDR (e.g., /16) → BIG network</li><li>Larger CIDR (e.g., /28) → SMALL network</li></ul><h3>✅ Final Tip (What You Should Remember Forever)</h3><p>If you remember <em>just one thing</em>, make it this:</p><p>👉 <strong>/24 = 256 IPs</strong></p><p>From that:</p><ul><li>/25 → 128</li><li>/26 → 64</li><li>/27 → 32</li></ul><p>👉 That’s enough for 90% of real DevOps work.</p><h3>👋 Wrap Up</h3><p>CIDR might look scary at first, but in reality:</p><p>👉 It’s just a <strong>simple way to count IP addresses in a network</strong></p><p>Once you master this:</p><ul><li>VPC design becomes easier</li><li>Kubernetes networking makes sense</li><li>Security rules become clearer</li></ul><p>💬 If this helped you, consider sharing it — it might help someone struggling with networking basics in their cloud journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22e17d2063e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering grep for Cloud, DevOps & SRE: From Zero to Hero]]></title>
            <link>https://harykryshnan.medium.com/mastering-grep-for-cloud-devops-sre-from-zero-to-hero-33b1c5e2ecc0?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/33b1c5e2ecc0</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[grep]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Tue, 02 Dec 2025 04:59:57 GMT</pubDate>
            <atom:updated>2025-12-02T04:59:57.730Z</atom:updated>
            <content:encoded><![CDATA[<p>If there’s one command that consistently shows up across Cloud Engineering, DevOps, and Site Reliability Engineering (SRE), it’s <strong>grep</strong>. From debugging microservices to scanning logs in distributed systems, grep is the quiet hero powering your observability and troubleshooting workflows.</p><h3>🔥 Why grep Matters in Cloud &amp; SRE</h3><ul><li>Log-heavy workflows: containers, load balancers, and distributed apps generate massive logs.</li><li>Incident response: fast root-cause analysis requires quick pattern matching.</li><li>Automation in CI/CD pipelines and scripts.</li><li>Text processing: cloud configs, YAML/JSON, Terraform, Helm charts.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vaWjYnTAUpT0hSY-m54vA.png" /></figure><h3>1. The Basics: grep 101</h3><pre>grep &quot;error&quot; app.log<br>grep -i &quot;error&quot; app.log<br>grep -c &quot;timeout&quot; app.log<br>grep -R &quot;api-key&quot; /etc/</pre><h3>2. Show Context Around Matches</h3><pre>grep -C 3 &quot;Exception&quot; server.log<br>grep -A 2 &quot;503&quot; nginx.log<br>grep -B 2 &quot;failed&quot; syslog</pre><h3>3. Regex Power</h3><pre>grep &quot;^ERROR&quot; app.log<br>grep &quot;completed$&quot; ci_build.log<br>grep -E &quot;\b([0-9]{1,3}\.){3}[0-9]{1,3}\b&quot; access.log</pre><h3>4. Searching Cloud Config Files</h3><pre>grep -R &quot;image:&quot; k8s-manifests/<br>grep -R &quot;variable&quot; terraform/<br>grep -R &quot;secret&quot; .</pre><h3>5. Real DevOps/SRE Examples</h3><h3>A) Kubernetes Logs</h3><pre>kubectl logs deployment/api | grep -i &quot;error&quot;<br>kubectl logs pod/web-1 | grep &quot;latency&quot;</pre><h3>B) Docker Logs</h3><pre>docker logs myapp | grep -i &quot;timeout&quot;</pre><h3>C) CI/CD Pipelines</h3><pre>grep -R &quot;TODO&quot; src/ &amp;&amp; exit 1<br>grep -E &quot;FAIL|ERROR&quot; test-results.txt</pre><h3>D) Incident Response</h3><pre>grep &quot; 5[0-9][0-9] &quot; access.log<br>grep -i &quot;panic&quot; service.log<br>grep -E &quot;duration=[2-9][0-9]{3}ms&quot; db.log</pre><h3>6. Performance Tips</h3><pre>grep -n &quot;retry&quot; *<br>grep -o &quot;token=[a-z0-9]*&quot; api.log</pre><p><strong>Bonus: use ripgrep</strong></p><pre>rg &quot;pattern&quot; .</pre><h3>7. Combine grep with Other Tools</h3><pre>journalctl -u nginx | grep -i &quot;denied&quot;<br>grep &quot;ERROR&quot; app.log | awk &#39;{print $1, $2, $5}&#39;<br>grep &quot;404&quot; access.log | awk &#39;{print $1}&#39; | sort | uniq -c | sort -nr</pre><h3>8. Cheat Sheet</h3><pre>grep &quot;text&quot; file<br>grep -i<br>grep -R<br>grep -n<br>grep -c<br>grep -v<br>grep -E<br>grep -C 3<br>grep -A / -B<br>grep -o</pre><h3>Conclusion</h3><p>grep is more than a command — it’s a force multiplier for Cloud, DevOps, and SRE engineers. Mastering it means faster debugging, cleaner pipelines, quicker root cause analysis, and more efficient on-call workflows.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33b1c5e2ecc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Ultimate Networking Interview Guide for CloudOps & DevOps Engineers (Basic → Advanced →…]]></title>
            <link>https://harykryshnan.medium.com/ultimate-networking-interview-guide-for-cloudops-devops-engineers-basic-advanced-d5293e5212ea?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5293e5212ea</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Tue, 02 Dec 2025 04:46:28 GMT</pubDate>
            <atom:updated>2025-12-02T04:46:28.402Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔥 Ultimate Networking Interview Guide for CloudOps &amp; DevOps Engineers (Basic → Advanced → Multi-Cloud Architecture) | 2025 Edition</h3><p>Networking is the backbone of cloud infrastructure, DevOps pipelines, distributed systems, security, and modern multi-cloud environments. Whether you’re interviewing for <strong>CloudOps</strong>, <strong>DevOps</strong>, <strong>SRE</strong>, <strong>Platform Engineer</strong>, or <strong>Cloud Architect</strong>, strong networking knowledge is mandatory.</p><p>This blog covers <strong>beginner → mid → senior → architect level networking Q&amp;A</strong>, each with <strong>real-world examples, diagrams, commands, and SME-level insights</strong>.</p><h3>1. What is the OSI model? Explain all 7 layers with real-time examples.</h3><h3>✅ Answer:</h3><p>OSI is a conceptual model for how data moves in a network.</p><p>⭐ <strong>1. OSI Model — Explained (7 Layers Made Easy)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*46J_BGmoVyOIkmXUdnob_A.png" /></figure><p><strong>Remember:</strong><br> 💡 Layers 3–7 matter most in <strong>Cloud &amp; DevOps interviews</strong>.<br> 💡 Layers 1–2 matter in <strong>DC → Cloud migrations, hybrid networking</strong>.</p><h3>Scenario:</h3><p><strong>VPC to on-prem VPN issues?</strong><br> Check Layer 3 (routes), Layer 4 (ports), Layer 7 (app health).</p><h3>📌 Section 2: Basic Networking Q&amp;A</h3><h3>2. What is a Subnet? Why do we use it?</h3><p>A subnet divides a network into smaller logical groups.</p><p><strong>Cloud Example:</strong><br> A VPC 10.0.0.0/16 divided into:</p><ul><li>10.0.1.0/24 → Public</li><li>10.0.2.0/24 → Private</li></ul><h3>3. Difference between Public, Private, and Elastic IPs.</h3><p>TypeMeaningExample<strong>Public IP</strong>Direct internetEC2 exposed to users<strong>Private IP</strong>Internal networkDB servers<strong>Elastic IP</strong>Static public IPBastion host</p><h3>4. What is CIDR? Example?</h3><p>CIDR = Classless Inter-Domain Routing<br> 10.0.1.0/24 = 256 IPs</p><h3>5. What is DNS and how does it work?</h3><p>DNS resolves names → IP addresses.</p><p><strong>Flow:</strong><br> User → DNS Resolver → Root → TLD → Authoritative server</p><p><strong>Troubleshooting:</strong></p><pre>nslookup google.com<br>dig +trace example.com</pre><h3>📌 Section 3: Cloud Networking (AWS, Azure, GCP)</h3><h3>6. What is a VPC?</h3><p>A logically isolated cloud network.</p><p>Includes:</p><ul><li>Subnets</li><li>Route tables</li><li>Internet gateway</li><li>NAT gateway</li><li>Security groups</li><li>NACLs</li></ul><h3>7. Difference between Security Groups and Network ACLs?</h3><p>FeatureSGNACLStateStatefulStatelessApply toENI/InstanceSubnetRulesAllow onlyAllow/Deny</p><h3>8. What is a NAT Gateway?</h3><p>Used for private subnets to access the internet <strong>without exposing instances</strong>.</p><h3>9. What is VPC Peering? Limitations?</h3><p>VPC-to-VPC communication using private IPs.</p><p>Limitations:</p><ul><li>No transitive routing</li><li>CIDR must not overlap</li></ul><h3>10. What is a Transit Gateway?</h3><p>A hub for connecting:</p><ul><li>Multiple VPCs</li><li>On-prem networks</li><li>Across regions</li></ul><h3>📌 Section 4: Hybrid Networking (DC ↔ CLOUD)</h3><h3>11. How does Site-to-Site VPN work?</h3><p>Encrypted IPSec tunnels between:</p><ul><li>On-prem firewall</li><li>Cloud gateway (AWS VGW / Azure VPN Gateway / GCP Cloud VPN)</li></ul><p><strong>Ports:</strong></p><ul><li>UDP 500 (IKE)</li><li>UDP 4500 (IPSec NAT-T)</li></ul><p><strong>Troubleshooting:</strong></p><pre>ping &lt;remote-proxy-ip&gt;<br>traceroute &lt;private-ip&gt;<br>sudo tcpdump -i eth0 udp port 500</pre><h3>12. What is Direct Connect / ExpressRoute / Interconnect?</h3><p>Dedicated fiber link between DC and Cloud.</p><p>CloudServiceAWSDirect ConnectAzureExpressRouteGCPCloud Interconnect</p><p>Benefits:</p><ul><li>High speed</li><li>Low latency</li><li>Secure</li><li>Not dependent on internet</li></ul><h3>📌 Section 5: VPC-to-VPC, Multi-Region, Multi-Cloud Networking</h3><h3>13. How to connect VPC-to-VPC in different regions?</h3><p>Options:</p><ul><li>VPC Peering (regional)</li><li>Transit Gateway (recommended)</li><li>VPN over public internet</li></ul><h3>14. Multi-cloud networking architecture?</h3><p>Use:</p><ul><li>Aviatrix</li><li>CloudHub</li><li>TGW + Azure VWAN + GCP NCC</li><li>IPSec mesh</li></ul><h3>15. How to connect VPC to multiple VPCs?</h3><p><strong>Use Transit Gateway</strong><br> It supports hub-spoke.</p><h3>📌 Section 6: Service Networking (Private ↔ Public)</h3><h3>16. How does a load balancer work?</h3><ul><li>Route incoming traffic</li><li>Health checks</li><li>SSL termination</li></ul><p><strong>Ports:</strong></p><ul><li>HTTP → 80</li><li>HTTPS → 443</li></ul><p><strong>Commands:</strong></p><pre>curl -I http://my-app.com</pre><h3>17. What is a Proxy Server?</h3><p>Acts as a middleman between client &amp; server.</p><p>Types:</p><ul><li>Forward proxy (client-facing)</li><li>Reverse proxy (server-facing)</li></ul><p>Example:<br> Nginx reverse proxy → EC2 fleet</p><h3>18. What is NAT? Explain with example.</h3><p>NAT converts private → public IP.</p><p><strong>Real example:</strong><br> Private EC2 accessing internet → NAT Gateway → Public IP</p><h3>📌 Section 7: Advanced Networking (Troubleshooting + Deep Dive)</h3><h3>19. How to debug packet loss between VPC and DC?</h3><p>Check layer-by-layer:</p><h3>Layer 3 — Routes</h3><pre>ip route</pre><h3>Layer 4 — Ports</h3><pre>nc -zv &lt;ip&gt; 443<br>telnet &lt;ip&gt; 22</pre><h3>Layer 7 — Application</h3><pre>curl -v https://api.example.com</pre><h3>20. What is MTU? Why does it matter?</h3><p>MTU = Maximum Transmission Unit<br> Default 1500 bytes.</p><p>VPN/Encapsulation reduces MTU to ~1400.</p><p><strong>Fix:</strong></p><pre>ping -M do -s 1300 10.0.0.1</pre><h3>21. What is BGP? Why used in cloud?</h3><p>Routing protocol for:</p><ul><li>Direct Connect</li><li>VPN</li><li>Global gateway routing</li></ul><p>Advantages:</p><ul><li>Route advertisement</li><li>Auto failover</li><li>Scalable</li></ul><h3>22. Difference between IPv4 and IPv6</h3><p>IPv4 → 32 bit<br> IPv6 → 128 bit</p><p>Cloud adoption: IPv6 for large scale deployments.</p><h3>23. Explain Anycast vs Multicast vs Unicast.</h3><p>TermMeaningExample<strong>Unicast</strong>One-to-oneClient → Server<strong>Multicast</strong>One-to-manyStreaming clusters<strong>Anycast</strong>One IP → nearest serverCloudFront/Global LB</p><h3>📌 Section 8: Real-Time Scenarios (Interview Favorites)</h3><h3>24. Your EC2 cannot reach the internet. Troubleshoot?</h3><p>Checklist:</p><ol><li>Instance in public subnet?</li><li>Has public/elastic IP?</li><li>Route table → IGW?</li><li>SG allows outbound?</li><li>NACL allows traffic?</li></ol><h3>25. Application works internally but not externally. Why?</h3><p>Possible issues:</p><ul><li>Missing public IP</li><li>Load balancer not healthy</li><li>Wrong target group port</li><li>SG blocking 0.0.0.0/0 inbound</li></ul><h3>26. VPC Peering connected but ping not working. Why?</h3><p>Because <strong>ICMP must be allowed in both SG and NACL</strong>.</p><h3>27. On-prem can reach cloud, but cloud can’t reach on-prem. Why?</h3><p>Common causes:</p><ul><li>Route not advertised back (BGP)</li><li>Firewall rules blocking</li><li>One-way NAT</li><li>Asymmetric routing</li></ul><h3>28. DB unreachable from app?</h3><p>Checklist:</p><ul><li>Correct port (e.g., MySQL 3306, Postgres 5432)</li><li>SG inbound rule</li><li>DNS resolve</li></ul><pre>dig db.internal</pre><h3>29. High latency between regions?</h3><p>Because traffic is traversing public internet or long fiber routes.<br> Use:</p><ul><li>AWS Global Accelerator</li><li>Azure FrontDoor</li><li>GCP Cloud CDN</li></ul><h3>30. VPN tunnel UP but traffic not passing. Why?</h3><p>Possible:</p><ul><li>Wrong Phase 2 selectors</li><li>Overlapping CIDR</li><li>Asymmetric routing</li></ul><h3>📌 Section 9: Commands for Troubleshooting (Linux + Windows)</h3><h3>Network Inspection</h3><pre>ip a<br>ip route<br>ss -tulpn</pre><h3>Connectivity</h3><pre>ping &lt;ip&gt;<br>traceroute &lt;ip&gt;<br>mtr &lt;ip&gt;<br>telnet &lt;ip&gt; 443<br>nc -zv &lt;ip&gt; &lt;port&gt;<br>curl -v &lt;url&gt;</pre><h3>DNS</h3><pre>nslookup &lt;domain&gt;<br>dig &lt;domain&gt;<br>host &lt;domain&gt;</pre><h3>Packet Capture</h3><pre>tcpdump -i eth0 host &lt;ip&gt;<br>tcpdump -vv -n port 443</pre><h3>Windows</h3><pre>Test-NetConnection -ComputerName &lt;ip&gt; -Port 443<br>tracert &lt;ip&gt;</pre><h3>📌 Section 10: Ports Every DevOps Engineer Must Know</h3><p>ServicePortSSH22HTTP80HTTPS443DNS53MySQL3306PostgreSQL5432MongoDB27017RDP3389NTP123SMTP25VPN / IPSec500, 4500</p><h3>📌 Section 11: High-Level Architecture Questions (Senior/Lead Level)</h3><h3>31. How do you architect a multi-cloud network?</h3><h3>Core Components:</h3><ul><li>Hub-Spoke in each cloud</li><li>Transit gateway equivalents</li><li>Centralized firewall (Palo Alto, FortiGate, CheckPoint)</li><li>Anycast DNS</li><li>Global routing via BGP</li></ul><h3>32. How do you design DR networking across regions?</h3><ul><li>VPC peering / TGW interconnect</li><li>Global load balancer</li><li>DNS failover</li><li>Replicated subnets</li><li>Active-Passive or Active-Active</li></ul><h3>33. Zero Trust Networking — Explain.</h3><p>Trust nothing. Validate everything.</p><p>Includes:</p><ul><li>Identity-based access</li><li>Private Link</li><li>Microsegmentation</li><li>No public exposure</li></ul><h3>📌 Section 12: Final 10 Expert-Level Networking Questions</h3><h3>41. What is PrivateLink?</h3><p>Private access to AWS/GCP/Azure services <strong>without public internet</strong>.</p><h3>42. What is VPC Flow Logs used for?</h3><p>To analyze traffic:</p><pre>REJECT<br>ACCEPT</pre><p>Stored in CloudWatch/S3.</p><h3>43. Anycast Load Balancing — Explain.</h3><p>One IP advertised globally → request goes to nearest POP.</p><p>CloudFront / GCP GCLB use Anycast.</p><h3>44. Network Bottleneck Analysis — how?</h3><p>Check:</p><ul><li>Bandwidth utilization</li><li>p99 latency</li><li>RTT</li><li>Packet drops</li><li>ENI saturation</li></ul><h3>45. What is a Bastion?</h3><p>A hardened SSH jump-box for private servers.</p><h3>46. Difference between L4 and L7 load balancing.</h3><p>LayerMeaningExampleL4TCP/UDPNLBL7HTTP/HTTPSALB</p><h3>47. Why VPN tunnels flap?</h3><p>Reasons:</p><ul><li>Misconfigured BGP timers</li><li>Phase 1/2 mismatch</li><li>ISP instability</li><li>MTU mismatch</li></ul><h3>48. What is Split Tunnel vs Full Tunnel VPN?</h3><p>Split → Only private traffic<br> Full → All traffic through VPN</p><h3>49. How to secure VPC communication?</h3><ul><li>SG &amp; NACL</li><li>Zero Trust</li><li>PrivateLink</li><li>Firewall appliances</li><li>TLS everywhere</li></ul><h3>50. What is Overlay Networking (VXLAN)?</h3><p>Encapsulates L2 packets in L4 → used in Kubernetes CNI.</p><h3>Quick reference — useful commands &amp; tools (cheat sheet)</h3><ul><li><strong>Network introspection:</strong> ip addr, ip route, ss -tulpen, netstat -rn</li><li><strong>Capture &amp; inspect:</strong> tcpdump -i eth0 host &lt;ip&gt; and port 443 -w out.pcap → Wireshark/tshark</li><li><strong>Connection check:</strong> curl -v, telnet host port, nc -vz host port</li><li><strong>Linux firewall:</strong> sudo iptables -L -n -v, sudo nft list ruleset</li><li><strong>Interfaces &amp; stats:</strong> ethtool -S eth0, cat /proc/net/dev</li><li><strong>Kubernetes:</strong> kubectl get pods -n kube-system, kubectl exec -it pod -- ip a</li><li><strong>AWS diagnostics:</strong> aws ec2 describe-instances, aws ec2 describe-route-tables, VPC Flow Logs, AWS Reachability Analyzer</li><li><strong>GCP diagnostics:</strong> gcloud compute networks, VPC Flow Logs, Cloud Router/BGP status</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5293e5212ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Ultimate Networking Interview Guide for CloudOps & DevOps Engineers (Basic → Advanced →…]]></title>
            <link>https://medium.com/devsecops-ai/ultimate-networking-interview-guide-for-cloudops-devops-engineers-basic-advanced-633e84f241ab?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/633e84f241ab</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[netowrking]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 14:08:03 GMT</pubDate>
            <atom:updated>2025-11-14T14:08:03.979Z</atom:updated>
            <content:encoded><![CDATA[<h3>🔥 Ultimate Networking Interview Guide for CloudOps &amp; DevOps Engineers (Basic → Advanced → Multi-Cloud Architecture) | 2025 Edition</h3><p>Networking is the backbone of cloud infrastructure, DevOps pipelines, distributed systems, security, and modern multi-cloud environments. Whether you’re interviewing for <strong>CloudOps</strong>, <strong>DevOps</strong>, <strong>SRE</strong>, <strong>Platform Engineer</strong>, or <strong>Cloud Architect</strong>, strong networking knowledge is mandatory.</p><p>This blog covers <strong>beginner → mid → senior → architect level networking Q&amp;A</strong>, each with <strong>real-world examples, diagrams, commands, and SME-level insights</strong>.</p><h3>1. What is the OSI model? Explain all 7 layers with real-time examples.</h3><h3>✅ Answer:</h3><p>OSI is a conceptual model for how data moves in a network.</p><p>⭐ <strong>1. OSI Model — Explained (7 Layers Made Easy)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*46J_BGmoVyOIkmXUdnob_A.png" /></figure><p><strong>Remember:</strong><br> 💡 Layers 3–7 matter most in <strong>Cloud &amp; DevOps interviews</strong>.<br> 💡 Layers 1–2 matter in <strong>DC → Cloud migrations, hybrid networking</strong>.</p><h3>Scenario:</h3><p><strong>VPC to on-prem VPN issues?</strong><br> Check Layer 3 (routes), Layer 4 (ports), Layer 7 (app health).</p><h3>📌 Section 2: Basic Networking Q&amp;A</h3><h3>2. What is a Subnet? Why do we use it?</h3><p>A subnet divides a network into smaller logical groups.</p><p><strong>Cloud Example:</strong><br> A VPC 10.0.0.0/16 divided into:</p><ul><li>10.0.1.0/24 → Public</li><li>10.0.2.0/24 → Private</li></ul><h3>3. Difference between Public, Private, and Elastic IPs.</h3><p>TypeMeaningExample<strong>Public IP</strong>Direct internetEC2 exposed to users<strong>Private IP</strong>Internal networkDB servers<strong>Elastic IP</strong>Static public IPBastion host</p><h3>4. What is CIDR? Example?</h3><p>CIDR = Classless Inter-Domain Routing<br> 10.0.1.0/24 = 256 IPs</p><h3>5. What is DNS and how does it work?</h3><p>DNS resolves names → IP addresses.</p><p><strong>Flow:</strong><br> User → DNS Resolver → Root → TLD → Authoritative server</p><p><strong>Troubleshooting:</strong></p><pre>nslookup google.com<br>dig +trace example.com</pre><h3>📌 Section 3: Cloud Networking (AWS, Azure, GCP)</h3><h3>6. What is a VPC?</h3><p>A logically isolated cloud network.</p><p>Includes:</p><ul><li>Subnets</li><li>Route tables</li><li>Internet gateway</li><li>NAT gateway</li><li>Security groups</li><li>NACLs</li></ul><h3>7. Difference between Security Groups and Network ACLs?</h3><p>FeatureSGNACLStateStatefulStatelessApply toENI/InstanceSubnetRulesAllow onlyAllow/Deny</p><h3>8. What is a NAT Gateway?</h3><p>Used for private subnets to access the internet <strong>without exposing instances</strong>.</p><h3>9. What is VPC Peering? Limitations?</h3><p>VPC-to-VPC communication using private IPs.</p><p>Limitations:</p><ul><li>No transitive routing</li><li>CIDR must not overlap</li></ul><h3>10. What is a Transit Gateway?</h3><p>A hub for connecting:</p><ul><li>Multiple VPCs</li><li>On-prem networks</li><li>Across regions</li></ul><h3>📌 Section 4: Hybrid Networking (DC ↔ CLOUD)</h3><h3>11. How does Site-to-Site VPN work?</h3><p>Encrypted IPSec tunnels between:</p><ul><li>On-prem firewall</li><li>Cloud gateway (AWS VGW / Azure VPN Gateway / GCP Cloud VPN)</li></ul><p><strong>Ports:</strong></p><ul><li>UDP 500 (IKE)</li><li>UDP 4500 (IPSec NAT-T)</li></ul><p><strong>Troubleshooting:</strong></p><pre>ping &lt;remote-proxy-ip&gt;<br>traceroute &lt;private-ip&gt;<br>sudo tcpdump -i eth0 udp port 500</pre><h3>12. What is Direct Connect / ExpressRoute / Interconnect?</h3><p>Dedicated fiber link between DC and Cloud.</p><p>CloudServiceAWSDirect ConnectAzureExpressRouteGCPCloud Interconnect</p><p>Benefits:</p><ul><li>High speed</li><li>Low latency</li><li>Secure</li><li>Not dependent on internet</li></ul><h3>📌 Section 5: VPC-to-VPC, Multi-Region, Multi-Cloud Networking</h3><h3>13. How to connect VPC-to-VPC in different regions?</h3><p>Options:</p><ul><li>VPC Peering (regional)</li><li>Transit Gateway (recommended)</li><li>VPN over public internet</li></ul><h3>14. Multi-cloud networking architecture?</h3><p>Use:</p><ul><li>Aviatrix</li><li>CloudHub</li><li>TGW + Azure VWAN + GCP NCC</li><li>IPSec mesh</li></ul><h3>15. How to connect VPC to multiple VPCs?</h3><p><strong>Use Transit Gateway</strong><br> It supports hub-spoke.</p><h3>📌 Section 6: Service Networking (Private ↔ Public)</h3><h3>16. How does a load balancer work?</h3><ul><li>Route incoming traffic</li><li>Health checks</li><li>SSL termination</li></ul><p><strong>Ports:</strong></p><ul><li>HTTP → 80</li><li>HTTPS → 443</li></ul><p><strong>Commands:</strong></p><pre>curl -I http://my-app.com</pre><h3>17. What is a Proxy Server?</h3><p>Acts as a middleman between client &amp; server.</p><p>Types:</p><ul><li>Forward proxy (client-facing)</li><li>Reverse proxy (server-facing)</li></ul><p>Example:<br> Nginx reverse proxy → EC2 fleet</p><h3>18. What is NAT? Explain with example.</h3><p>NAT converts private → public IP.</p><p><strong>Real example:</strong><br> Private EC2 accessing internet → NAT Gateway → Public IP</p><h3>📌 Section 7: Advanced Networking (Troubleshooting + Deep Dive)</h3><h3>19. How to debug packet loss between VPC and DC?</h3><p>Check layer-by-layer:</p><h3>Layer 3 — Routes</h3><pre>ip route</pre><h3>Layer 4 — Ports</h3><pre>nc -zv &lt;ip&gt; 443<br>telnet &lt;ip&gt; 22</pre><h3>Layer 7 — Application</h3><pre>curl -v https://api.example.com</pre><h3>20. What is MTU? Why does it matter?</h3><p>MTU = Maximum Transmission Unit<br> Default 1500 bytes.</p><p>VPN/Encapsulation reduces MTU to ~1400.</p><p><strong>Fix:</strong></p><pre>ping -M do -s 1300 10.0.0.1</pre><h3>21. What is BGP? Why used in cloud?</h3><p>Routing protocol for:</p><ul><li>Direct Connect</li><li>VPN</li><li>Global gateway routing</li></ul><p>Advantages:</p><ul><li>Route advertisement</li><li>Auto failover</li><li>Scalable</li></ul><h3>22. Difference between IPv4 and IPv6</h3><p>IPv4 → 32 bit<br> IPv6 → 128 bit</p><p>Cloud adoption: IPv6 for large scale deployments.</p><h3>23. Explain Anycast vs Multicast vs Unicast.</h3><p>TermMeaningExample<strong>Unicast</strong>One-to-oneClient → Server<strong>Multicast</strong>One-to-manyStreaming clusters<strong>Anycast</strong>One IP → nearest serverCloudFront/Global LB</p><h3>📌 Section 8: Real-Time Scenarios (Interview Favorites)</h3><h3>24. Your EC2 cannot reach the internet. Troubleshoot?</h3><p>Checklist:</p><ol><li>Instance in public subnet?</li><li>Has public/elastic IP?</li><li>Route table → IGW?</li><li>SG allows outbound?</li><li>NACL allows traffic?</li></ol><h3>25. Application works internally but not externally. Why?</h3><p>Possible issues:</p><ul><li>Missing public IP</li><li>Load balancer not healthy</li><li>Wrong target group port</li><li>SG blocking 0.0.0.0/0 inbound</li></ul><h3>26. VPC Peering connected but ping not working. Why?</h3><p>Because <strong>ICMP must be allowed in both SG and NACL</strong>.</p><h3>27. On-prem can reach cloud, but cloud can’t reach on-prem. Why?</h3><p>Common causes:</p><ul><li>Route not advertised back (BGP)</li><li>Firewall rules blocking</li><li>One-way NAT</li><li>Asymmetric routing</li></ul><h3>28. DB unreachable from app?</h3><p>Checklist:</p><ul><li>Correct port (e.g., MySQL 3306, Postgres 5432)</li><li>SG inbound rule</li><li>DNS resolve</li></ul><pre>dig db.internal</pre><h3>29. High latency between regions?</h3><p>Because traffic is traversing public internet or long fiber routes.<br> Use:</p><ul><li>AWS Global Accelerator</li><li>Azure FrontDoor</li><li>GCP Cloud CDN</li></ul><h3>30. VPN tunnel UP but traffic not passing. Why?</h3><p>Possible:</p><ul><li>Wrong Phase 2 selectors</li><li>Overlapping CIDR</li><li>Asymmetric routing</li></ul><h3>📌 Section 9: Commands for Troubleshooting (Linux + Windows)</h3><h3>Network Inspection</h3><pre>ip a<br>ip route<br>ss -tulpn</pre><h3>Connectivity</h3><pre>ping &lt;ip&gt;<br>traceroute &lt;ip&gt;<br>mtr &lt;ip&gt;<br>telnet &lt;ip&gt; 443<br>nc -zv &lt;ip&gt; &lt;port&gt;<br>curl -v &lt;url&gt;</pre><h3>DNS</h3><pre>nslookup &lt;domain&gt;<br>dig &lt;domain&gt;<br>host &lt;domain&gt;</pre><h3>Packet Capture</h3><pre>tcpdump -i eth0 host &lt;ip&gt;<br>tcpdump -vv -n port 443</pre><h3>Windows</h3><pre>Test-NetConnection -ComputerName &lt;ip&gt; -Port 443<br>tracert &lt;ip&gt;</pre><h3>📌 Section 10: Ports Every DevOps Engineer Must Know</h3><p>ServicePortSSH22HTTP80HTTPS443DNS53MySQL3306PostgreSQL5432MongoDB27017RDP3389NTP123SMTP25VPN / IPSec500, 4500</p><h3>📌 Section 11: High-Level Architecture Questions (Senior/Lead Level)</h3><h3>31. How do you architect a multi-cloud network?</h3><h3>Core Components:</h3><ul><li>Hub-Spoke in each cloud</li><li>Transit gateway equivalents</li><li>Centralized firewall (Palo Alto, FortiGate, CheckPoint)</li><li>Anycast DNS</li><li>Global routing via BGP</li></ul><h3>32. How do you design DR networking across regions?</h3><ul><li>VPC peering / TGW interconnect</li><li>Global load balancer</li><li>DNS failover</li><li>Replicated subnets</li><li>Active-Passive or Active-Active</li></ul><h3>33. Zero Trust Networking — Explain.</h3><p>Trust nothing. Validate everything.</p><p>Includes:</p><ul><li>Identity-based access</li><li>Private Link</li><li>Microsegmentation</li><li>No public exposure</li></ul><h3>📌 Section 12: Final 10 Expert-Level Networking Questions</h3><h3>41. What is PrivateLink?</h3><p>Private access to AWS/GCP/Azure services <strong>without public internet</strong>.</p><h3>42. What is VPC Flow Logs used for?</h3><p>To analyze traffic:</p><pre>REJECT<br>ACCEPT</pre><p>Stored in CloudWatch/S3.</p><h3>43. Anycast Load Balancing — Explain.</h3><p>One IP advertised globally → request goes to nearest POP.</p><p>CloudFront / GCP GCLB use Anycast.</p><h3>44. Network Bottleneck Analysis — how?</h3><p>Check:</p><ul><li>Bandwidth utilization</li><li>p99 latency</li><li>RTT</li><li>Packet drops</li><li>ENI saturation</li></ul><h3>45. What is a Bastion?</h3><p>A hardened SSH jump-box for private servers.</p><h3>46. Difference between L4 and L7 load balancing.</h3><p>LayerMeaningExampleL4TCP/UDPNLBL7HTTP/HTTPSALB</p><h3>47. Why VPN tunnels flap?</h3><p>Reasons:</p><ul><li>Misconfigured BGP timers</li><li>Phase 1/2 mismatch</li><li>ISP instability</li><li>MTU mismatch</li></ul><h3>48. What is Split Tunnel vs Full Tunnel VPN?</h3><p>Split → Only private traffic<br> Full → All traffic through VPN</p><h3>49. How to secure VPC communication?</h3><ul><li>SG &amp; NACL</li><li>Zero Trust</li><li>PrivateLink</li><li>Firewall appliances</li><li>TLS everywhere</li></ul><h3>50. What is Overlay Networking (VXLAN)?</h3><p>Encapsulates L2 packets in L4 → used in Kubernetes CNI.</p><h3>Quick reference — useful commands &amp; tools (cheat sheet)</h3><ul><li><strong>Network introspection:</strong> ip addr, ip route, ss -tulpen, netstat -rn</li><li><strong>Capture &amp; inspect:</strong> tcpdump -i eth0 host &lt;ip&gt; and port 443 -w out.pcap → Wireshark/tshark</li><li><strong>Connection check:</strong> curl -v, telnet host port, nc -vz host port</li><li><strong>Linux firewall:</strong> sudo iptables -L -n -v, sudo nft list ruleset</li><li><strong>Interfaces &amp; stats:</strong> ethtool -S eth0, cat /proc/net/dev</li><li><strong>Kubernetes:</strong> kubectl get pods -n kube-system, kubectl exec -it pod -- ip a</li><li><strong>AWS diagnostics:</strong> aws ec2 describe-instances, aws ec2 describe-route-tables, VPC Flow Logs, AWS Reachability Analyzer</li><li><strong>GCP diagnostics:</strong> gcloud compute networks, VPC Flow Logs, Cloud Router/BGP status</li><li><strong>Azure diagnostics:</strong> az network vnet, NSG flow logs, Azure Network Watcher (connection troubleshoot)</li><li><strong>BGP:</strong> vtysh/bird/bgpd for routers; check show ip bgp on devices.</li></ul><p>From jump host<br>ping 10.0.1.5<br>traceroute -n 10.0.1.5<br>ssh -v ec2-user@10.0.1.5<br>sudo ss -tulpen<br>sudo iptables -L -n -v</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=633e84f241ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devsecops-ai/ultimate-networking-interview-guide-for-cloudops-devops-engineers-basic-advanced-633e84f241ab">🔥 Ultimate Networking Interview Guide for CloudOps &amp; DevOps Engineers (Basic → Advanced →…</a> was originally published in <a href="https://medium.com/devsecops-ai">DevSecOps &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[✅ MySQL Interview Questions & Answers for Cloud & DevOps Engineers]]></title>
            <link>https://medium.com/devsecops-ai/mysql-interview-questions-answers-for-cloud-devops-engineers-a761f5d0c08c?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/a761f5d0c08c</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 13:50:36 GMT</pubDate>
            <atom:updated>2025-11-14T13:50:36.017Z</atom:updated>
            <content:encoded><![CDATA[<p>MySQL remains a core database engine across AWS, Azure, GCP, on-prem, and container platforms. Cloud/DevOps engineers are expected to configure, optimize, secure, automate, and troubleshoot MySQL in production.</p><p>Below is a curated set of practical MySQL Q/A that reflects <strong>real interview patterns</strong> in 2024–2025.</p><h3>✅ SECTION 1: BASIC TO MID-LEVEL QUESTIONS (FOUNDATION)</h3><h3>1. What is the difference between MySQL and MariaDB?</h3><p><strong>Answer:</strong></p><ul><li>MariaDB is a fork of MySQL created after Oracle’s acquisition.</li><li>MariaDB is faster for large writes &amp; replication.</li><li>Supports more storage engines (Aria, ColumnStore).</li><li>MySQL Enterprise features are proprietary; MariaDB is completely open-source.</li></ul><p>✅ <strong>Real-time usage:</strong> Many companies migrate to MariaDB for license-cost savings.</p><h3>2. How do you check the MySQL version?</h3><pre>mysql --version<br>mysql -u root -p -e &quot;SELECT VERSION();&quot;</pre><h3>3. How do you check database sizes in MySQL?</h3><pre>SELECT table_schema &quot;DB Name&quot;,<br>ROUND(SUM(data_length+index_length)/1024/1024,2) &quot;Size (MB)&quot;<br>FROM information_schema.tables<br>GROUP BY table_schema;</pre><p>✅ Useful for <strong>cloud storage planning</strong> and <strong>cost estimation</strong>.</p><h3>4. How do you reset the MySQL root password?</h3><p>Linux:</p><pre>sudo systemctl stop mysql<br>sudo mysqld_safe --skip-grant-tables &amp;<br>mysql<br>FLUSH PRIVILEGES;<br>ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;NewPassword@123&#39;;</pre><p>✅ Common in EC2 or on-prem when access is lost.</p><h3>5. What is the difference between InnoDB and MyISAM?</h3><p>FeatureInnoDBMyISAMTransaction support✅❌Row-level locking✅❌ (table-level)Crash recovery✅❌Foreign keys✅❌</p><p>✅ <strong>InnoDB is default</strong> and used for production workloads.</p><h3>✅ SECTION 2: DEVOPS-FOCUSED QUESTIONS</h3><h3>6. How do you back up a MySQL database?</h3><h3>Using mysqldump:</h3><pre>mysqldump -u root -p dbname &gt; backup.sql</pre><h3>Compressed backup:</h3><pre>mysqldump dbname | gzip &gt; backup.sql.gz</pre><h3>AWS Backup using RDS snapshot:</h3><ul><li>Automated daily snapshot</li><li>Point-in-time restore (PITR)</li></ul><p>✅ <strong>Real-world tip:</strong> For large DBs &gt;100GB, mysqldump is slow; use <strong>Percona Xtrabackup</strong>.</p><h3>7. Restore a MySQL backup</h3><pre>mysql -u root -p dbname &lt; backup.sql</pre><h3>8. How do you automate MySQL backups in Linux?</h3><p>Cron job:</p><pre>0 2 * * * mysqldump -u root -pPass123 db | gzip &gt; /backup/db_$(date +\%F).sql.gz</pre><p>✅ DevOps expects <strong>backup automation</strong> + <strong>retention policy</strong>.</p><h3>9. How to monitor MySQL performance?</h3><p>Use:</p><ul><li>mysqladmin status</li><li>SHOW FULL PROCESSLIST;</li><li>CloudWatch (AWS)</li><li>Azure Monitor</li><li>Prometheus + Node Exporter + MySQL Exporter</li><li>Grafana dashboards</li></ul><h3>10. Check slow queries</h3><p>Enable:</p><pre>SET global slow_query_log = 1;<br>SET global slow_query_log_file = &#39;/var/log/mysql/slow.log&#39;;<br>SET global long_query_time = 1;</pre><p>View top slow queries:</p><pre>mysqldumpslow -s t /var/log/mysql/slow.log</pre><h3>✅ SECTION 3: MID–SENIOR LEVEL QUESTIONS</h3><h3>11. How do you identify a locked table or blocked query?</h3><p>Check running queries:</p><pre>SHOW FULL PROCESSLIST;</pre><p>Identify locks:</p><pre>SELECT * FROM information_schema.innodb_locks;</pre><p>Kill a blocking process:</p><pre>KILL PROCESS_ID;</pre><p>✅ <strong>Real-time interview scenario:</strong><br> Application latency was caused by a long-running UPDATE holding locks → find &amp; kill.</p><h3>12. How do you tune MySQL for performance?</h3><p>Key parameters (in /etc/mysql/my.cnf):</p><pre>innodb_buffer_pool_size = 70% of RAM<br>innodb_log_file_size    = 1G<br>query_cache_size        = 0  (deprecated)<br>max_connections         = 500<br>thread_cache_size       = 50</pre><p>✅ Buffer pool tuning has the largest impact.</p><h3>13. How do you find top resource-heavy queries?</h3><pre>SELECT user, host, db, command, time, state, info<br>FROM information_schema.processlist<br>ORDER BY time DESC<br>LIMIT 10;</pre><h3>14. How do you perform MySQL replication?</h3><p>Steps:</p><ol><li>Enable binary logs on master<br> /etc/mysql/my.cnf</li></ol><pre>server-id = 1<br>log_bin = mysql-bin</pre><ol><li>Create replication user:</li></ol><pre>GRANT REPLICATION SLAVE ON *.* TO &#39;replica&#39;@&#39;%&#39; IDENTIFIED BY &#39;Pass123!&#39;;</pre><ol><li>On replica:</li></ol><pre>CHANGE MASTER TO MASTER_HOST=&#39;10.0.1.10&#39;,<br>MASTER_USER=&#39;replica&#39;,<br>MASTER_PASSWORD=&#39;Pass123!&#39;,<br>MASTER_LOG_FILE=&#39;mysql-bin.00001&#39;,<br>MASTER_LOG_POS=120;<br>START SLAVE;</pre><p>✅ Replication is vital for <strong>HA</strong>, <strong>scaling reads</strong>, <strong>blue-green releases</strong>.</p><h3>15. Check replication status</h3><pre>SHOW SLAVE STATUS\G;</pre><p>Look for:</p><ul><li>Seconds_Behind_Master</li><li>Last_IO_Error</li><li>Last_SQL_Error</li></ul><h3>16. Fix replication error (duplicate entry)</h3><pre>SET GLOBAL sql_slave_skip_counter = 1;<br>START SLAVE;</pre><p>✅ Common during schema drift or manual data entry.</p><h3>17. What is GTID replication?</h3><ul><li>Global Transaction Identifiers</li><li>Simplifies failover</li><li>Avoids complex log position management</li></ul><p>Enable:</p><pre>gtid-mode=ON<br>enforce-gtid-consistency=TRUE</pre><h3>18. How to migrate on-prem MySQL to AWS RDS?</h3><p>Ways:</p><ul><li>mysqldump (small DBs)</li><li>AWS DMS (minimal downtime)</li><li>Percona Xtrabackup → S3 → restore</li><li>Native RDS Import</li></ul><p>✅ Senior-level engineers must mention <strong>DMS</strong>.</p><h3>19. Common MySQL bottlenecks</h3><ul><li>Slow disks (use SSD or EBS gp3/io1)</li><li>No indexes</li><li>Table scans</li><li>Deadlocks</li><li>Bad schema design</li><li>Insufficient buffer pool</li></ul><h3>20. How to detect missing indexes?</h3><pre>SELECT * FROM performance_schema.table_io_waits_summary_by_index_usage<br>WHERE OBJECT_SCHEMA NOT IN (&#39;mysql&#39;,&#39;performance_schema&#39;)<br>AND INDEX_NAME IS NULL;</pre><h3>✅ SECTION 4: SENIOR LEVEL / REAL-TIME SCENARIOS</h3><h3>21. MySQL CPU usage is suddenly 100%. How do you troubleshoot?</h3><ol><li>Identify queries:</li></ol><pre>SHOW FULL PROCESSLIST;</pre><ol><li>Check slow query logs</li><li>Check index usage</li><li>Check buffer pool hit ratio</li><li>Use htop to see if mysqld is the culprit</li><li>Kill problematic query:</li></ol><pre>KILL 1234;</pre><ol><li>If using Docker:</li></ol><pre>docker stats</pre><p>✅ Companies love this scenario.</p><h3>22. How do you optimize a slow query?</h3><p>Example slow query:</p><pre>SELECT * FROM orders WHERE customer_id = 100;</pre><p>Fix → add index:</p><pre>CREATE INDEX idx_customer ON orders(customer_id);</pre><h3>23. How to handle MySQL HA in AWS?</h3><p>Options:</p><ul><li>RDS Multi-AZ</li><li>Aurora MySQL</li><li>Failover using DNS (Route53)</li><li>Read replicas</li></ul><p>✅ For senior roles, mention <strong>Aurora (Paxos-based consensus)</strong>.</p><h3>24. MySQL crashed; how to recover InnoDB tables?</h3><pre>innodb_force_recovery = 1..6</pre><p>Steps:</p><ol><li>Add recovery flag</li><li>Restart MySQL</li><li>Dump data</li><li>Reinstall MySQL</li><li>Restore backup</li></ol><h3>25. How do you secure MySQL in production?</h3><ul><li>Disable remote root login</li><li>Enable TLS for client connections</li><li>Use Vault/SSM Parameter Store for passwords</li><li>Enable audit logs</li><li>Strong password policy</li><li>Enforce principle of least privilege</li></ul><h3>26. How do you perform auditing in MySQL?</h3><p>Enable audit plugin:</p><pre>INSTALL PLUGIN audit_log SONAME &#39;audit_log.so&#39;;<br>SET GLOBAL audit_log_policy = ALL;</pre><h3>27. How do you check table fragmentation?</h3><pre>SHOW TABLE STATUS LIKE &#39;orders&#39;;<br>OPTIMIZE TABLE orders;</pre><p>✅ Reclaims disk space.</p><h3>28. How do you convert MySQL data to CSV?</h3><pre>SELECT * FROM users<br>INTO OUTFILE &#39;/tmp/users.csv&#39;<br>FIELDS TERMINATED BY &#39;,&#39;<br>ENCLOSED BY &#39;&quot;&#39;<br>LINES TERMINATED BY &#39;\n&#39;;</pre><h3>29. How to do zero-downtime schema migration?</h3><p>Tools:</p><ul><li>pt-online-schema-change (Percona)</li><li>gh-ost (GitHub)</li><li>Liquibase</li><li>Flyway</li></ul><p>✅ Senior-level DevOps MUST know this.</p><h3>30. How to containerize MySQL?</h3><p>docker-compose:</p><pre>services:<br>  mysql:<br>    image: mysql:8<br>    environment:<br>      MYSQL_ROOT_PASSWORD: Pass123<br>    volumes:<br>      - mysql_data:/var/lib/mysql<br>    ports:<br>      - &quot;3306:3306&quot;</pre><h3>✅ 31–40: QUICKFIRE SENIOR QUESTIONS</h3><p>31. What is a covering index?</p><p>Index contains all needed columns → no table read.</p><p>32. What is the binary log used for?</p><p>READ COMMITTED, REPEATABLE READ (default), SERIALIZABLE.</p><p>34. What is a deadlock?</p><p>Cyclic dependency between transactions.</p><p>35. Detect deadlocks?</p><p>SHOW ENGINE INNODB STATUS\G</p><p>36. ACID?</p><p>Atomicity, Consistency, Isolation, Durability.</p><p>37. MySQL port?</p><p>3306</p><p>38. How to import large file faster?</p><p>Disable FK, disable index rebuilding.</p><p>39. How to encrypt MySQL at rest in cloud?</p><p>KMS (AWS), Key Vault (Azure), CMEK (GCP).</p><p>40. How to rotate MySQL passwords?</p><p>Vault, Secrets Manager, automation via cron/Lambda.</p><h3>✅ 41–50: LOUD + SRE-LEVEL QUESTIONS</h3><h3>41. How do you implement MySQL disaster recovery?</h3><ul><li>Automated backups</li><li>Cross-region replication</li><li>Periodic restore tests</li><li>PITR</li><li>RPO/RTO planning</li></ul><h3>42. How do you detect anomalies in MySQL logs?</h3><p>Use:</p><ul><li>ELK / OpenSearch</li><li>CloudWatch Logs Insights</li><li>Datadog queries</li></ul><p>Example query:</p><pre>fields @message<br>| filter @message like /ERROR|FAILED|DENIED/</pre><h3>43. How to migrate MySQL from EC2 → RDS?</h3><ul><li>Use DMS</li><li>Precutover + binlog replication</li><li>Switchover</li></ul><h3>44. How to check IOPS usage in MySQL?</h3><pre>SHOW GLOBAL STATUS LIKE &#39;Innodb_data_reads&#39;;<br>SHOW GLOBAL STATUS LIKE &#39;Innodb_data_writes&#39;;</pre><h3>45. How do you optimize MySQL for high concurrency?</h3><ul><li>Connection pooling (ProxySQL / PMM)</li><li>Caching layer (Redis)</li><li>Read replicas</li><li>Tune thread pool</li></ul><h3>46. How do you handle schema versioning?</h3><ul><li>Liquibase</li><li>Migration pipelines</li><li>GitOps patterns</li></ul><h3>47. How do you troubleshoot replication lag?</h3><p>Check:</p><ul><li>network latency</li><li>large transactions</li><li>slow queries on slave</li></ul><p>Fix:</p><ul><li>Use multi-threaded slave:</li></ul><pre>slave_parallel_workers=8</pre><h3>48. What is ProxySQL?</h3><ul><li>MySQL load balancer</li><li>Query caching</li><li>Read/write split</li><li>Used in high-load clusters</li></ul><h3>49. Explain MySQL Cluster (NDB).</h3><ul><li>Real-time distributed clustering</li><li>In-memory</li><li>Auto-sharding</li></ul><p>Used in telecom/financial systems.</p><h3>50. How do you monitor MySQL storage growth?</h3><pre>SELECT table_name, data_length/1024/1024 AS data_mb<br>FROM information_schema.tables<br>WHERE table_schema=&#39;mydb&#39;;</pre><p>Automate alerts using <strong>CloudWatch</strong>, <strong>Prometheus</strong>, <strong>Grafana</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a761f5d0c08c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devsecops-ai/mysql-interview-questions-answers-for-cloud-devops-engineers-a761f5d0c08c">✅ MySQL Interview Questions &amp; Answers for Cloud &amp; DevOps Engineers</a> was originally published in <a href="https://medium.com/devsecops-ai">DevSecOps &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Squid Proxy vs HAProxy: Comprehensive Comparison for Cloud & DevOps]]></title>
            <link>https://blog.devops.dev/squid-proxy-vs-haproxy-comprehensive-comparison-for-cloud-devops-72f6f8d14607?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f6f8d14607</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[squid-proxy]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[haproxy]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 06:48:00 GMT</pubDate>
            <atom:updated>2025-11-06T10:19:24.362Z</atom:updated>
            <content:encoded><![CDATA[<h3>Architecture Overview</h3><h3>Squid Proxy Architecture</h3><pre>Client → Squid (Forward Proxy) → Internet<br>    ↑<br>Internal Network Users</pre><ul><li>Deployment: Outbound traffic gateway</li><li>Flow: Client explicitly configures proxy or transparent interception</li><li>Position: Between internal clients and external resources</li></ul><h3>HAProxy Architecture</h3><pre>Internet → HAProxy (Reverse Proxy/LB) → Application Servers<br>    ↑<br>External Users/Clients</pre><ul><li>Deployment: Inbound traffic gateway</li><li>Flow: Clients connect to HAProxy unaware of backend servers</li><li>Position: Between external clients and internal applications</li></ul><h3>Detailed Comparison Table</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QrS09WfOJn1mGxAKmZNDpQ.png" /></figure><h3>Cloud &amp; DevOps Perspective</h3><h3>Use Cases &amp; Scenarios</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*iH3WSm0-R70nC9ehxLjipg.png" /></figure><h3>Performance &amp; Scaling</h3><h3>Squid Proxy</h3><p>Pros:</p><ul><li>Excellent cache hit ratios reduce bandwidth by 30–50%</li><li>Memory-efficient caching algorithms</li><li>Handles thousands of concurrent connections</li><li>Reduces latency for cached content</li></ul><p>Cons:</p><ul><li>Single-threaded worker model (can be mitigated with multiple instances)</li><li>Cache size management complexity</li><li>SSL bumping adds overhead</li></ul><h3>HAProxy</h3><p>Pros:</p><ul><li>Multi-threaded architecture</li><li>Extremely low latency (sub-millisecond)</li><li>Handles 100K+ concurrent connections</li><li>Efficient memory usage for connection tracking</li></ul><p>Cons:</p><ul><li>No native content caching (must use separate cache layer)</li><li>SSL termination CPU intensive without hardware acceleration</li></ul><h3>Security Features</h3><h3>Squid Proxy</h3><p>Access Control:</p><ul><li>Granular ACLs by IP, domain, URL, content type, time, user</li><li>Malware filtering integration</li><li>Content filtering and blocking</li><li>SSL inspection capabilities</li></ul><p>Security Pros:</p><ul><li>Prevents data exfiltration</li><li>Blocks malicious domains</li><li>Content-based security policies</li><li>User authentication support</li></ul><h3>HAProxy</h3><p>Access Control:</p><ul><li>IP-based allow/deny lists</li><li>HTTP header inspection</li><li>GeoIP blocking</li><li>Rate limiting</li></ul><p>Security Pros:</p><ul><li>DDoS protection with rate limiting</li><li>SSL/TLS offloading with modern ciphers</li><li>TCP-level attack mitigation</li><li>Web Application Firewall integration</li></ul><h3>Configuration &amp; Management</h3><h3>Squid Proxy</h3><pre># ACL-based configuration<br>acl internal_net src 10.0.0.0/8<br>acl safe_ports port 80,443<br>acl blocked_sites dstdomain .facebook.com<br>http_access allow internal_net safe_ports<br>http_access deny blocked_sites</pre><p>Management Complexity:</p><ul><li>✅ Moderate: ACL-based configuration</li><li>✅ Good logging and monitoring</li><li>⚠️ Cache management required</li><li>✅ Content filtering policies</li></ul><h3>HAProxy</h3><pre># Backend and routing configuration<br>backend web_servers<br>    balance roundrobin<br>    server web1 10.1.1.10:80 check<br>    server web2 10.1.1.11:80 check<br>frontend http_in<br>    bind *:80<br>    use_backend web_servers</pre><p>Management Complexity:</p><ul><li>✅ Simple for basic load balancing</li><li>🔄 Complex for advanced routing</li><li>✅ Excellent health checking</li><li>✅ Runtime API for dynamic changes</li></ul><h3>Integration with Cloud Ecosystem</h3><h3>Squid Proxy Cloud Integration</h3><p>AWS:</p><ul><li>Deploy in public subnet for VPC internet egress</li><li>Integration with S3 for cache storage</li><li>CloudWatch logging</li></ul><p>Azure:</p><ul><li>NVAs for outbound traffic control</li><li>Storage accounts for cache persistence</li></ul><p>GCP:</p><ul><li>Custom images for Squid instances</li><li>Cloud Storage for cache backend</li></ul><h3>HAProxy Cloud Integration</h3><p>AWS:</p><ul><li>Alternative to ALB/NLB for custom routing</li><li>Auto Scaling Group integration</li><li>Route53 health checks</li></ul><p>Azure:</p><ul><li>Load balancer replacement for complex routing</li><li>Integration with App Service and VMs</li></ul><p>GCP:</p><ul><li>Custom load balancing beyond GCLB capabilities</li><li>Integration with Managed Instance Groups</li></ul><h3>Monitoring &amp; Observability</h3><h3>Squid Proxy</h3><p>Metrics:</p><ul><li>Cache hit ratios</li><li>Bandwidth savings</li><li>Request/response times</li><li>ACL denials and allows</li></ul><p>Tools:</p><ul><li>Cache manager (cachemgr.cgi)</li><li>Custom logging formats</li><li>Integration with ELK stack</li><li>Squid-specific monitoring tools</li></ul><h3>HAProxy</h3><p>Metrics:</p><ul><li>Backend server health</li><li>Connection rates</li><li>Response times</li><li>Queue sizes</li><li>Error rates</li></ul><p>Tools:</p><ul><li>Built-in statistics page</li><li>Prometheus metrics endpoint</li><li>Runtime API for real-time stats</li><li>Integration with Grafana, Datadog</li></ul><h3>Cost Considerations</h3><h3>Squid Proxy</h3><p>Cost Savings:</p><ul><li>Reduces cloud egress costs by 30–50%</li><li>Bandwidth optimization</li><li>Fewer external API calls</li><li>Lower data transfer costs</li></ul><p>Operational Costs:</p><ul><li>Cache storage management</li><li>Regular cache pruning</li><li>SSL certificate management for inspection</li></ul><h3>HAProxy</h3><p>Cost Savings:</p><ul><li>Reduces need for cloud load balancers (ALB/NLB)</li><li>Better resource utilization</li><li>Fewer application instances needed</li><li>Reduced downtime costs</li></ul><p>Operational Costs:</p><ul><li>SSL certificate management</li><li>Configuration complexity</li><li>Monitoring and alerting setup</li></ul><h3>Pros &amp; Cons Summary</h3><h3>Squid Proxy</h3><p>✅ Pros:</p><ul><li>Significant bandwidth cost reduction</li><li>Excellent content caching capabilities</li><li>Granular access control and filtering</li><li>Security and compliance enforcement</li><li>Reduces external dependencies</li></ul><p>❌ Cons:</p><ul><li>Single point of failure for outbound traffic</li><li>Cache management overhead</li><li>SSL inspection complexity</li><li>Not designed for application load balancing</li><li>Limited high availability features</li></ul><h3>HAProxy</h3><p>✅ Pros:</p><ul><li>High performance and low latency</li><li>Excellent load balancing capabilities</li><li>Advanced health checking</li><li>SSL termination offloading</li><li>Blue-green deployment support</li><li>Runtime configuration changes</li></ul><p>❌ Cons:</p><ul><li>No native content caching</li><li>Complex configuration for advanced use cases</li><li>Requires separate caching layer</li><li>Learning curve for advanced features</li></ul><h3>Decision Framework for Cloud &amp; DevOps</h3><h3>Choose Squid Proxy When:</h3><ul><li>You need outbound internet access control</li><li>Bandwidth cost reduction is critical</li><li>Content caching is a primary requirement</li><li>Security filtering and access control needed</li><li>Compliance requires traffic monitoring</li></ul><h3>Choose HAProxy When:</h3><ul><li>Application load balancing required</li><li>High availability for services</li><li>SSL termination at scale</li><li>Advanced traffic routing needed</li><li>Blue-green/canary deployments</li><li>API gateway functionality</li></ul><h3>Use Both When:</h3><ul><li>Complete traffic control solution needed</li><li>Both inbound and outbound traffic management</li><li>Maximum cost optimization required</li><li>Comprehensive security posture</li></ul><h3>Real-World Deployment Patterns</h3><h3>Squid Pattern: Egress Control</h3><pre>VPC:<br>├── Public Subnet: Squid Proxy (NAT Gateway alternative)<br>└── Private Subnets: Applications → Squid → Internet</pre><h3>HAProxy Pattern: Application Delivery</h3><pre>Internet → HAProxy (Auto Scaling) → <br>├── Backend: Web Servers (ASG)<br>├── Backend: API Servers (ECS/EKS)<br>└── Backend: Microservices (Various)</pre><h3>Combined Pattern: Complete Solution</h3><pre>Internet → HAProxy → Applications<br>    ↑<br>Applications → Squid → Internet</pre><p>This combined approach provides comprehensive traffic management for modern cloud environments, covering both inbound application delivery and outbound internet access control.</p><p>as blog that would be helpful to post in medium</p><h3>Squid Proxy vs HAProxy: The Ultimate Guide for Cloud &amp; DevOps Engineers</h3><p><em>Choosing the right proxy solution for your infrastructure needs</em></p><p><a href="https://cdn-images-1.medium.com/max/1200/1*Q8lYZsT0m4W7h7qJzq6J2Q.png">https://cdn-images-1.medium.com/max/1200/1*Q8lYZsT0m4W7h7qJzq6J2Q.png</a></p><p>As cloud and DevOps engineers, we constantly face decisions about how to route, secure, and optimize traffic in our infrastructure. Two of the most common tools in this space are Squid Proxy and HAProxy — but they serve fundamentally different purposes. Understanding when to use each (or both!) can dramatically improve your system’s performance, security, and cost-efficiency.</p><h3>The Fundamental Difference: Direction Matters</h3><p>Before we dive deep, let’s understand the core architectural difference:</p><h3>🚀 Squid Proxy: The Outbound Guardian</h3><p>Squid is primarily a forward proxy that sits between your internal users/services and the external internet. Think of it as your organization’s bouncer for outbound traffic.</p><pre>Internal Users → Squid Proxy → Internet</pre><h3>🔄 HAProxy: The Inbound Traffic Cop</h3><p>HAProxy is primarily a reverse proxy and load balancer that sits between the internet and your applications. It’s the traffic director for inbound requests.</p><pre>Internet → HAProxy → Your Application Servers</pre><h3>Real-World Scenarios: When to Use Which?</h3><h3>Use Case 1: Private Subnet Internet Access</h3><p>Problem: Your applications in private cloud subnets need internet access for updates, package downloads, or external API calls, but you don’t want to give every instance a public IP.</p><p>✅ Squid Solution:</p><pre># Deploy Squid in public subnet<br># Configure applications to use proxy<br>export http_proxy=http://squid-proxy:3128<br>export https_proxy=http://squid-proxy:3128</pre><p>Result: Centralized control, security auditing, and significant cost savings through caching.</p><h3>Use Case 2: Application Load Balancing &amp; High Availability</h3><p>Problem: You need to distribute traffic across multiple application instances while ensuring high availability and zero-downtime deployments.</p><p>✅ HAProxy Solution:</p><p>bash</p><pre># haproxy.cfg<br>backend web_servers<br>    balance roundrobin<br>    server web1 10.0.1.10:80 check<br>    server web2 10.0.1.11:80 check<br>    server web3 10.0.1.12:80 check</pre><p>Result: Automatic failover, even traffic distribution, and seamless deployments.</p><h3>Performance Deep Dive</h3><h3>Squid: The Bandwidth Saver</h3><p>Squid excels at reducing your cloud bills through intelligent caching. In one real-world scenario, a company reduced their egress costs by 47% simply by implementing Squid caching for their development environment.</p><p>Key metrics:</p><ul><li>Cache hit ratios: 60–80% typical</li><li>Bandwidth reduction: 30–50%</li><li>Latency improvement for cached content: 70–90%</li></ul><h3>HAProxy: The Speed Demon</h3><p>HAProxy focuses on raw performance and connection handling:</p><p>Key metrics:</p><ul><li>Latency: Sub-millisecond</li><li>Concurrent connections: 100K+</li><li>CPU utilization: Minimal for basic routing</li></ul><h3>Security Showdown</h3><h3>🔒 Squid Security Features</h3><ul><li>Content Filtering: Block malicious sites and unwanted content</li><li>Access Controls: Granular policies by user, IP, time, and content type</li><li>SSL Inspection: Decrypt and inspect HTTPS traffic</li><li>Data Loss Prevention: Monitor and block sensitive data exfiltration</li></ul><pre># Example: Block social media during work hours<br>acl work_hours time M T W T F 09:00-17:00<br>acl social_media dstdomain .facebook.com .twitter.com<br>http_access deny social_media work_hours</pre><h3>🛡️ HAProxy Security Features</h3><ul><li>DDoS Protection: Rate limiting and connection throttling</li><li>SSL/TLS Offloading: Centralized certificate management</li><li>IP Whitelisting: Restrict access to specific networks</li><li>WAF Integration: Web Application Firewall capabilities</li></ul><pre># Rate limiting example<br>stick-table type ip size 1m expire 10m store http_req_rate(10s)<br>http-request track-sc0 src<br>http-request deny deny_status 429 if { sc_http_req_rate(0) gt 100 }</pre><h3>Cost Impact Analysis</h3><h3>Squid: The Cost Optimizer</h3><p>Savings areas:</p><ul><li>Egress costs: Cache hits don’t hit the internet</li><li>API calls: Reduced external API consumption</li><li>License costs: Open source vs commercial proxies</li></ul><p>Example: A medium-sized company with 10TB monthly egress might save $900/month with Squid caching (assuming 40% cache ratio at $0.15/GB).</p><h3>HAProxy: The Resource Optimizer</h3><p>Savings areas:</p><ul><li>Cloud load balancers: Replace expensive ALB/NLB instances</li><li>Resource utilization: Better server usage through efficient load balancing</li><li>Uptime: Reduced outage costs</li></ul><h3>Configuration Comparison</h3><h3>Squid Configuration Snippet</h3><pre># /etc/squid/squid.conf<br>acl internal_net src 10.0.0.0/8<br>acl safe_ports port 80,443,21<br>acl blocked_sites dstdomain &quot;/etc/squid/blocked_sites.list&quot;</pre><pre>http_access allow internal_net safe_ports<br>http_access deny blocked_sites<br>http_access deny all</pre><pre>cache_dir ufs /var/spool/squid 10000 16 256</pre><h3>HAProxy Configuration Snippet</h3><pre># /etc/haproxy/haproxy.cfg<br>frontend web_frontend<br>    bind *:80<br>    bind *:443 ssl crt /etc/ssl/private/app.pem<br>    <br>    acl host_app hdr(host) -i app.example.com<br>    acl host_api hdr(host) -i api.example.com<br>    <br>    use_backend app_servers if host_app<br>    use_backend api_servers if host_api</pre><pre>backend app_servers<br>    balance roundrobin<br>    server app1 10.0.1.10:80 check<br>    server app2 10.0.1.11:80 check</pre><h3>Monitoring &amp; Observability</h3><h3>Squid Monitoring</h3><ul><li>Cache performance: Hit ratios, memory usage, storage utilization</li><li>Access logs: Detailed request/response logging</li><li>Bandwidth metrics: Savings calculations, traffic patterns</li></ul><h3>HAProxy Monitoring</h3><ul><li>Real-time stats: Connection rates, queue sizes, server status</li><li>Health checks: Backend server availability</li><li>Performance metrics: Response times, error rates</li></ul><pre># HAProxy stats via runtime API<br>echo &quot;show stat&quot; | socat stdio /var/run/haproxy/admin.sock</pre><h3>The Modern DevOps Stack Integration</h3><h3>Kubernetes Integration</h3><p>Squid: Run as a DaemonSet for pod-level internet access control<br>HAProxy: Use as Ingress Controller for traffic routing to services</p><h3>Infrastructure as Code</h3><pre># Squid deployment<br>resource &quot;aws_instance&quot; &quot;squid_proxy&quot; {<br>  ami           = &quot;ami-0c02fb55956c7d316&quot;<br>  instance_type = &quot;t3.medium&quot;<br>  subnet_id     = aws_subnet.public.id<br>  <br>  user_data = file(&quot;squid-config.sh&quot;)<br>}</pre><pre># HAProxy deployment<br>resource &quot;aws_launch_configuration&quot; &quot;haproxy_lc&quot; {<br>  image_id      = &quot;ami-0c02fb55956c7d316&quot; <br>  instance_type = &quot;t3.large&quot;<br>  user_data     = file(&quot;haproxy-config.sh&quot;)<br>}</pre><h3>When to Use Both: The Complete Solution</h3><p>In mature cloud environments, you’ll often see both proxies working together:</p><pre>Internet Users → HAProxy (Load Balancing)<br>                     ↓<br>              Application Servers<br>                     ↓<br>                Squid Proxy (Egress)<br>                     ↓  <br>                  Internet</pre><p>This architecture gives you:</p><ul><li>Inbound control via HAProxy (load balancing, SSL termination)</li><li>Outbound control via Squid (caching, security filtering)</li><li>Complete traffic management for both directions</li></ul><h3>Decision Framework</h3><h3>Choose Squid When:</h3><ul><li>You need outbound internet access control</li><li>Bandwidth cost reduction is critical</li><li>Content caching is a primary requirement</li><li>Security filtering and compliance monitoring needed</li><li>You’re managing developer workstation internet access</li></ul><h3>Choose HAProxy When:</h3><ul><li>Application load balancing required</li><li>High availability and failover needed</li><li>SSL termination at scale</li><li>Advanced traffic routing (blue-green, canary)</li><li>API gateway functionality</li></ul><h3>Use Both When:</h3><ul><li>Complete traffic control solution needed</li><li>Both inbound and outbound traffic management</li><li>Maximum cost optimization required</li><li>Comprehensive security posture</li></ul><h3>Key Takeaways</h3><ol><li>Squid is your outbound traffic and caching specialist — perfect for controlling what leaves your network and saving bandwidth costs.</li><li>HAProxy is your inbound traffic and load balancing expert — ideal for directing traffic to your applications and ensuring high availability.</li><li>Using both provides comprehensive traffic management covering all directions.</li><li>Consider your primary use case — outbound control vs inbound load balancing — to choose the right tool.</li><li>Don’t forget monitoring — both tools provide extensive metrics that are crucial for maintaining healthy infrastructure.</li></ol><h3>Next Steps</h3><p>Ready to implement? Check out these resources:</p><ul><li><a href="http://www.squid-cache.org/Doc/">Squid Official Documentation</a></li><li><a href="https://www.haproxy.org/documentation/">HAProxy Documentation</a></li><li><a href="https://registry.terraform.io/search/modules?q=proxy">Terraform Proxy Modules</a></li></ul><p>What’s your experience with proxy solutions? Have you used Squid or HAProxy in interesting ways? Share your stories in the comments below!</p><p><em>Follow me for more cloud and DevOps insights. Click the follow button below to get updates when I publish new articles!</em></p><p>Tags: #DevOps #CloudComputing #LoadBalancing #Proxy #Squid #HAProxy #AWS #Azure #GCP #Infrastructure #NetworkSecurity</p><p><em>Disclaimer: All performance numbers are based on typical deployments and may vary based on specific use cases and configurations.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f6f8d14607" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/squid-proxy-vs-haproxy-comprehensive-comparison-for-cloud-devops-72f6f8d14607">Squid Proxy vs HAProxy: Comprehensive Comparison for Cloud &amp; DevOps</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate 2025 Linux Troubleshooting & Security Forensics Guide (High-level Commands for SRE…]]></title>
            <link>https://blog.devops.dev/the-ultimate-2025-linux-troubleshooting-security-forensics-guide-high-level-commands-for-sre-385485016541?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/385485016541</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 06:18:03 GMT</pubDate>
            <atom:updated>2025-11-18T06:27:20.783Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Ultimate 2025 Linux Troubleshooting &amp; Security Forensics Guide (High-level Commands for SRE, DevOps &amp; SecOps)</h3><h3>🚀 Performance &amp; Process Analysis</h3><h3>Process Monitoring Deep Dive</h3><pre># Real-time process analysis<br>top -p PID1,PID2,PID3              # Monitor specific processes by PID<br>htop --tree                         # Visual process tree representation<br>pidstat 2 5                        # Detailed process stats every 2s for 5 iterations<br>ps aux --sort=-%mem | head -10     # Top 10 memory hogs<br>ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head -20  # Custom process output<br>pstree -p -a -A                    # ASCII process tree with PIDs and arguments</pre><pre># What these tell you:<br># - Resource bottlenecks (CPU, memory, I/O)<br># - Process hierarchies and parent-child relationships<br># - Zombie processes and orphaned tasks</pre><h3>Advanced Performance Diagnostics</h3><pre># CPU and memory analysis<br>mpstat -P ALL 1                    # Per-core CPU utilization breakdown<br>sar -u 1 5                         # System Activity Reporter - CPU history<br>vmstat 1 10                        # Virtual memory, blocks, and CPU activity<br>free -h -s 5                       # Human-readable memory usage every 5s<br>slabtop -o                         # Kernel slab cache memory usage<br>numastat -m                        # NUMA memory allocation statistics</pre><pre># I/O Subsystem<br>iostat -x 1 10                     # Extended I/O statistics with utilization<br>iotop -o                           # Real-time I/O usage by process<br>lsof +D /var/log                   # All open files in directory<br>fuser -v /mnt/database             # Processes using specific filesystem</pre><pre># Key insights:<br># - CPU steal time (virtualization overhead)<br># - Memory pressure and swap activity<br># - I/O wait times and disk saturation<br># - Kernel memory allocation patterns</pre><h3>🌐 Network Troubleshooting Mastery</h3><h3>Connection State Analysis</h3><pre># Comprehensive socket diagnostics<br>ss -tulnpe                         # All listening sockets with processes and extended info<br>ss -s                              # Socket statistics summary<br>netstat -tunlp                     # Traditional socket listing with PID/program<br>netstat -s                         # Network stack statistics (packets, errors, drops)<br>lsof -i :80                        # Processes using port 80<br>lsof -i tcp                        # All TCP connections</pre><pre># Advanced socket filtering<br>ss -o state established &#39;( dport = :443 or sport = :443 )&#39;  # Active HTTPS connections<br>ss -ltp                            # Listening TCP sockets with processes</pre><pre># Critical for:<br># - Port conflicts and service binding issues<br># - Connection state problems (TIME_WAIT accumulation)<br># - Identifying processes behind network activity</pre><h3>Packet Analysis &amp; Routing</h3><pre># Traffic capture and analysis<br>tcpdump -i any -n port 53          # Capture DNS traffic on all interfaces<br>tcpdump -i eth0 -w capture.pcap    # Save packet capture to file<br>tshark -i eth0 -f &quot;port 80&quot;        # Wireshark CLI for HTTP analysis<br>tcpflow -c port 8080               # Reconstruct TCP streams for debugging</pre><pre># Network path analysis<br>mtr -w 8.8.8.8                     # Continuous traceroute with statistics<br>tracepath google.com               # Path MTU discovery<br>ip route show table all            # Display all routing tables<br>ip rule show                       # Routing policy database</pre><pre># Essential for:<br># - Network latency and packet loss diagnosis<br># - Routing issues and asymmetric paths<br># - Application protocol debugging</pre><h3>🔒 Security &amp; Audit Framework</h3><h3>System Auditing Commands</h3><pre># Linux Audit Framework (auditd)<br>ausearch -k failed-login           # Search audit logs for specific key<br>aureport -l -i                     # Comprehensive login report<br>auditctl -l                        # List active audit rules<br>ausearch -ts today -m USER_LOGIN   # Today&#39;s login events</pre><pre># Security scanning and verification<br>rpm -Va                            # Verify integrity of all RPM packages<br>dpkg --verify apache2              # Debian package verification<br>chkrootkit                         # Rootkit detection scan<br>rkhunter --check                   # Comprehensive rootkit and backdoor scan</pre><pre># These commands:<br># - Track security policy violations<br># - Detect package tampering<br># - Identify rootkits and compromises</pre><h3>File Integrity &amp; Change Monitoring</h3><pre># File system change detection<br>find /etc -type f -mtime -1        # Files modified in last 24 hours<br>find /var/log -name &quot;*.log&quot; -size +100M  # Large log files<br>ls -laZ /etc/passwd                # View SELinux security context<br>stat /etc/shadow                   # Detailed file metadata and timestamps</pre><pre># Integrity verification<br>md5sum /sbin/init                  # System binary integrity check<br>sha256sum /bin/bash                # Cryptographic hash verification<br>cmp /bin/ls /backup/ls             # Byte-by-byte file comparison</pre><pre># Critical for:<br># - Detecting unauthorized file changes<br># - Security incident investigation<br># - Compliance and audit requirements</pre><h3>🛡️ Iptables &amp; Firewall Expertise</h3><h3>Firewall Rule Management</h3><pre># Comprehensive iptables inspection<br>iptables -L -n -v --line-numbers   # List all rules with counters and line numbers<br>iptables -t nat -L -v              # NAT table rules with verbosity<br>iptables-save &gt; firewall.rules     # Backup current firewall state<br>iptables-restore &lt; firewall.rules  # Restore firewall rules</pre><pre># Advanced rule examples<br>iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --set --name SSH<br>iptables -A INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name SSH -j DROP</pre><pre># These techniques:<br># - Implement SSH brute force protection<br># - Provide connection rate limiting<br># - Enable stateful firewall tracking</pre><h3>Advanced Firewall Techniques</h3><pre># Rate limiting and DDoS protection<br>iptables -I INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m limit --limit 10/minute --limit-burst 20 -j ACCEPT<br>iptables -A INPUT -p tcp --dport 80 -j DROP</pre><pre># Connection tracking and analysis<br>conntrack -L                       # View connection tracking table<br>conntrack -E                       # Real-time connection events<br>conntrack -D -s 192.168.1.100      # Delete connections from specific IP</pre><pre># Essential for:<br># - DDoS mitigation and rate limiting<br># - Network forensics and connection analysis<br># - Stateful firewall troubleshooting</pre><h3>⚙️ System &amp; Kernel Diagnostics</h3><h3>Kernel and Hardware Analysis</h3><pre># Kernel parameters and modules<br>sysctl -a | grep tcp               # TCP/IP kernel parameters<br>lsmod | grep bridge                # Check loaded kernel modules<br>modinfo e1000                      # Network driver information<br>dmesg -T | tail -50                # Recent kernel messages with timestamps<br>journalctl -k -f                   # Follow kernel messages in real-time</pre><pre># Hardware information<br>lscpu                              # Detailed CPU architecture info<br>lsblk -o NAME,SIZE,TYPE,MOUNTPOINT # Block devices with mount points<br>lspci -v | grep -i network         # Network hardware details<br>dmidecode -t memory                # RAM configuration and information</pre><pre># Critical for:<br># - Kernel parameter optimization<br># - Hardware compatibility issues<br># - Driver and module problems</pre><h3>Storage and Filesystem Analysis</h3><pre># Disk and filesystem diagnostics<br>df -hT                             # Filesystem space, type, and usage<br>du -sh /var/* | sort -hr           # Directory sizes sorted by usage<br>lsblk -f                           # Block devices with filesystem types<br>mount | grep ^/dev                 # Currently mounted filesystems<br>smartctl -a /dev/sda               # Disk health and SMART data</pre><pre># Inode and file handling<br>find / -xdev -printf &#39;%h\n&#39; | sort | uniq -c | sort -rn | head -10  # Directories with most files<br>df -i                              # Inode usage per filesystem</pre><pre># Essential for:<br># - Storage capacity planning<br># - Filesystem corruption detection<br>- Disk failure prediction</pre><h3>📊 Log Analysis &amp; Anomaly Detection</h3><h3>Comprehensive Log Monitoring</h3><pre># Real-time log analysis<br>tail -f /var/log/syslog | grep -i error<br>multitail /var/log/syslog /var/log/auth.log  # Monitor multiple logs simultaneously<br>journalctl -f -p err              # Follow systemd error messages</pre><pre># Pattern detection and analysis<br>grep -c &quot;Failed password&quot; /var/log/auth.log  # Count failed login attempts<br>awk &#39;/Invalid user/ {print $8}&#39; /var/log/auth.log | sort | uniq -c  # Invalid usernames count<br>zgrep &quot;session opened&quot; /var/log/auth.log*    # Search compressed log files</pre><pre># These commands help:<br># - Identify security breaches<br># - Detect system errors and failures<br># - Track user activity and access patterns</pre><h3>Security Anomaly Detection</h3><pre># User and session analysis<br>last -i                           # Login history with IP addresses<br>lastb -a                          # Failed login attempts with hostnames<br>who /var/run/utmp                 # Currently logged in users<br>w                                 # Who is logged in and what they&#39;re doing</pre><pre># Account and privilege auditing<br>getent passwd | wc -l             # Count total user accounts<br>getent group                      # List all groups<br>awk -F: &#39;($3 == 0) {print $1}&#39; /etc/passwd  # Users with UID 0 (root)</pre><pre># Critical for:<br># - Unauthorized access detection<br># - Privilege escalation attempts<br># - Account management issues</pre><h3>🐳 Container &amp; Application Troubleshooting</h3><h3>Web Server Diagnostics</h3><pre># Apache/Nginx troubleshooting<br>apachectl -t                      # Test Apache configuration syntax<br>nginx -t                          # Test Nginx configuration<br>apachectl -S                      # Show virtual host configuration<br>netstat -nap | grep :80           # Verify what&#39;s listening on port 80</pre><pre># Database performance<br>mysqladmin processlist            # MySQL active queries and connections<br>pg_stat_activity                  # PostgreSQL active queries<br>mongostat                         # MongoDB real-time statistics</pre><pre># Essential for:<br># - Web application debugging<br># - Database performance issues<br># - Service connectivity problems</pre><h3>Container &amp; Orchestration</h3><pre># Docker and Kubernetes diagnostics<br>docker stats                      # Container resource usage in real-time<br>docker logs -f container_name     # Follow container logs<br>kubectl get events --sort-by=.metadata.creationTimestamp  # Kubernetes events timeline<br>kubectl top pods                  # Pod resource usage metrics</pre><pre># These commands:<br># - Monitor container resource consumption<br># - Debug application issues in containers<br># - Track orchestration events</pre><h3>📜 Historical Analysis &amp; Forensics</h3><h3>System History Commands</h3><p>bash</p><pre># Command history analysis<br>history | awk &#39;{print $2}&#39; | sort | uniq -c | sort -rn | head -10  # Most frequent commands<br>cat ~/.bash_history | grep -e &quot;^ssh &quot;  # Historical SSH connections</pre><pre># File change tracking and timeline<br>find /etc -type f -name &quot;*.conf&quot; -exec stat -c %Y {} \; | sort -n | tail -1  # Last modified config<br>auditctl -w /etc/passwd -p wa -k passwd_changes  # Monitor passwd file for writes/accesses</pre><pre># Critical for:<br># - Security incident investigation<br># - User activity auditing<br># - Change management verification</pre><h3>🚑 Emergency Recovery Commands</h3><h3>System Rescue Operations</h3><pre># Process and system debugging<br>strace -p PID                      # Trace system calls of running process<br>ltrace -p PID                      # Trace library calls<br>gdb -p PID                         # Attach debugger to running process<br>systemctl --failed                 # List failed systemd services<br>journalctl -xb -p err..emerg      # Boot errors and critical messages</pre><pre># File system recovery<br>fsck /dev/sda1                     # Filesystem check and repair<br>xfs_repair /dev/sdb1               # XFS filesystem repair<br>testdisk /dev/sdc                  # Partition table recovery</pre><pre># Essential for:<br># - Application crash analysis<br># - System boot failures<br># - Data recovery scenarios</pre><h3>🔐 Advanced Network Security</h3><h3>Network Security Deep Dive</h3><pre># Port scanning and intrusion detection<br>netstat -an | grep SYN_RECV | wc -l  # Count half-open connections (SYN flood)<br>ss -o state syn-recv -p             # SYN_RECV state connections with processes</pre><pre># SSL/TLS security assessment<br>openssl s_client -connect example.com:443 -servername example.com  # TLS handshake debug<br>nmap --script ssl-enum-ciphers -p 443 target.com  # Cipher suite enumeration</pre><pre># Container network inspection<br>ip netns list                       # List network namespaces<br>ip netns exec namespace_name netstat -tulpn  # Network stats within namespace</pre><pre># Critical for:<br># - Network intrusion detection<br># - SSL/TLS configuration validation<br># - Container network troubleshooting</pre><h3>🛠️ Advanced Scripting Examples</h3><h3>System Health Monitor Script</h3><pre>#!/bin/bash<br># Comprehensive system health check</pre><pre>echo &quot;=== $(date) System Health Check ===&quot;<br>echo &quot;Uptime: $(uptime)&quot;<br>echo &quot;Load: $(cat /proc/loadavg)&quot;<br>echo &quot;Memory: $(free -h | grep Mem | awk &#39;{print $3&quot;/&quot;$2}&#39;)&quot;<br>echo &quot;Disk: $(df -h / | awk &#39;NR==2 {print $4 &quot; free&quot;}&#39;)&quot;</pre><pre># Critical services check<br>services=(&quot;sshd&quot; &quot;nginx&quot; &quot;mysql&quot; &quot;auditd&quot;)<br>for service in &quot;${services[@]}&quot;; do<br>    if systemctl is-active --quiet $service; then<br>        echo &quot;✓ $service: ACTIVE&quot;<br>    else<br>        echo &quot;✗ $service: INACTIVE&quot;<br>    fi<br>done</pre><pre># Security checks<br>echo &quot;Failed login attempts: $(grep -c &quot;Failed password&quot; /var/log/auth.log 2&gt;/dev/null || echo &quot;N/A&quot;)&quot;<br>echo &quot;Current connections: $(ss -tun | wc -l)&quot;</pre><h3>Network Security Monitor</h3><pre>#!/bin/bash<br># Network security monitoring script</pre><pre>echo &quot;=== Network Security Status ===&quot;<br>echo &quot;Open listening ports:&quot;<br>ss -tuln | grep LISTEN</pre><pre>echo &quot;Recent SSH failures:&quot;<br>grep &quot;Failed password&quot; /var/log/auth.log | tail -5</pre><pre>echo &quot;Current iptables rules count:&quot;<br>iptables -L -n | wc -l</pre><pre>echo &quot;Connection tracking:&quot;<br>conntrack -C 2&gt;/dev/null || echo &quot;conntrack not available&quot;</pre><h3>💡 Interview Preparation Tips</h3><h3>Common Senior Linux Interview Questions:</h3><ol><li>“How do you diagnose a server that’s running slow?”</li></ol><ul><li>Use the combination: top → pidstat → iostat → vmstat</li><li>Check: CPU steal time, I/O wait, memory pressure, swap activity</li></ul><ol><li>“How do you investigate a security breach?”</li></ol><ul><li>Start with: lastb, ausearch, check auth.log, verify checksums</li><li>Use: rkhunter, chkrootkit, lsof -i, netstat -nap</li></ul><ol><li>“How do you troubleshoot network connectivity issues?”</li></ol><ul><li>Follow the path: ping → mtr → ss → tcpdump</li><li>Check: DNS, routing, firewall rules, service status</li></ul><ol><li>“How do you monitor file changes for compliance?”</li></ol><ul><li>Implement: auditd rules, find -mtime, file integrity monitoring</li><li>Use: AIDE, tripwire, or custom checksum scripts</li></ul><h3>Key Concepts to Master:</h3><ul><li>The Linux Boot Process: BIOS → Bootloader → Kernel → Init → Runlevels</li><li>Process States: Running, Sleeping, Stopped, Zombie</li><li>Network Stack: Physical → Data Link → Network → Transport → Application</li><li>Memory Management: Physical vs Virtual memory, Swap, Page Cache</li><li>Filesystem Hierarchy: Standard directories and their purposes</li></ul><h3>📚 Additional Expert Commands</h3><h3>Systemd and Service Management</h3><pre>systemctl list-dependencies sshd    # Service dependencies<br>systemctl cat nginx                 # View service file content<br>systemctl status --failed           # All failed services<br>journalctl -u nginx --since &quot;1 hour ago&quot;  # Service logs for time period</pre><h3>Advanced Permissions and SELinux</h3><pre>getfacl /etc/shadow                 # File access control lists<br>setfacl -m u:user:rw file           # Modify ACLs<br>ls -Z /var/www/html                 # SELinux contexts<br>chcon -t httpd_sys_content_t /path  # Change SELinux context<br>sestatus                            # SELinux statu</pre><h3>Performance Benchmarking</h3><pre>sysbench cpu run                    # CPU performance test<br>fio --filename=/test.file --size=1GB --readwrite=randread  # Disk I/O test<br>iperf3 -c server_ip                 # Network bandwidth test<br>stress --cpu 4 --timeout 60s        # System stress test</pre><p>Master these commands, understand the underlying concepts, and you’ll be prepared for any troubleshooting scenario or technical interview.</p><p>Remember: True expertise isn’t just about knowing commands — it’s about understanding system behaviour, recognizing patterns, and applying the right tool for each situation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=385485016541" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/the-ultimate-2025-linux-troubleshooting-security-forensics-guide-high-level-commands-for-sre-385485016541">The Ultimate 2025 Linux Troubleshooting &amp; Security Forensics Guide (High-level Commands for SRE…</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How to Migrate a GCP VM Root Disk from Balanced Persistent Disk to SSD (Without Downtime &…]]></title>
            <link>https://blog.devops.dev/how-to-migrate-a-gcp-vm-root-disk-from-balanced-persistent-disk-to-ssd-without-downtime-dd26bd9ab3ff?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd26bd9ab3ff</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Mon, 22 Sep 2025 06:11:21 GMT</pubDate>
            <atom:updated>2025-09-25T14:14:31.224Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 How to Migrate a GCP VM Root Disk from Balanced Persistent Disk to SSD (Without Downtime &amp; Without Deleting Old Disk)</h3><p>When deploying virtual machines in <strong>Google Cloud Platform (GCP)</strong>, sometimes the root disk is created with a <strong>Balanced Persistent Disk (pd-balanced)</strong> by default. While this is cost-effective, workloads like <strong>databases, analytics, and high-IOPS applications</strong> benefit greatly from the speed of <strong>SSD Persistent Disks (pd-ssd)</strong>.</p><p>But here’s the challenge:<br> 👉 How can we <strong>migrate the root disk to SSD</strong> without downtime, while keeping the old disk safe, in the <strong>same region and zone</strong>?</p><p>In this post, I’ll walk you through a <strong>fully automated gcloud CLI script</strong> that handles this migration seamlessly.</p><h3>⚡ Why SSD Over Balanced Disk?</h3><ul><li><strong>Higher IOPS</strong> → Faster reads/writes for heavy workloads.</li><li><strong>Lower Latency</strong> → Ideal for transactional workloads.</li><li><strong>Consistent Performance</strong> → SSD guarantees performance SLAs.</li></ul><p>If your VM is running production-grade workloads, switching to SSD can drastically improve performance.</p><h3>🛠️ Step-by-Step Migration Approach</h3><p>Here’s the high-level plan we’ll automate:</p><ol><li><strong>Identify the VM and its root disk</strong></li><li><strong>Create a snapshot</strong> of the root disk</li><li><strong>Create a new SSD disk</strong> from the snapshot</li><li><strong>Stop the VM</strong> (brief downtime just for disk swap, not deletion)</li><li><strong>Detach the old disk</strong> but keep it safe</li><li><strong>Attach the new SSD disk as root</strong></li><li><strong>Start the VM</strong> again</li><li>✅ Done — VM is now running on SSD, old disk preserved.</li></ol><h3>📜 Automated Script with Variables</h3><p>Save the script as migrate-root-to-ssd.sh and run it.</p><pre>#!/bin/bash</pre><pre># ------------------------------<br># GCP Root Disk Migration Script<br># Author: Your Name<br># ------------------------------</pre><pre># ====== VARIABLES ======<br>PROJECT_ID=&quot;your-gcp-project&quot;<br>ZONE=&quot;us-central1-a&quot;<br>INSTANCE_NAME=&quot;your-vm-instance&quot;<br>NEW_DISK_NAME=&quot;${INSTANCE_NAME}-ssd-root&quot;<br>SNAPSHOT_NAME=&quot;${INSTANCE_NAME}-snapshot-$(date +%Y%m%d%H%M)&quot;<br>DISK_TYPE=&quot;pd-ssd&quot;</pre><pre># ====== STEP 1: SET PROJECT ======<br>gcloud config set project $PROJECT_ID</pre><pre># ====== STEP 2: GET ROOT DISK ======<br>ROOT_DISK=$(gcloud compute instances describe $INSTANCE_NAME \<br>  --zone=$ZONE \<br>  --format=&quot;get(disks[0].source)&quot; | awk -F/ &#39;{print $NF}&#39;)</pre><pre>echo &quot;🔍 Found root disk: $ROOT_DISK&quot;</pre><pre># ====== STEP 3: CREATE SNAPSHOT ======<br>echo &quot;📸 Creating snapshot: $SNAPSHOT_NAME&quot;<br>gcloud compute disks snapshot $ROOT_DISK \<br>  --snapshot-names=$SNAPSHOT_NAME \<br>  --zone=$ZONE \<br>  --quiet \<br>  --verbosity=info</pre><pre># Progress bar simulation<br>echo -n &quot;⏳ Snapshot in progress: &quot;<br>while true; do<br>  STATUS=$(gcloud compute snapshots describe $SNAPSHOT_NAME \<br>    --format=&quot;get(status)&quot;)<br>  if [[ &quot;$STATUS&quot; == &quot;READY&quot; ]]; then<br>    echo &quot;✅&quot;<br>    break<br>  else<br>    echo -n &quot;█&quot;<br>    sleep 5<br>  fi<br>done</pre><pre># ====== STEP 4: CREATE NEW SSD DISK ======<br>echo &quot;💾 Creating new SSD disk: $NEW_DISK_NAME&quot;<br>gcloud compute disks create $NEW_DISK_NAME \<br>  --source-snapshot=$SNAPSHOT_NAME \<br>  --type=$DISK_TYPE \<br>  --zone=$ZONE \<br>  --quiet</pre><pre># ====== STEP 5: STOP INSTANCE ======<br>echo &quot;🛑 Stopping VM: $INSTANCE_NAME&quot;<br>gcloud compute instances stop $INSTANCE_NAME --zone=$ZONE --quiet</pre><pre># ====== STEP 6: DETACH OLD DISK (SAFEKEEPING) ======<br>echo &quot;📦 Detaching old disk: $ROOT_DISK&quot;<br>gcloud compute instances detach-disk $INSTANCE_NAME \<br>  --disk=$ROOT_DISK \<br>  --zone=$ZONE</pre><pre># ====== STEP 7: ATTACH NEW SSD AS ROOT ======<br>echo &quot;🔗 Attaching new SSD root disk&quot;<br>gcloud compute instances attach-disk $INSTANCE_NAME \<br>  --disk=$NEW_DISK_NAME \<br>  --zone=$ZONE \<br>  --boot \<br>  --device-name=$NEW_DISK_NAME</pre><pre># ====== STEP 8: START INSTANCE ======<br>echo &quot;🚀 Starting VM with SSD root&quot;<br>gcloud compute instances start $INSTANCE_NAME --zone=$ZONE --quiet</pre><pre>echo &quot;🎉 Migration complete!&quot;<br>echo &quot;➡️ VM $INSTANCE_NAME is now running on $DISK_TYPE root disk.&quot;<br>echo &quot;🗂️ Old root disk $ROOT_DISK is preserved and safe.&quot;</pre><h3>📌 Notes</h3><ul><li>The script ensures <strong>everything stays in the same region &amp; zone</strong>.</li><li>The <strong>old disk is not deleted</strong>, so you have a fallback.</li><li>The downtime is minimal (only during stop &amp; attach phase).</li><li>Supports progress feedback for better UX.</li></ul><h3>✅ Conclusion</h3><p>This approach is <strong>safe, automated, and downtime-minimized</strong>. You can now confidently migrate your GCP VMs from <strong>Balanced Persistent Disk to SSD</strong> root volumes using this script.</p><p>If you’re managing <strong>production workloads</strong>, such disk upgrades can make a <strong>huge difference in performance</strong>.</p><p>✍️ <em>Did you find this guide useful?</em><br> Follow me for more <strong>real-world DevOps &amp; Cloud automation blogs</strong>! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd26bd9ab3ff" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/how-to-migrate-a-gcp-vm-root-disk-from-balanced-persistent-disk-to-ssd-without-downtime-dd26bd9ab3ff">🚀 How to Migrate a GCP VM Root Disk from Balanced Persistent Disk to SSD (Without Downtime &amp;…</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⚙️ Automating Multi-Cloud DNS with Terraform (AWS + Azure + GCP)]]></title>
            <link>https://blog.devops.dev/%EF%B8%8F-automating-multi-cloud-dns-with-terraform-aws-azure-gcp-ce3f3e83e0c2?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce3f3e83e0c2</guid>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 11:37:44 GMT</pubDate>
            <atom:updated>2025-09-25T14:16:49.210Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ve seen how to configure DNS records manually across AWS, Azure, and GCP. But in real-world <strong>DevOps pipelines</strong>, we automate these steps using <strong>Terraform</strong>.</p><p>Here’s how to provision DNS zones and records for a <strong>multi-cloud application</strong>.</p><h3>1️⃣ AWS — Route 53</h3><pre>provider &quot;aws&quot; {<br>  region = &quot;ap-south-1&quot;<br>}</pre><pre># Create Hosted Zone<br>resource &quot;aws_route53_zone&quot; &quot;main&quot; {<br>  name = &quot;devopsrangers.online&quot;<br>}</pre><pre># AWS A Record (Alias to Load Balancer)<br>resource &quot;aws_route53_record&quot; &quot;app&quot; {<br>  zone_id = aws_route53_zone.main.zone_id<br>  name    = &quot;app.devopsrangers.online&quot;<br>  type    = &quot;A&quot;</pre><pre>  alias {<br>    name                   = &quot;my-elb-123456.ap-south-1.elb.amazonaws.com&quot;<br>    zone_id                = &quot;Z35SXDOTRQ7X7K&quot; # ELB hosted zone ID<br>    evaluate_target_health = true<br>  }<br>}</pre><pre># TXT Record for SES Verification<br>resource &quot;aws_route53_record&quot; &quot;txt&quot; {<br>  zone_id = aws_route53_zone.main.zone_id<br>  name    = &quot;_amazonses.devopsrangers.online&quot;<br>  type    = &quot;TXT&quot;<br>  ttl     = 300<br>  records = [&quot;\&quot;aws-ses-verification-token\&quot;&quot;]<br>}</pre><h3>2️⃣ Azure — Azure DNS</h3><pre>provider &quot;azurerm&quot; {<br>  features {}<br>}</pre><pre># Resource Group<br>resource &quot;azurerm_resource_group&quot; &quot;rg&quot; {<br>  name     = &quot;dns-rg&quot;<br>  location = &quot;East US&quot;<br>}</pre><pre># DNS Zone<br>resource &quot;azurerm_dns_zone&quot; &quot;main&quot; {<br>  name                = &quot;devopsrangers.online&quot;<br>  resource_group_name = azurerm_resource_group.rg.name<br>}</pre><pre># CNAME Record for Azure Front Door<br>resource &quot;azurerm_dns_cname_record&quot; &quot;app&quot; {<br>  name                = &quot;app-azure&quot;<br>  zone_name           = azurerm_dns_zone.main.name<br>  resource_group_name = azurerm_resource_group.rg.name<br>  ttl                 = 300<br>  record              = &quot;myfrontdoor.azurefd.net&quot;<br>}</pre><h3>3️⃣ GCP — Cloud DNS</h3><pre>provider &quot;google&quot; {<br>  project = &quot;my-gcp-project&quot;<br>  region  = &quot;us-central1&quot;<br>}</pre><pre># DNS Managed Zone<br>resource &quot;google_dns_managed_zone&quot; &quot;main&quot; {<br>  name     = &quot;devopsrangers-zone&quot;<br>  dns_name = &quot;devopsrangers.online.&quot;<br>}</pre><pre># CNAME Record for GCP Load Balancer<br>resource &quot;google_dns_record_set&quot; &quot;app&quot; {<br>  name         = &quot;app-gcp.devopsrangers.online.&quot;<br>  type         = &quot;CNAME&quot;<br>  ttl          = 300<br>  managed_zone = google_dns_managed_zone.main.name<br>  rrdatas      = [&quot;my-gcp-lb.googleusercontent.com.&quot;]<br>}</pre><h3>4️⃣ Multi-Cloud Routing Setup</h3><p>If you want <strong>AWS Route 53 as the primary DNS manager</strong> but still point to Azure and GCP, you can create <strong>Latency or Weighted Routing</strong> in AWS:</p><pre># AWS Route 53 Latency Routing to Multi-Cloud Endpoints<br>resource &quot;aws_route53_record&quot; &quot;multi&quot; {<br>  zone_id = aws_route53_zone.main.zone_id<br>  name    = &quot;app.devopsrangers.online&quot;<br>  type    = &quot;CNAME&quot;</pre><pre>  set_identifier = &quot;azure-endpoint&quot;<br>  ttl            = 60<br>  records        = [&quot;app-azure.devopsrangers.online&quot;]<br>  latency_routing_policy {<br>    region = &quot;eastus&quot;<br>  }<br>}</pre><pre>resource &quot;aws_route53_record&quot; &quot;multi_gcp&quot; {<br>  zone_id = aws_route53_zone.main.zone_id<br>  name    = &quot;app.devopsrangers.online&quot;<br>  type    = &quot;CNAME&quot;</pre><pre>  set_identifier = &quot;gcp-endpoint&quot;<br>  ttl            = 60<br>  records        = [&quot;app-gcp.devopsrangers.online&quot;]<br>  latency_routing_policy {<br>    region = &quot;us-central1&quot;<br>  }<br>}</pre><h3>✅ Best Practices</h3><ul><li>Use <strong>one authoritative DNS zone manager</strong> (e.g., Route 53) for the root domain.</li><li>Use <strong>subdomains</strong> (app-azure, app-gcp) for cross-cloud integrations.</li><li>Implement <strong>Terraform workspaces</strong> for separating environments (dev, qa, prod).</li><li>Store DNS state in <strong>remote backends</strong> (S3, Azure Blob, GCS).</li></ul><h3>🏁 Conclusion</h3><p>By automating DNS with <strong>Terraform</strong>, you ensure that your <strong>multi-cloud applications</strong> are consistently discoverable, reliable, and globally optimized.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce3f3e83e0c2" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/%EF%B8%8F-automating-multi-cloud-dns-with-terraform-aws-azure-gcp-ce3f3e83e0c2">⚙️ Automating Multi-Cloud DNS with Terraform (AWS + Azure + GCP)</a> was originally published in <a href="https://blog.devops.dev/">DevOps.dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ The Ultimate Port Cheat Sheet Every SRE / DevOps / CloudOps / Platform Engineer Must Remember]]></title>
            <link>https://medium.com/devsecops-ai/the-ultimate-port-cheat-sheet-every-sre-devops-cloudops-platform-engineer-must-remember-07d030d42636?source=rss-cfd1e665fb55------2</link>
            <guid isPermaLink="false">https://medium.com/p/07d030d42636</guid>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sports]]></category>
            <category><![CDATA[cloudops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Harikrishnan M]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 11:36:31 GMT</pubDate>
            <atom:updated>2025-09-18T11:36:31.114Z</atom:updated>
            <content:encoded><![CDATA[<p>When you’re an <strong>SRE, DevOps, CloudOps, Platform Engineer, or TechOps/XOps professional</strong>, you live and breathe <strong>infrastructure, networking, and reliability</strong>.</p><p>But let’s be honest:</p><p>👉 How many times have you debugged an outage, only to discover it was because of a <strong>blocked port</strong> or a <strong>wrong firewall rule</strong>?<br> 👉 How often has a late-night on-call turned into a hunt for <strong>“what port does this service even use?”</strong></p><p><strong>Ports are the lifelines of distributed systems.</strong><br> Master them, and you’ll troubleshoot faster, deploy smoother, and sleep better.</p><h3>🌍 Web &amp; Application Services</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*01_NBNufWm0it8mWMqNFlQ.png" /></figure><h3>🔑 Remote Access &amp; Management</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*F7XYbb2Ml0e3CtciTrhfwg.png" /></figure><h3>📡 Databases &amp; Storage</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*f1O5mBgyTpXIVRsR_PsZqg.png" /></figure><h3>☁️ Cloud-Native &amp; Messaging</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*GYvFWpt6KGnhPeF2dN5BjQ.png" /></figure><h3>🛠️ Monitoring &amp; Observability</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/1*9ltARMfi3s_phZwzGgXDrg.png" /></figure><h3>📧 Email &amp; Messaging</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*vEo-C7Zs6HNcGAMAGxQgNg.png" /></figure><h3>🔒 Security, Auth &amp; VPN</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*fgnOmKpawAuX-Ykw3JpjQQ.png" /></figure><h3>📞 Legacy but Still Haunting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*IhqIb2Wc0zZ8CtYwPv27Rw.png" /></figure><h3>⚡ Quick Memory Hacks for Engineers</h3><ul><li><strong>Web apps?</strong> → 80 / 443 / 8080 / 8443</li><li><strong>Databases?</strong> → 3306 / 5432 / 1433 / 27017</li><li><strong>Kubernetes?</strong> → 6443 / 10250 / 2379</li><li><strong>Monitoring?</strong> → 9090 / 3000 / 5601</li><li><strong>Remote access?</strong> → 22 / 3389</li></ul><h3>🚀 Final Thoughts</h3><p>Every <strong>Ops engineer</strong> eventually learns:<br> <strong>80% of downtime debugging = Port, Firewall, or Security Group issues.</strong></p><p>🔥 Memorize these ports.<br> 🔥 Automate port checks in CI/CD.<br> 🔥 Lock them down with <strong>least privilege</strong>.</p><p>This is how you go from <em>firefighting</em> to <em>fire-prevention</em>.</p><p>💬 <strong>Over to you:</strong><br> Which port has caused your <strong>worst on-call nightmare</strong>? Drop it in the comments below 👇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07d030d42636" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devsecops-ai/the-ultimate-port-cheat-sheet-every-sre-devops-cloudops-platform-engineer-must-remember-07d030d42636">🔌 The Ultimate Port Cheat Sheet Every SRE / DevOps / CloudOps / Platform Engineer Must Remember</a> was originally published in <a href="https://medium.com/devsecops-ai">DevSecOps &amp; AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>