<?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 Bhavnesh Sharma on Medium]]></title>
        <description><![CDATA[Stories by Bhavnesh Sharma on Medium]]></description>
        <link>https://medium.com/@bhuvi01?source=rss-f2bd4e72885------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FlrW06HlYUrPdASC81pcDg.jpeg</url>
            <title>Stories by Bhavnesh Sharma on Medium</title>
            <link>https://medium.com/@bhuvi01?source=rss-f2bd4e72885------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 24 May 2026 02:28:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhuvi01/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[Init Containers & Sidecars Explained: Advanced Pod Patterns in Kubernetes]]></title>
            <link>https://blog.devops.dev/init-containers-sidecars-explained-advanced-pod-patterns-in-kubernetes-ff73bba0f626?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff73bba0f626</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Sat, 23 May 2026 10:56:03 GMT</pubDate>
            <atom:updated>2026-05-23T10:56:03.357Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zY9pVRcuKQGSgUV7tggeRg.png" /></figure><p><strong>Introduction</strong></p><p>In the previous episode, we explored Pods, the smallest deployable unit in Kubernetes.</p><p><strong>We learned that:</strong></p><ul><li>A Pod can contain one or more containers</li><li>Containers inside a Pod share networking and storage</li><li>Kubernetes manages Pods as a single unit</li></ul><p>But in real-world production environments, not all containers inside a Pod serve the same purpose.</p><p><strong>Some containers:</strong></p><ul><li>Prepare the environment before the app starts</li><li>Continuously support the application while it runs</li></ul><p><strong>These advanced patterns are called:</strong></p><p>👉 <strong>Init Containers</strong><br>👉 <strong>Sidecar Containers</strong></p><p>And they are heavily used in production-grade Kubernetes deployments.</p><p><strong>What are Init Containers?</strong></p><p>Init Containers are special containers that run BEFORE the main application containers Run inside a Pod.</p><p><strong>They are designed for:</strong></p><ul><li>Initialization tasks</li><li>Environment preparation</li><li>Dependency validation</li></ul><p><strong>Important characteristics:</strong></p><ul><li>Run sequentially</li><li>Run only once</li><li>Must complete successfully before app containers start</li></ul><p><strong>Why Do We Need Init Containers?</strong></p><p>In production systems, applications often depend on external services or setup tasks.</p><p>Instead of embedding initialization logic into the application itself, Kubernetes allows us to separate it cleanly using Init Containers.</p><p><strong>Common Real-World Use Cases</strong></p><p><strong>⏳ Waiting for Dependencies</strong></p><p><strong>Example:</strong></p><ul><li>Wait for database readiness</li><li>Wait for Redis/cache services</li></ul><p><strong>🗄 Database Migrations</strong></p><p>Run migration scripts before application startup.</p><p><strong>📦 Configuration Generation</strong></p><p>Generate dynamic configuration files before app launch.</p><p><strong>🔐 Permission Setup</strong></p><p>Set proper file permissions or create directories.</p><p>✅ Environment Validation</p><p>Checks:</p><ul><li>DNS resolution</li><li>External APIs</li><li>Secrets availability</li></ul><p><strong>Internal Working of Init Containers (VERY IMPORTANT)</strong></p><p>Let’s understand the execution flow.</p><p><strong>1️⃣ Pod Creation</strong></p><p>User creates a Pod YAML</p><p>Kubernetes creates the Pod object.</p><p><strong>2️⃣ Init Container Starts First</strong></p><p>Before application containers start:</p><p>👉 Kubernetes launches Init Containers sequentially.</p><p><strong>3️⃣ Must Complete Successfully</strong></p><p>If Init Container succeeds:<br>✅ Next step in Pod startup continues</p><p>If Init Container fails:<br>❌ Main App does NOT start<br>❌ Pod does NOT proceed</p><p><strong>4️⃣ Main Application Starts</strong></p><p>Only after all Init Containers finish successfully:</p><ul><li>Main application containers start</li></ul><p><strong>5️⃣ Failure &amp; Restart Behavior</strong></p><p>If an Init Container fails:</p><ul><li>Kubernetes restarts it</li><li>Pod remains in:</li></ul><pre>Init:CrashLoopBackOff</pre><p>until success.</p><p><strong>🔑 Init Container Characteristics</strong></p><p>⏱<strong> Execution:</strong> Before app starts<br>🔁 <strong>Lifecycle:</strong> Runs once<br>📋 <strong>Order:</strong> Sequential<br>♻️ <strong>Restart Behavior:</strong> Retries until success<br>🕒 <strong>Runtime:</strong> Temporary<br>📦 <strong>Resources:</strong> Independent</p><p><strong>🌍 Real-World Init Container Example</strong></p><p><strong>Imagine:</strong></p><ul><li>Your app depends on PostgreSQL</li><li>DB takes 20 seconds to start</li></ul><p>Instead of failing the app: 👉 Init Container waits until DB becomes reachable.</p><p><strong>Example:</strong></p><pre>initContainers:<br>- name: wait-for-db<br>  image: busybox<br>  command:<br>    - sh<br>    - -c<br>    - until nc -z postgres 5432; do echo waiting; sleep 2; done</pre><p><strong>What are Sidecar Containers?</strong></p><p>Sidecar Containers are containers that run alongside the main application container inside the same Pod.<br>They continuously provide supporting functionality.</p><p><strong>Why Do We Need Sidecars?</strong></p><p>Modern applications require:</p><ul><li>Logging</li><li>Monitoring</li><li>Security</li><li>Traffic management</li></ul><p>Instead of embedding all of this inside the application: 👉 Kubernetes uses Sidecars.</p><p><strong>Common Real-World Use Cases</strong></p><p><strong>📜 Logging Agents</strong></p><p><strong>Example:</strong></p><ul><li>Fluentd</li><li>Filebeat</li></ul><p>Collect application logs.</p><p><strong>📈 Monitoring Agents</strong></p><p><strong>Example:</strong></p><ul><li>Prometheus exporters</li></ul><p>Expose metrics.</p><p><strong>🔐 Service Mesh Proxies</strong></p><p><strong>Example:</strong></p><ul><li>Istio Envoy Proxy</li></ul><p><strong>Handle:</strong></p><ul><li>mTLS</li><li>Traffic routing</li><li>Security</li></ul><p><strong>🔄 Configuration Reloaders</strong></p><p>Reload configs dynamically without restarting apps.</p><p><strong>🛡 Security Agents</strong></p><p>Inject secrets/certificates securely.</p><p><strong>⚙️ Internal Working of Sidecars (VERY IMPORTANT)</strong></p><p><strong>1️⃣ Pod Starts</strong></p><p>Pod is scheduled to a node.</p><p><strong>2️⃣ Main Container + Sidecar Start Together</strong></p><p>Unlike Init Containers: 👉 Sidecars run continuously.</p><p><strong>3️⃣ Shared Networking &amp; Storage</strong></p><p>Containers inside the Pod share:</p><ul><li>Same IP address</li><li>Same port namespace</li><li>Shared volumes</li></ul><p><strong>4️⃣ Sidecar Continuously Supports Main App</strong></p><p><strong>Examples:</strong></p><ul><li>Collect logs</li><li>Sync files</li><li>Monitor traffic</li><li>Encrypt communication</li></ul><p><strong>🔑 Sidecar Characteristics</strong></p><ul><li><strong>Execution:</strong> Runs alongside the main application</li><li><strong>Lifecycle:</strong> Continuous throughout the pod lifecycle</li><li><strong>Networking:</strong> Shares the same network namespace</li><li><strong>Storage:</strong> Shares storage volumes with the app container</li><li><strong>Runtime:</strong> Long-running</li><li><strong>Purpose:</strong> Provides supporting functionality</li></ul><p><strong>⚔️ Init Containers vs Sidecars</strong></p><p><strong>Init Containers</strong></p><ul><li>Execute before the app starts</li><li>Short-lived and temporary</li><li>Used for setup tasks</li><li>Retry until successful</li><li>Commonly used for DB wait checks and initialization</li></ul><p><strong>Sidecars</strong></p><ul><li>Run together with the app</li><li>Long-running and continuous</li><li>Provide supporting capabilities</li><li>Restart with the Pod</li><li>Commonly used for logging and monitoring</li></ul><p><strong>🔑 Key Concepts</strong></p><p><strong>Multi-Container Pods</strong></p><p>One Pod can run multiple containers.</p><p><strong>Shared Volumes</strong></p><p>Containers share files/data.</p><p><strong>Sequential Startup</strong></p><p>Init Containers start before app containers.</p><p><strong>Shared Network Namespace</strong></p><p>Same IP + localhost communication.</p><p><strong>🧠 Real-World Analogies</strong></p><p>🏗<strong> Init Container</strong></p><p>Like a setup crew preparing a stage before an event begins.</p><p><strong>🧑‍🔧 Sidecar</strong></p><p>Like an assistant working beside you continuously during the event.</p><p><strong>✅ Best Practices</strong></p><p>✔ Keep Init Containers lightweight<br>✔ Avoid long-running init tasks<br>✔ Use Sidecars only when necessary<br>✔ Separate responsibilities clearly<br>✔ Monitor resource usage carefully</p><p><strong>❌ Common Mistakes</strong></p><p>🚫 Using Init Containers as regular app containers<br>🚫 Overloading Pods with too many Sidecars<br>🚫 Confusing Sidecars with helper processes<br>🚫 Running business logic inside Sidecars</p><p>🎯 <strong>Interview Questions</strong></p><p><strong>1. What is an Init Container?</strong></p><p>A special container that runs before application containers.</p><p><strong>2. Can Init Containers run in parallel?</strong></p><p>No, they run sequentially.</p><p><strong>3. What happens if an Init Container fails?</strong></p><p>Kubernetes retries until success.</p><p><strong>4. What is a Sidecar Container?</strong><br>A supporting container running alongside the main app.</p><p><strong>5. Do Sidecars share the same network?</strong><br>Yes.</p><p><strong>6. What are common Sidecar use cases?</strong><br>Logging, monitoring, service mesh.</p><p><strong>7. Difference between Init and Sidecar?</strong><br>Init = setup before app<br>Sidecar = support during runtime</p><p>📝<strong> Summary (TL;DR)</strong></p><ul><li>Init Containers prepare the environment before apps start</li><li>Sidecars continuously support the application</li><li>Both patterns are critical in production Kubernetes</li><li>Multi-container Pods enable modular architecture</li></ul><p><strong>🔜 What’s Next?</strong></p><p><strong>👉 Next: Kubernetes Service Deep Dive</strong></p><p>We’ll explore how Pods are exposed and how networking works across applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff73bba0f626" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/init-containers-sidecars-explained-advanced-pod-patterns-in-kubernetes-ff73bba0f626">Init Containers &amp; Sidecars Explained: Advanced Pod Patterns in Kubernetes</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[Kubernetes Pods Explained: The Smallest Deployable Unit in K8s]]></title>
            <link>https://blog.devops.dev/kubernetes-pods-explained-the-smallest-deployable-unit-in-k8s-bcd691aa6d5f?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcd691aa6d5f</guid>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Mon, 04 May 2026 02:40:47 GMT</pubDate>
            <atom:updated>2026-05-05T15:03:35.908Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A6guPGvuNXaSSmtjK3TEag.png" /></figure><p><strong>Introduction</strong></p><p>So far in this series, we’ve explored how Kubernetes works behind the scenes:</p><ul><li><strong>Episode 1:</strong> API Server → Entry point</li><li><strong>Episode 2:</strong> etcd → Stores cluster state</li><li><strong>Episode 3:</strong> Scheduler → Decides placement</li><li><strong>Episode 4:</strong> Controller Manager → Maintains state</li><li><strong>Episode 5:</strong> Kubelet → Executes workloads</li><li><strong>Episode 6:</strong> Kube Proxy → Handles networking</li></ul><p>Now comes the most important piece:</p><blockquote>👉 What actually runs inside Kubernetes?</blockquote><p>The answer is: Pods</p><p><strong>What is a Pod?</strong></p><p>A <strong>Pod</strong> is the <strong>smallest deployable unit</strong> in Kubernetes.</p><blockquote>It represents a group of one or more containers that run together on the same node.</blockquote><p>Think of a Pod as: 👉 <strong>A wrapper around containers</strong></p><p><strong>Why Do We Need Pods?</strong></p><p>You might ask:</p><blockquote>👉 Why not run containers directly?</blockquote><p>Because Kubernetes needs:</p><ul><li>A higher-level abstraction</li><li>Shared resources between containers</li><li>A consistent deployment unit</li></ul><p>Pods provide:</p><p>✅ Shared networking<br>✅ Shared storage<br>✅ Lifecycle management<br>✅ Tight coupling between containers</p><p>🏗️ Pod Architecture</p><p>A Pod consists of:</p><p>🔹<strong>One or More Containers</strong></p><ul><li>Usually one main container</li><li>Optional sidecars</li></ul><p>🌐<strong> Shared Network</strong></p><p>All containers share:</p><ul><li>Same IP address</li><li>Same port space</li></ul><p>👉 Containers communicate via localhost</p><p><strong>💾 Shared Storage</strong></p><p>Volumes are shared between containers</p><p>Used for:</p><ul><li>Data sharing</li><li>Persistence</li></ul><p><strong>⚙️ Internal Working (Step-by-Step)</strong></p><p><strong>1️⃣ Pod Definition (YAML)</strong></p><p>User defines Pod:</p><pre>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: my-app<br>spec:<br>  containers:<br>  - name: app<br>    image: nginx</pre><p><strong>2️⃣ API Server Stores It</strong></p><ul><li>Request goes to API Server</li><li>Stored in etcd</li></ul><p><strong>3️⃣ Scheduler Assigns Node</strong></p><ul><li>Pod is in Pending state</li><li>Scheduler selects best node</li></ul><p><strong>4️⃣ Kubelet Creates Pod</strong></p><ul><li>Kubelet reads PodSpec</li><li>Pulls image</li><li>Creates containers</li></ul><p><strong>5️⃣ Containers Start Running</strong></p><ul><li>Pod moves to <strong>Running state</strong></li><li>Kubelet monitors continuously</li></ul><p><strong>🔄 Pod Lifecycle</strong></p><p>Pods go through different phases:</p><p>🟡 <strong>Pending</strong></p><ul><li>Pod created, waiting for scheduling</li></ul><p>🟢 <strong>Running</strong></p><ul><li>Containers are running</li></ul><p><strong>🔵 Succeeded</strong></p><ul><li>Completed successfully (batch jobs)</li></ul><p><strong>🔴 Failed</strong></p><ul><li>One or more containers failed</li></ul><p>⚪ <strong>Unknown</strong></p><ul><li>Node communication lost</li></ul><p><strong>🧩 Multi-Container Pods</strong></p><p><strong>🔹 Sidecar Patter</strong></p><ul><li>Helper container alongside main app</li></ul><p>Example</p><ul><li>Logging</li><li>Monitoring</li></ul><p><strong>🔄 Workflow (End-to-End)</strong></p><pre>User → YAML<br>        ↓<br>API Server<br>        ↓<br>etcd<br>        ↓<br>Scheduler assigns node<br>        ↓<br>Kubelet pulls image<br>        ↓<br>Containers start<br>        ↓<br>Pod Running</pre><p><strong>🔑 Key Concepts</strong></p><p><strong>Pod</strong></p><ul><li>Smallest deployable unit</li></ul><p><strong>Container</strong></p><ul><li>Runs application</li></ul><p><strong>Volume</strong></p><ul><li>Shared storage</li></ul><p><strong>Networking</strong></p><ul><li>Same IP for all containers</li></ul><p><strong>Lifecycle</strong></p><ul><li>Different Pod states</li></ul><p><strong>🧠 Real-World Analogy</strong></p><p>Think of a Pod as a:</p><p><strong>🏠 Shared Apartment</strong></p><ul><li>Containers = roommates</li><li>Share network &amp; storage</li><li>Live together</li></ul><p>✅ Best Practices<br>✔ Use Deployments instead of standalone Pods<br>✔ Keep Pods lightweight<br>✔ Use sidecars only when needed<br>✔ Define resource limits</p><p>❌ <strong>Common Mistakes</strong><br>🚫 Treating Pods as permanent<br>🚫 Ignoring lifecycle states<br>🚫 Overusing multi-container Pods<br>🚫 Running unmanaged Pods</p><p>🎯 <strong>Interview Questions</strong></p><p><strong>1. What is a Pod?</strong><br>Smallest deployable unit in Kubernetes.</p><p><strong>2. Can a Pod have multiple containers?</strong><br>Yes.</p><p><strong>3. Do containers in a Pod share IP?</strong><br>Yes.</p><p><strong>4. What is Pod lifecycle?</strong><br>Different phases like Pending, Running, Failed.</p><p><strong>5. Should we use standalone Pods in production?</strong><br>No, use Deployments.</p><p>📝 <strong>Summary (TL;DR)</strong></p><ul><li>Pod = smallest unit in Kubernetes</li><li>Runs one or more containers</li><li>Shares network &amp; storage</li><li>Managed by Kubelet</li><li>Has defined lifecycle</li></ul><p>🔜 <strong>What’s Next?</strong></p><p><strong>👉 Next: Service Deep Dive</strong></p><p>We’ll explore how Pods are exposed and accessed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcd691aa6d5f" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kubernetes-pods-explained-the-smallest-deployable-unit-in-k8s-bcd691aa6d5f">Kubernetes Pods Explained: The Smallest Deployable Unit in K8s</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[Kube Proxy Explained: How Kubernetes Handles Networking Between Pods]]></title>
            <link>https://blog.devops.dev/kube-proxy-explained-how-kubernetes-handles-networking-between-pods-078d43e640db?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/078d43e640db</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 03:01:44 GMT</pubDate>
            <atom:updated>2026-04-27T11:46:26.665Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JfWIB4Z-QFKDg5Gu2tHCTQ.png" /></figure><p><strong>Introduction</strong></p><p>In this series so far:</p><ul><li><strong>Episode 1:</strong> API Server → Entry point</li><li><strong>Episode 2:</strong> etcd → Stores cluster state</li><li><strong>Episode 3:</strong> Scheduler → Decides where Pods run</li><li><strong>Episode 4:</strong> Controller Manager → Maintains desired state</li><li><strong>Episode 5:</strong> Kubelet → Runs containers on nodes</li></ul><p>Now everything is running…</p><p>👉 But here’s the real question:</p><p><strong>How do Pods communicate with each other reliably?</strong></p><p>That’s where <strong>Kube Proxy</strong> comes in.</p><p><strong>What is Kube Proxy?</strong></p><p><strong>Kube Proxy</strong> is a network component that runs on every node in a Kubernetes cluster.</p><blockquote>It enables communication between Services and Pods by routing traffic correctly.</blockquote><p>Think of it as: 👉 <strong>The network traffic manager </strong>inside Kubernetes</p><p><strong>Why Do We Need It?</strong></p><p>In Kubernetes:</p><ul><li>Pods are dynamic (they come and go)</li><li>Pod IPs change frequently</li><li>Direct communication is unreliable</li></ul><p>Without Kube Proxy:</p><p>❌ No stable networking<br>❌ No service abstraction<br>❌ No load balancing</p><p>👉 Kube Proxy solves this by:</p><ul><li>Providing stable access via Services</li><li>Routing traffic to the correct Pods</li><li>Load balancing requests</li></ul><p><strong>Where It Fits in Architecture</strong></p><ul><li>Runs on <strong>every worker node</strong></li><li>Works with <strong>Services &amp; Endpoints</strong></li><li>Watches <strong>API Server</strong> for updates</li><li>Configures networking rules on the node</li></ul><p><strong>⚙️ Internal Working (Step-by-Step)</strong></p><p>1️⃣<strong> Watches Services &amp; Endpoints</strong></p><p>Kube Proxy continuously monitors:</p><ul><li>Services (ClusterIP)</li><li>Endpoints (Pod IPs)</li></ul><p>👉 Via API Server</p><p>2️⃣<strong> Maintains Network Rules</strong></p><p>It programs rules using:</p><ul><li><strong>iptables</strong> OR</li><li><strong>IPVS</strong></li></ul><p>These rules define: 👉 How traffic should be routed</p><p>3️⃣<strong> Routes Traffic to Pods</strong></p><p>When a request comes to a Service:</p><p>👉 Kube Proxy redirects it to one of the backend Pods</p><p>4️⃣<strong> Load Balances Traffic</strong></p><p>If multiple Pods exist:</p><p>👉 Traffic is distributed across them</p><p><strong>🔀 Modes of Kube Proxy</strong></p><p><strong>🔹 iptables Mode (Default)</strong></p><ul><li>Uses Linux iptables rules</li><li>Simple and widely used</li><li>Slightly less efficient at scale</li></ul><p>🔹<strong> IPVS Mode</strong></p><ul><li>Uses kernel-level load balancing</li><li>More scalable and performant</li><li>Supports advanced algorithms</li></ul><p><strong>🌐 Service Networking Flow</strong></p><pre>Client → Service (ClusterIP) → Kube Proxy → Pod</pre><p><strong>Explanation</strong>:</p><ol><li>Client sends request to Service IP</li><li>Kube Proxy intercepts request</li><li>Selects a backend Pod</li><li>Forwards traffic</li></ol><p><strong>🔄 Workflow (End-to-End)</strong></p><pre>User → Service (ClusterIP)<br>        ↓<br>Kube Proxy (Node)<br>        ↓<br>Select Pod (via Endpoints)<br>        ↓<br>Forward request<br>        ↓<br>Pod processes request<br>        ↓<br>Response sent back</pre><p><strong>🔑 Key Concepts</strong></p><p><strong>Service</strong></p><ul><li>Stable endpoint for Pods</li></ul><p><strong>ClusterIP</strong></p><ul><li>Internal virtual IP for service</li></ul><p><strong>Endpoints</strong></p><ul><li>List of backend Pod IPs</li></ul><p><strong>Load Balancing</strong></p><ul><li>Distributes traffic across Pods</li></ul><p><strong>iptables / IPVS</strong></p><ul><li>Mechanisms used for routing</li></ul><p><strong>🧠 Real-World Analogy</strong></p><p>Think of Kube Proxy as a:</p><p><strong>Traffic Manager</strong></p><ul><li>Receives incoming requests</li><li>Decides which route to take</li><li>Ensures smooth flow without congestion</li></ul><p><strong>✅ Best Practices</strong></p><p>✔ Use correct Service types (ClusterIP, NodePort, LoadBalancer)<br>✔ Prefer IPVS for large-scale clusters<br>✔ Monitor network latency<br>✔ Understand traffic flow</p><p><strong>❌ Common Mistakes</strong></p><p>🚫 Confusing Service with Pod<br>🚫 Ignoring networking issues<br>🚫 Misunderstanding load balancing<br>🚫 Not checking endpoints</p><p><strong>🎯 Interview Questions</strong></p><p><strong>1. What is Kube Proxy</strong>?<br>A network component that routes traffic to Pods.</p><p><strong>2. What is ClusterIP</strong>?<br>A virtual IP used to access a Service.</p><p><strong>3. Difference between iptables and IPVS</strong>?<br>iptables = rule-based, IPVS = scalable load balancing.</p><p><strong>4. Does Kube Proxy run on master</strong>?<br>No, runs on worker nodes.</p><p><strong>5. How does load balancing happen</strong>?<br>Via iptables/IPVS rules across Pods.</p><p><strong>📝 Summary (TL;DR)</strong></p><ul><li>Kube Proxy enables Pod communication</li><li>Uses Services as abstraction</li><li>Routes &amp; load balances traffic</li><li>Runs on every node</li></ul><p><strong>🔜 What’s Next?</strong></p><p>👉 <strong>Next: Pod Deep Dive</strong><br>We’ll explore what actually runs inside Kubernetes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=078d43e640db" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kube-proxy-explained-how-kubernetes-handles-networking-between-pods-078d43e640db">Kube Proxy Explained: How Kubernetes Handles Networking Between Pods</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[Kubelet Explained: The Agent That Brings Your Pods to Life]]></title>
            <link>https://blog.devops.dev/kubelet-explained-the-agent-that-brings-your-pods-to-life-b39b3631c437?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/b39b3631c437</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[high-availability]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 07:33:12 GMT</pubDate>
            <atom:updated>2026-04-15T11:06:44.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozs47ecO4aFxpSZiYtqRZw.png" /></figure><p><strong>Introduction</strong></p><p>So far in this series:</p><ul><li><strong>Episode 1:</strong> API Server → Entry point</li><li><strong>Episode 2:</strong> etcd → Stores cluster state</li><li><strong>Episode 3:</strong> Scheduler → Decides where Pods run</li><li><strong>Episode 4:</strong> Controller Manager → Ensures desired state</li></ul><p>Now comes the most important question:</p><blockquote>👉 Kubernetes plans everything… but who actually runs your containers?</blockquote><p>The answer is Kubelet.</p><p><strong>What is Kubelet?</strong></p><p><strong>Kubelet</strong> is a node-level agent that runs on every worker node in a Kubernetes cluster.</p><blockquote>It ensures that containers described in PodSpecs are running correctly.</blockquote><p>Think of it as: 👉 The <strong>executor</strong> of Kubernetes decisions</p><p><strong>Why Do We Need It?</strong></p><p>Control plane components make decisions, but:</p><ul><li>They don’t run containers</li><li>They don’t interact with the OS</li><li>They don’t manage runtime execution</li></ul><p><strong>Without Kubelet:</strong></p><p>❌ Pods would never start<br>❌ No container lifecycle management<br>❌ No node-level monitoring</p><blockquote>👉 Kubelet bridges: Control Plane → Worker Node Execution</blockquote><p><strong>Where It Fits in Architecture</strong></p><ul><li>Runs on every <strong>worker node</strong></li><li>Communicates with <strong>API Server</strong></li><li>Works with <strong>container runtime</strong> (containerd / Docker)</li><li>Reports back node &amp; pod status</li></ul><p><strong>Internal Working (Step-by-Step)</strong></p><p>1️⃣ <strong>Watches PodSpecs from API Server</strong></p><p>Kubelet continuously polls or watches:</p><p>👉 API Server for Pods assigned to its node</p><p>2️⃣ <strong>Ensures Containers Are Running</strong></p><p>Kubelet compares:</p><ul><li>Desired state (PodSpec)</li><li>Actual state (running containers)</li></ul><p>👉 If mismatch → it fixes it</p><p>3️⃣<strong> Interacts with Container Runtime</strong></p><p>Kubelet does NOT run containers directly.<br>Instead it uses:</p><ul><li>containerd</li><li>CRI (Container Runtime Interface)</li></ul><p>👉 Example:</p><pre>Kubelet → CRI → containerd → runc → container</pre><p>4️⃣<strong> Performs Health Checks</strong></p><p>Kubelet runs:</p><ul><li><strong>Liveness probes</strong> → Is container alive?</li><li><strong>Readiness probes</strong> → Is container ready to serve traffic?</li></ul><p>👉 If failed:</p><ul><li>Restart container</li><li>Remove from service</li></ul><p><strong>5️⃣ Reports Status to API Server</strong></p><p>Kubelet continuously sends:</p><ul><li>Pod status</li><li>Node health</li><li>Resource usage</li></ul><p>🔄 <strong>Pod Lifecycle Handling</strong></p><p>Here’s how Kubelet manages a Pod:</p><ol><li>Scheduler assigns Pod to node</li><li>API Server updates PodSpec</li><li>Kubelet detects assignment</li><li>Pulls container image</li><li>Starts containers</li><li>Monitors continuously</li><li>Restarts if needed</li></ol><p>🔁<strong> Workflow (End-to-End)</strong></p><pre>User → kubectl apply<br>        ↓<br>API Server<br>        ↓<br>etcd (stores state)<br>        ↓<br>Scheduler assigns node<br>        ↓<br>API Server updates Pod<br>        ↓<br>Kubelet detects Pod<br>        ↓<br>Pull image from registry<br>        ↓<br>Container runtime starts container<br>        ↓<br>Kubelet monitors &amp; reports</pre><p>🔑<strong> Key Concepts</strong></p><p><strong>PodSpec</strong></p><ul><li>Blueprint of Pod</li><li>Defines containers, resources</li></ul><p><strong>Container Runtime</strong></p><ul><li>Actually runs containers</li><li>Example: containerd</li></ul><p><strong>Node Status</strong></p><ul><li>Health of node</li><li>Sent to API Server</li></ul><p><strong>Health Checks</strong></p><ul><li>Liveness &amp; Readiness probes</li></ul><p><strong>Sync Loop</strong></p><ul><li>Continuous reconciliation at node level</li></ul><p><strong>Real-World Analogy</strong></p><p>Think of Kubelet as a:</p><p>👷 <strong>Machine Operator in a Factory</strong></p><ul><li>Control plane gives instructions</li><li>Kubelet executes them</li><li>Ensures machines (containers) run smoothly</li></ul><p>✅<strong> Best Practices</strong></p><p>✔ Define proper resource requests<br>✔ Always use liveness/readiness probes<br>✔ Monitor node health<br>✔ Use reliable container images</p><p>❌<strong> Common Mistakes</strong></p><p>🚫 Ignoring health checks<br>🚫 Misconfigured containers<br>🚫 Assuming Scheduler runs containers<br>🚫 Not monitoring node status</p><p>🎯<strong> Interview Questions</strong></p><p><strong>1. What is Kubelet?</strong><br>Agent that runs on nodes and manages Pods.</p><p><strong>2. Does Kubelet run containers directly?</strong><br>No, it uses container runtime.</p><p><strong>3. What are probes?</strong><br>Health checks for containers.</p><p><strong>4. What happens if a container fails?</strong><br>Kubelet restarts it.</p><p><strong>5. How does Kubelet communicate?</strong><br>Via API Server.</p><p>📝 <strong>Summary (TL;DR)</strong></p><ul><li>Kubelet executes workloads on nodes</li><li>Works with container runtime</li><li>Manages Pod lifecycle</li><li>Performs health checks</li><li>Reports status</li></ul><p><strong>🔜 What’s Next?</strong><br>👉 <strong>Next: Kube Proxy Deep Dive</strong><br>We’ll explore how networking works inside Kubernetes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b39b3631c437" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kubelet-explained-the-agent-that-brings-your-pods-to-life-b39b3631c437">Kubelet Explained: The Agent That Brings Your Pods to Life</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[Kubernetes Controller Manager Explained: The Brain That Keeps Everything Running]]></title>
            <link>https://medium.com/@bhuvi01/kubernetes-controller-manager-explained-the-brain-that-keeps-everything-running-b527bb08e3b0?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/b527bb08e3b0</guid>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 11:27:46 GMT</pubDate>
            <atom:updated>2026-04-12T11:27:46.310Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0sbJpiaig9zFg2TzqwnbA.png" /></figure><p><strong>Introduction</strong></p><p>In this series so far:</p><ul><li><strong>Episode 1:</strong> API Server → The entry point</li><li><strong>Episode 2:</strong> etcd → Stores cluster state</li><li><strong>Episode 3:</strong> Scheduler → Decides where Pods run</li></ul><p>Now comes a deeper question:</p><blockquote>👉 Once Pods are scheduled… who ensures they keep running correctly?</blockquote><p>That responsibility belongs to the <strong>Kubernetes Controller Manager.</strong></p><p><strong>🧠 What is Kubernetes Controller Manager?</strong></p><p>The Controller Manager is a control plane component that runs multiple controllers.</p><p>It continuously ensures that the <strong>actual state of the cluster matches the desired state.</strong></p><p>Instead of doing things once, it works in a loop:</p><ul><li>Observe</li><li>Compare</li><li>Fix</li></ul><p><strong>⚙️ Why Do We Need It?</strong></p><p>In distributed systems:</p><ul><li>Pods can crash</li><li>Nodes can fail</li><li>Network issues can occur</li></ul><p><strong>Without a Controller Manager:</strong></p><p>❌ Applications would break and stay broken</p><p>❌ No automatic recovery</p><p>❌ Manual intervention required</p><p><strong>👉 Controller Manager enables:</strong></p><ul><li>Self-healing</li><li>Automation</li><li>Reliability</li></ul><p><strong>🏗️ Where It Fits in Architecture</strong></p><ul><li>Part of the <strong>Control Plane</strong></li><li>Runs continuously in the background</li><li>Communicates with <strong>API Server</strong></li><li>Reads state from <strong>etcd (via API Server)</strong></li></ul><p>⚙️ Internal Working (Step-by-Step)</p><p>Let’s break it down:</p><p>1️⃣<strong> Desired State Defined</strong></p><p>Users define the desired state using YAML:</p><ul><li>Deployment (e.g., 3 replicas)</li><li>Job</li><li>ReplicaSet</li></ul><p>Example:</p><pre>replicas: 3</pre><p>2️⃣<strong> Controller Watches Cluster State</strong></p><p>Each controller continuously watches:</p><p>👉 API Server for changes</p><p><strong>3️⃣ Compare Desired vs Actual State</strong></p><p>Controller checks:</p><ul><li>Desired: 3 Pods</li><li>Actual: 2 Pods</li></ul><p>4️⃣ Take Corrective Action</p><p>Controller acts:</p><p>👉 Creates 1 more Pod</p><p>This loop never stops.</p><p><strong>🔁 Reconciliation Loop (Core Concept)</strong></p><p>This is the <strong>heart of Controller Manager.</strong></p><pre>Observe → Compare → Act → Repeat</pre><ul><li>Detects drift</li><li>Fixes automatically</li><li>Runs continuously</li></ul><p>👉 This is why Kubernetes is self-healing</p><p><strong>🧩 Types of Controllers (IMPORTANT)</strong></p><p>Controller Manager is actually a collection of controllers:</p><p>🔹<strong> Node Controller</strong></p><ul><li>Detects node failures</li><li>Marks nodes unhealthy</li><li>Reschedules Pods</li></ul><p>🔹 <strong>ReplicaSet Controller</strong></p><ul><li>Ensures correct number of Pods</li><li>Maintains replicas</li></ul><p>🔹 <strong>Deployment Controller</strong></p><ul><li>Manages ReplicaSets</li><li>Handles rolling updates</li></ul><p>🔹<strong> Job Controller</strong></p><ul><li>Runs batch jobs</li><li>Ensures completion</li></ul><p>🔹<strong> Endpoint Controller</strong></p><ul><li>Updates service endpoints</li><li>Tracks Pod IPs</li></ul><p><strong>🔄 Workflow (End-to-End)</strong></p><p>User creates Deployment<br> ↓<br>API Server<br> ↓<br>etcd stores state<br> ↓<br>Controller Manager detects change<br> ↓<br>Creates ReplicaSet<br> ↓<br>Ensures Pods are running<br> ↓<br>If Pod fails → recreate</p><p><strong>🔑 Key Concepts</strong></p><p><strong>Desired vs Actual State</strong></p><ul><li>Desired = defined by user</li><li>Actual = current cluster state</li></ul><p><strong>Reconciliation Loop</strong></p><ul><li>Continuous correction mechanism</li></ul><p><strong>Controllers</strong></p><ul><li>Specialized logic units</li></ul><p><strong>Self-Healing</strong></p><ul><li>Automatic recovery from failure</li></ul><p><strong>🧠 Real-World Analogy</strong></p><p>Think of Controller Manager as a:</p><p><strong>🌡️ Thermostat</strong></p><ul><li>You set temperature (desired state)</li><li>Room changes (actual state)</li><li>Thermostat adjusts automatically</li></ul><p>✅ Best Practices</p><p>✔ Always define desired state clearly<br>✔ Use Deployments instead of raw Pods<br>✔ Monitor controller logs<br>✔ Use health checks</p><p><strong>❌ Common Mistakes</strong></p><p>🚫 Confusing Scheduler with Controller<br>🚫 Ignoring reconciliation loop<br>🚫 Creating unmanaged Pods<br>🚫 Not defining replicas</p><p><strong>🎯 Interview Questions</strong></p><p><strong>1. What is Controller Manager?</strong><br>A component that ensures desired state matches actual state.</p><p><strong>2. What is reconciliation loop?</strong><br>Continuous process of observing, comparing, and correcting.</p><p><strong>3. Difference between Scheduler and Controller?</strong><br>Scheduler assigns nodes; Controller maintains state.</p><p><strong>4. What happens if a Pod crashes?<br></strong>Controller recreates it.</p><p><strong>5. Does Controller Manager talk to etcd directly?</strong><br>No, via API Server.</p><p><strong>📝 Summary (TL;DR)</strong></p><ul><li>Controller Manager maintains cluster stability</li><li>Uses reconciliation loop</li><li>Ensures desired = actual</li><li>Enables self-healing</li></ul><p><strong>🔜 What’s Next?</strong></p><p>👉 Next: Kubelet Deep Dive</p><p>We’ll explore how Pods actually run inside nodes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b527bb08e3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Scheduler Explained: How Pods Find Their Perfect Node]]></title>
            <link>https://blog.devops.dev/kubernetes-scheduler-explained-how-pods-find-their-perfect-node-e0c020aa5dd0?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0c020aa5dd0</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 02:40:38 GMT</pubDate>
            <atom:updated>2026-04-07T12:19:57.449Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ci-AmdwyoJxKKXilBiegxg.png" /></figure><p><strong>Introduction</strong></p><p>In the previous episodes of this series:</p><ul><li>We explored how the Kubernetes control plane communicates through the API Server</li><li>We understood how cluster state is stored reliably in etcd</li></ul><p>Now comes the critical question:</p><p>👉 Once a Pod is created and stored… who decides where it actually runs?</p><p>That’s where the Kubernetes Scheduler comes in.</p><p><strong>🧠 What is Kubernetes Scheduler?</strong></p><p>The <strong>Kubernetes Scheduler</strong> is a control plane component responsible for:</p><p>Assigning Pods to the most suitable Node in the cluster</p><p><strong>When a Pod is created, it does NOT automatically run anywhere.</strong></p><p><strong>Instead:</strong></p><ul><li>It stays in a <strong>Pending state</strong></li><li>The Scheduler evaluates available nodes</li><li>Then selects the best one based on multiple factors</li></ul><p><strong>⚙️ Why Do We Need It?</strong></p><p>In a real-world cluster:</p><ul><li>Multiple nodes with different resources</li><li>Multiple Pods competing for CPU, memory</li><li>Constraints like labels, affinity rules, taints</li></ul><p>Without a scheduler:</p><p>❌ Pods could land on overloaded nodes</p><p>❌ Resources would be wasted</p><p>❌ Applications could fail unpredictably</p><p>👉 The Scheduler ensures:</p><ul><li>Efficient resource utilization</li><li>Balanced workload distribution</li><li>Intelligent placement decisions</li></ul><p><strong>🏗️ Where It Fits in Architecture</strong></p><p>The Scheduler is part of the Kubernetes Control Plane.</p><p>It works closely with:</p><ul><li><strong>API Server</strong> → Receives Pod definitions</li><li><strong>etcd</strong> → Stores cluster state</li><li><strong>Kubelet</strong> → Runs Pods on assigned nodes</li></ul><p><strong>⚙️ Internal Working (Step-by-Step)</strong></p><p>let’s break down how the scheduler actually works:</p><p>1️⃣<strong> Watching for Unscheduled Pods</strong></p><p>The Scheduler continuously monitors the API Server for:</p><p>👉 Pods with no assigned node<br>These are Pods in:</p><pre>status: Pending<br>nodeName: &lt;empty&gt;</pre><p>2️⃣<strong> Filtering Phase (Feasibility Check)</strong></p><p>The Scheduler filters out nodes that cannot run the Pod.</p><p>Checks include:</p><ul><li>🧠 Available CPU &amp; Memory</li><li>🏷️ Node selectors</li><li>🚫 Taints &amp; tolerations</li><li>📍 Node affinity / anti-affinity</li><li>🔒 Port conflicts</li></ul><p>👉 Result: A list of <strong>valid candidate nodes</strong></p><p><strong>3️⃣ Scoring Phase (Ranking Nodes)</strong></p><p>Now the Scheduler ranks the remaining nodes.</p><p>Each node gets a score based on:</p><ul><li>Resource availability</li><li>Load balancing</li><li>Affinity preferences</li><li>Custom scheduling policies</li></ul><p>👉 Higher score = better fit</p><p><strong>4️⃣ Selection</strong></p><p>The Scheduler selects:</p><p>🏆 The highest-ranked node</p><p>5️⃣<strong> Binding</strong></p><p>Finally:</p><ul><li>Scheduler sends decision to <strong>API Server</strong></li><li>Pod gets assigned:</li></ul><pre>nodeName: selected-node</pre><p>Then: 👉 Kubelet takes over and runs the Pod</p><p><strong>🔄 Scheduling Workflow (End-to-End)</strong></p><p>Here’s the full workflow:</p><pre>User → kubectl apply<br>        ↓<br>API Server<br>        ↓<br>etcd (stores Pod)<br>        ↓<br>Scheduler detects Pod<br>        ↓<br>Filtering + Scoring<br>        ↓<br>Best Node selected<br>        ↓<br>Binding via API Server<br>        ↓<br>Kubelet runs Pod</pre><p><strong>🔑 Key Concepts</strong></p><p><strong>Scheduling vs Binding</strong></p><ul><li><strong>Scheduling</strong> = Selecting node</li><li><strong>Binding</strong> = Assigning Pod to node</li></ul><p><strong>Filtering &amp; Scoring</strong></p><ul><li>Filtering removes invalid nodes</li><li>Scoring ranks valid ones</li></ul><p><strong>Node Selection</strong></p><ul><li>Based on constraints + optimization</li></ul><p><strong>Resource Requests &amp; Limits</strong></p><ul><li>Scheduler uses requests, not limits</li></ul><p><strong>Taints &amp; Tolerations</strong></p><ul><li>Taints = repel Pods</li><li>Tolerations = allow exceptions</li></ul><p>🧠 Real-World Analogy</p><p>Think of the Scheduler as an:</p><p>✈️ Air Traffic Controller</p><ul><li>Many planes (Pods)</li><li>Many runways (Nodes)</li><li>Must assign safely and efficiently</li></ul><p>👉 No collisions, no overloads, smooth operations</p><p><strong>✅ Best Practices</strong></p><p>✔ Always define resource requests<br>✔ Use node selectors carefully<br>✔ Use affinity rules for control<br>✔ Monitor scheduling behavior</p><p><strong>❌ Common Mistakes</strong></p><p>🚫 Not defining resource requests<br>🚫 Ignoring Pending Pods<br>🚫 Misconfigured taints/tolerations<br>🚫 Overloading specific nodes</p><p><strong>🎯 Interview Questions</strong></p><p><strong>1. What does Kubernetes Scheduler do?</strong><br>Assigns Pods to appropriate nodes.</p><p><strong>2. What is filtering vs scoring?</strong><br>Filtering removes invalid nodes, scoring ranks valid ones.</p><p><strong>3. Does Scheduler run Pods?</strong><br>No, Kubelet runs Pods.</p><p><strong>4. What happens if no node matches?</strong><br>Pod stays in Pending state.</p><p><strong>5. What data does Scheduler use?</strong><br>Cluster state from API Server (backed by etcd).</p><p><strong>📝 Summary (TL;DR)</strong></p><ul><li>Scheduler is decides where is pods run</li><li>Works in filter → score → select → bind flow</li><li>Ensures efficient and balanced cluster usage</li><li>Critical for performance and reliability</li></ul><p><strong>🔜 What’s Next?</strong></p><p>In the next episode:</p><p>👉 <strong>Controller Manager Deep Dive</strong></p><p>We’ll explore how Kubernetes maintains the desired state automatically.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0c020aa5dd0" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kubernetes-scheduler-explained-how-pods-find-their-perfect-node-e0c020aa5dd0">Kubernetes Scheduler Explained: How Pods Find Their Perfect Node</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[Etcd in Kubernetes Explained: The Database Behind Your Cluster]]></title>
            <link>https://blog.devops.dev/etcd-in-kubernetes-explained-the-database-behind-your-cluster-071fcecd0976?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/071fcecd0976</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes-cluster]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[k8s]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 09:52:45 GMT</pubDate>
            <atom:updated>2026-04-13T10:27:05.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_v9Q866xhzpBI8UhVPR2A.png" /></figure><p><strong>Introduction</strong></p><p>In <strong>Episode 1,</strong> we explored the <strong>Kubernetes API Server</strong>—the entry point for all cluster interactions.</p><p>But that raises a critical question:</p><p>👉 Where does Kubernetes store all this data?</p><p>The answer is <strong>etcd</strong>.</p><p>etcd is the <strong>backbone of Kubernetes state management.</strong> Without it, your cluster cannot function—it has no memory.</p><p><strong>What is etcd?</strong></p><p><strong>etcd</strong> is a <strong>distributed key-value store</strong> used by Kubernetes to store all cluster data.</p><p>In simple terms:</p><p>etcd = <strong>Kubernetes database</strong></p><p>It stores:</p><ul><li>Pods</li><li>Nodes</li><li>Deployments</li><li>ConfigMaps</li><li>Secrets</li></ul><p>All stored as key-value pairs.</p><p><strong>Why Do We Need It?</strong></p><p>Kubernetes is a distributed system where:</p><ul><li>Multiple components act independently</li><li>Desired state must be persisted</li><li>Failures must be recoverable</li></ul><p><strong>Problem it solves:</strong></p><p><strong>👉 Reliable cluster state storage</strong></p><p>Without etcd:</p><ul><li>❌ No persistence</li><li>❌ No recovery</li><li>❌ No consistent behavior</li></ul><p><strong>Where It Fits in Architectur</strong></p><p>etcd is <strong>part of the Control Plane.</strong></p><p><strong>Key Rule:</strong></p><p>👉 Only the API Server interacts with etcd</p><ul><li>Scheduler → API Serve</li><li>Controllers → API Server</li><li>Users → API Server</li></ul><p>This ensures controlled and secure access.</p><p><strong>Internal Working (Step-by-Step)</strong></p><p><strong>1. Data Stored as Key-Value Pairs</strong></p><p>Example:</p><pre>/registry/pods/nginx → Pod definition<br>/registry/services/frontend → Service config</pre><p><strong>2. Structured Data Paths</strong></p><p>Kubernetes organizes data like:</p><ul><li>/registry/pods/</li><li>/registry/nodes/</li><li>/registry/services/</li></ul><p>👉 Makes lookup fast and predictable</p><p><strong>3. Read &amp; Write Operations</strong></p><ul><li>API Server writes → etcd stores</li><li>API Server reads → etcd returns</li></ul><p>👉 etcd acts as the backend database</p><p><strong>4. Watch Mechanism</strong></p><p>Instead of polling:</p><ul><li>Components watch for changes</li><li>API Server gets notified</li><li>System reacts immediately</li></ul><p>Example:</p><ul><li>New Pod created → Scheduler reacts</li></ul><p><strong>5. Strong Consistency (Raft Consensus)</strong></p><p>This is the most important concept 👇</p><p>etcd uses the <strong>Raft consensus algorithm</strong> to maintain consistency across nodes.</p><p><strong>How Raft Works (High-Level):</strong></p><ul><li>Cluster has multiple nodes (usually 3 or 5)</li><li>One node becomes Leader 👑</li><li>Others are Followers</li></ul><p>Write Flow:</p><ol><li>API Server sends write request</li><li>Leader receives it</li><li>Leader replicates to followers</li><li>Majority confirms</li><li>Data is committed</li></ol><p>👉 Guarantees:</p><ul><li>No stale reads</li><li>No split-brain issues</li><li>Strong consistency across cluster</li></ul><p><strong>End-to-End Workflow</strong></p><pre>User → kubectl → API Server → etcd → Data Stored → Scheduler reacts → Node → Kubelet → Container Runtime → Pod</pre><p><strong>Step-by-step:</strong></p><ul><li>User sends request via kubectl</li><li>API Server validates request</li><li>Data written to etcd</li><li>etcd stores state (key-value)</li><li>Scheduler detects change</li><li>Node selected</li><li>Kubelet + container runtime run the Pod</li></ul><p><strong>Interview Questions</strong></p><p><strong>1. What is etcd?</strong><br>Distributed key-value store for Kubernetes.</p><p><strong>2. What algorithm does etcd use?</strong><br>Raft consensus.</p><p><strong>3. Who interacts with etcd?</strong><br>Only API Server.</p><p><strong>4. What is watch mechanism?</strong><br>Event-driven updates instead of polling.</p><p><strong>What’s Next</strong><br>👉 <strong>Episode 3: Kubernetes Scheduler Deep Dive</strong></p><p><strong>5. Why is etcd critical?</strong><br>It stores the entire cluster state.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=071fcecd0976" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/etcd-in-kubernetes-explained-the-database-behind-your-cluster-071fcecd0976">Etcd in Kubernetes Explained: The Database Behind Your Cluster</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[Episode 1: Kubernetes API Server Explained — The Brain Behind Your Cluster]]></title>
            <link>https://blog.devops.dev/kubernetes-api-server-explained-the-brain-behind-your-cluster-7d270c0064e7?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d270c0064e7</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[etcd]]></category>
            <category><![CDATA[api-server]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 05:12:33 GMT</pubDate>
            <atom:updated>2026-04-14T07:12:26.730Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Episode 1: Kubernetes API Server Explained — The Brain Behind Your Cluster</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3x90JZHwlj9PEKvBgaWLUQ.png" /></figure><p><strong>Introduction</strong></p><p>Kubernetes is a powerful orchestration system—but behind its simplicity lies a well-structured control mechanism.</p><p>At the center of this system is the <strong>Kubernetes API Server</strong>, the most critical component of the control plane.</p><p>In this article, you’ll learn:</p><ul><li>What the Kubernetes API Server is</li><li>Why it is essential for cluster operations</li><li>How it processes every request step-by-step</li><li>How it connects all Kubernetes components.</li></ul><p>If Kubernetes is a system, the <strong>API Server is its brain</strong> and gatekeeper.</p><p><strong>What is Kubernetes API Server?</strong></p><p>The <strong>Kubernetes API Server (kube-apiserver)</strong> is the <strong>entry point to your Kubernetes cluster.</strong></p><p><strong>It exposes a REST API</strong> that allows users and components to:</p><ul><li>Create resources (Pods, Deployments, Services)</li><li>Update configurations</li><li>Query cluster state</li></ul><p>Every interaction—whether from:</p><ul><li>kubectl</li><li>CI/CD pipelines</li><li>Controllers</li><li>Internal Kubernetes components.</li></ul><p>👉 goes through the API Server.</p><p><strong>Why Do We Need It?</strong></p><p>In a distributed system like Kubernetes:</p><ul><li>Multiple users interact simultaneously</li><li>Components operate independently</li><li>State must remain consistent</li></ul><p>Without a central control layer:</p><ul><li>❌ No security enforcement</li><li>❌ No consistent state</li><li>❌ No coordination</li></ul><p><strong>The API Server solves:</strong></p><ul><li>✅ Centralized communication</li><li>✅ Security (Authentication &amp; Authorization)</li><li>✅ Consistency of cluster state</li><li>✅ Standard interface via REST</li></ul><p><strong>Where It Fits in Architecture</strong></p><p>The API Server is part of the Control Plane.</p><p><strong>Control Plane Components:</strong></p><ul><li>API Server</li><li>Scheduler</li><li>Controller Manager</li><li>etcd</li></ul><p>👉 All components communicate through the API Server, not directly.</p><p><strong>Internal Working (Step-by-Step)</strong></p><p>This is the most important part—understanding how the API Server processes requests.</p><p><strong>1. Request Enters API Server</strong></p><p>Example:</p><pre>kubectl apply -f deployment.yaml</pre><p>This sends an HTTP request to the API Server.</p><p><strong>2. Authentication</strong></p><p><strong>Question:</strong> Who are you?</p><p>The API Server verifies identity using:</p><ul><li>TLS certificates</li><li>Bearer tokens</li><li>Service accounts</li></ul><p>👉 If authentication fails → request rejected</p><p><strong>3. Authorization</strong></p><p><strong>Question:</strong> Are you allowed to perform this action?</p><p>Handled via:</p><ul><li>RBAC (Role-Based Access Control)</li></ul><p>Example:</p><ul><li>A user may create Pods but cannot delete them</li></ul><p>👉 If unauthorized → request denied</p><p><strong>4. Admission Controllers</strong></p><p><strong>Question:</strong> Should this request be modified or validated further?</p><p>Admission controllers:</p><ul><li>Mutate requests (e.g., inject defaults)</li><li>Validate policies (e.g., security constraints)</li></ul><p>Examples:</p><ul><li>PodSecurity</li><li>ResourceQuota</li></ul><p><strong>5. Validation</strong></p><p>Now Kubernetes validates:</p><ul><li>Schema correctness</li><li>Required fields</li><li>API compatibility</li></ul><p>👉 Invalid requests are rejected</p><p><strong>6. Persistence in etcd</strong><br>Finally:</p><ul><li>Data is stored in <strong>etcd</strong>, a distributed key-value store</li><li>This becomes the <strong>source of truth</strong> for the cluster</li></ul><p><strong>End-to-End Workflow</strong></p><pre>User → kubectl → API Server → etcd → Scheduler → Node → Kubelet → Container Runtime → Pod</pre><p><strong>Step-by-step:</strong></p><ol><li>User sends request via <strong>kubectl</strong></li><li>API Server authenticates and authorizes</li><li>Request is validated and stored in etcd</li><li>Scheduler → assigns node</li><li>Kubelet (on node) → takes over</li><li>Kubelet → talks to container runtime (containerd / CRI-O)</li><li>Runtime → pulls image + creates container</li><li>Runtime creates and starts containers</li><li>Pod becomes running</li></ol><p>👉 All coordination happens via the API Server.</p><p><strong>Real-World Analogy</strong></p><p>Think of the API Server as a <strong>corporate receptionist:</strong></p><ul><li>You arrive (request)</li><li>ID is checked (Authentication)</li><li>Permission is verified (Authorization)</li><li>Rules are enforced (Admission Controllers)</li><li>Entry is logged (etcd</li><li>You’re directed to the right department (Scheduler/Controller)</li></ul><p>👉 No one bypasses the receptionist.</p><p><strong>Interview Questions</strong></p><p><strong>1. What is the Kubernetes API Server?</strong></p><p><strong>Answer:</strong> It is the central control plane component that exposes Kubernetes APIs and processes all requests.</p><p><strong>2. Does API Server store cluster data?</strong></p><p><strong>Answer:</strong> No, it stores data in etcd.</p><p><strong>3. What is the request flow in API Server?</strong></p><p><strong>Answer:</strong> Authentication → Authorization → Admission → Validation → Persistence</p><p><strong>4. What are Admission Controllers?</strong></p><p><strong>Answer:</strong> Plugins that mutate or validate requests before they are persisted.</p><p><strong>5. Can Kubernetes components bypass API Server?</strong></p><p><strong>Answer:</strong> No, it is the single entry point.</p><p><strong>Summary (TL;DR)</strong></p><ul><li>API Server is the brain of Kubernetes</li><li>All requests pass through it</li><li>It ensures:</li></ul><p>Security</p><p>Validation</p><p>Consistency</p><ul><li>It does not store data — etcd does</li></ul><p><strong>What’s Next</strong></p><p><strong>👉 Episode 2: etcd Deep Dive — Kubernetes Memory Explained</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d270c0064e7" width="1" height="1" alt=""><hr><p><a href="https://blog.devops.dev/kubernetes-api-server-explained-the-brain-behind-your-cluster-7d270c0064e7">Episode 1: Kubernetes API Server Explained — The Brain Behind Your Cluster</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 Mount OneDrive on Alma-Linux and Use It for WHM Backups]]></title>
            <link>https://medium.com/@bhuvi01/how-to-mount-onedrive-on-alma-linux-and-use-it-for-whm-backups-6f688eac7992?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f688eac7992</guid>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Wed, 24 Sep 2025 15:09:36 GMT</pubDate>
            <atom:updated>2025-09-24T15:09:36.435Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JpSLd4JpN9xpFFmjvcMabg.png" /></figure><p>Backing up critical data to the cloud is essential for modern server management. OneDrive is a popular choice, but mounting it on a Linux server — especially an Alma-Linux WHM server — requires some configuration. In this post, I’ll walk you through how to mount OneDrive using <strong>rclone</strong>, generate the necessary authentication token from Windows, verify it, and configure WHM to store backups directly in OneDrive.</p><h3>Step 1: Install Rclone on AlmaLinux</h3><p>Rclone is a powerful command-line tool that supports many cloud storage services, including OneDrive.</p><pre>sudo dnf install epel-release -y<br>sudo dnf install wget unzip fuse -y<br>curl https://rclone.org/install.sh | sudo bash<br>rclone version</pre><p>This installs rclone and ensures it’s ready to use.</p><h3>Step 2: Generate OneDrive Token on Windows</h3><p>Since AlmaLinux servers often do not have a GUI browser, you need a separate machine (Windows) to generate the token.</p><ol><li><strong>Download Rclone for Windows</strong> from <a href="https://rclone.org/downloads/">https://rclone.org/downloads/</a> and extract it, e.g., C:\rclone.</li><li>Open <strong>Command Prompt</strong> or <strong>PowerShell</strong> and navigate to the folder:</li></ol><pre>cd C:\rclone</pre><p>3. Run the authorize command:</p><pre>rclone authorize onedrive</pre><p>4. A browser window opens. Sign in to your <strong>personal Outlook/OneDrive account</strong>.</p><p>5. Allow rclone access.</p><p>6. Copy the <strong>entire JSON token</strong> printed in the Command Prompt. It will look like:</p><pre>{&quot;access_token&quot;:&quot;...&quot;,&quot;token_type&quot;:&quot;Bearer&quot;,&quot;expiry&quot;:&quot;...&quot;,&quot;refresh_token&quot;:&quot;...&quot;}</pre><p>This token will be used to configure rclone on your AlmaLinux server.</p><h3>Step 3: Configure OneDrive Remote on AlmaLinux</h3><ol><li>Start rclone configuration on the server:</li></ol><pre>rclone config</pre><p>2. Create a new remote:</p><ul><li>n → new remote</li><li>Name: onedrive</li><li>Storage: 38 → Microsoft OneDrive</li><li>Leave <strong>client_id</strong>, <strong>client_secret</strong>, and <strong>tenant</strong> empty</li><li>Advanced config? → n</li><li>Browser auth? → n</li></ul><p>3. At the config_token&gt; prompt, <strong>paste the JSON token</strong> generated from Windows.</p><p>4. When prompted for config_type&gt;, type:</p><pre>1</pre><p>(for <strong>OneDrive Personal or Business</strong>)</p><p>5. When prompted for config_driveid&gt;, press <strong>Enter</strong> to select the default personal drive.</p><h3>Step 4: Verify the Remote</h3><p>Check access to your OneDrive folders:</p><pre>rclone ls onedrive:Documents</pre><p>Example output:</p><pre>4451 Screenshot 2025-09-24 153807.png</pre><p>Step 5: Mount OneDrive on AlmaLinux</p><ol><li>Create a mount point:</li></ol><pre>sudo mkdir -p /mnt/onedrive<br>sudo chown root:root /mnt/onedrive</pre><p>2. Test mount:</p><pre>rclone --vfs-cache-mode writes mount onedrive: /mnt/onedrive &amp;</pre><ul><li>--vfs-cache-mode writes ensures WHM can safely write temporary files.</li><li>Verify:</li></ul><pre>ls /mnt/onedrive/Documents</pre><h3>Step 6: Make the Mount Persistent with systemd</h3><p>Create /etc/systemd/system/rclone-onedrive.service:</p><pre>[Unit]<br>Description=Mount OneDrive<br>After=network-online.target<br>Wants=network-online.target<br><br>[Service]<br>Type=simple<br>ExecStart=/usr/bin/rclone --vfs-cache-mode writes mount onedrive: /mnt/onedrive<br>Restart=always<br>User=root<br>Group=root<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>Enable and start the service:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable rclone-onedrive<br>sudo systemctl start rclone-onedrive<br>sudo systemctl status rclone-onedrive</pre><h3>Step 7: Configure WHM Backups</h3><ol><li>Log in to <strong>WHM</strong> → <strong>Backup Configuration</strong>.</li><li>Go to <strong>Additional Destinations</strong> → <strong>File System</strong>.</li><li>Set the path to:</li></ol><pre>/mnt/onedrive</pre><p>4. Configure backup options (compression, retention, incremental).</p><p>5. Run a test backup to ensure it writes correctly.</p><p>✅ Tip: If you are using a <strong>custom backup script with a custom backup path</strong>, make sure to <strong>update the script to point to the mounted path</strong> (/mnt/onedrive). Otherwise, backups may still go to the old location.</p><p><em>✅ Tip: The mount must be available at all times; otherwise, backups may fail.</em></p><p>Conclusion:</p><p>Mounting OneDrive on Alma-Linux using rclone is straightforward once you understand the authentication flow. By generating the token from Windows and configuring a persistent mount, you can safely store backups directly in OneDrive. This approach is ideal for MSSQL backups, large files, and automated server backup strategies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f688eac7992" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Create AWS Architecture Diagrams Using Amazon Q CLI + MCP (Model Context Protocol)]]></title>
            <link>https://medium.com/@bhuvi01/aws-architecture-diagrams-with-amazon-q-cli-and-mcp-434eb0d41719?source=rss-f2bd4e72885------2</link>
            <guid isPermaLink="false">https://medium.com/p/434eb0d41719</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-architecture]]></category>
            <dc:creator><![CDATA[Bhavnesh Sharma]]></dc:creator>
            <pubDate>Thu, 22 May 2025 17:05:03 GMT</pubDate>
            <atom:updated>2025-05-22T17:05:03.904Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Imagine creating fully functional AWS architecture diagrams with one simple prompt.</strong> No dragging, no clicking, no cloud icon hunt — just pure productivity in seconds.</blockquote><p>In this blog, I’ll show you how to generate AWS architecture diagrams using <strong>Amazon Q CLI</strong> and <strong>MCP servers</strong>. This is perfect for architects, developers, DevOps engineers, and anyone who wants to bring clarity and speed into cloud architecture work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZWp8kcEroDlmb6C9CHoyg.png" /><figcaption>AWS CI/CD Pipeline with kubernetes architecture</figcaption></figure><h3>🌐 What is Model Context Protocol (MCP)?</h3><p>MCP is an open protocol designed to <strong>standardize interactions between AI models and real-world tools</strong> like infrastructure-as-code frameworks, diagram renderers, or CLI tools.</p><ul><li>LLMs are like smart assistants — but they need a way to act.</li><li>MCP defines a consistent format for tools (servers) to expose functions and for AI agents (clients) to call them.</li></ul><h3>✅ Why MCP is a Big Deal</h3><ul><li><strong>Interoperability</strong>: You can swap tools or hosts without reconfiguration.</li><li><strong>Scalability</strong>: Build powerful multi-tool agents using a single protocol.</li><li><strong>Standardization</strong>: All big players — AWS, Google, OpenAI, Microsoft — now support MCP.</li></ul><h3>🤖 What is Amazon Q CLI?</h3><p><strong>Amazon Q CLI</strong> is a command-line AI assistant built for developers. With recent <strong>MCP support</strong>, it can now do things like:</p><ul><li>Generate full-stack apps</li><li>Create infrastructure code</li><li>Build AWS architecture diagrams automatically</li><li>Act as a lightweight agent for DevOps automation</li></ul><blockquote><em>⚙️ It’s like combining ChatGPT + CLI + DevOps + AWS tools into one.</em></blockquote><h3>🧰 Setup Guide</h3><h3>🔧 Step 1: Install Amazon Q CLI</h3><h4>macOS</h4><pre>brew install amazon-q</pre><h4>Ubuntu / WSL</h4><pre>sudo apt-get update<br>sudo apt install libfuse2<br>curl -sSf https://desktop-release.q.us-east-1.amazonaws.com/latest/amazon-q.deb -o amazon-q.deb<br>sudo apt install -y ./amazon-q.deb</pre><h3>🔐 Step 2: Create AWS Builder ID</h3><p>You’ll need an <strong>AWS Builder ID</strong> to log in to Q CLI:</p><ol><li>Visit: <a href="https://profile.aws.amazon.com/">https://profile.aws.amazon.com</a></li><li>Click on “<strong>Create Builder ID</strong>”</li><li>Sign up with your email</li><li>Confirm email through AWS verification link</li><li>Done!</li></ol><h3>🔑 Step 3: Login to Amazon Q</h3><pre>q login</pre><p>This opens a browser to log in using your Builder ID email. Once done, your terminal will say: Login successful.</p><blockquote><em>🔓 You’re now ready to use Q CLI for free — no AWS billing required for Q features.</em></blockquote><h3>🖼️ Step 4: Install Graphviz (Diagram Dependency)</h3><p>Graphviz helps render diagrams locally.</p><h4>macOS:</h4><pre>brew install graphviz</pre><h4>Ubuntu:</h4><pre>sudo apt install graphviz</pre><h3>🛰️ Step 5: Install UV &amp; Configure MCP Servers</h3><p>Install the MCP runtime tool that runs your AI-powered servers:</p><pre>sudo snap install astral-uv --classic</pre><p>Then configure Amazon Q CLI to connect with MCP servers. These servers act as the <strong>“skills” or “tools”</strong> that your AI can use.</p><h4>📄 Create MCP Configuration File</h4><p>Create the file:</p><pre>mkdir -p ~/.aws/amazonq<br>vim ~/.aws/amazonq/mcp.json</pre><p>Paste the following code:</p><blockquote><em>🧩 </em><strong><em>What this configuration does</em></strong><em>:<br> The </em><em>mcp.json file tells </em><strong><em>Amazon Q CLI</em></strong><em> how to start and connect to two specific </em><strong><em>MCP servers</em></strong><em>:</em></blockquote><ul><li>cdk-mcp-server: Generates AWS CDK (infrastructure-as-code) projects.</li><li>aws-diagram-mcp-server: Generates AWS <strong>architecture diagrams</strong> using Python + Graphviz.</li></ul><blockquote><em>These servers run using the </em><em>uvx runtime and are launched automatically when you use relevant prompts in the CLI.</em></blockquote><pre>{<br>  &quot;mcpServers&quot;: {<br>    &quot;awslabs.cdk-mcp-server&quot;: {<br>      &quot;command&quot;: &quot;uvx&quot;,<br>      &quot;args&quot;: [&quot;awslabs.cdk-mcp-server@latest&quot;],<br>      &quot;env&quot;: {<br>        &quot;FASTMCP_LOG_LEVEL&quot;: &quot;ERROR&quot;<br>      }<br>    },<br>    &quot;awslabs.aws-diagram-mcp-server&quot;: {<br>      &quot;command&quot;: &quot;uvx&quot;,<br>      &quot;args&quot;: [&quot;awslabs.aws-diagram-mcp-server&quot;],<br>      &quot;env&quot;: {<br>        &quot;FASTMCP_LOG_LEVEL&quot;: &quot;ERROR&quot;<br>      },<br>      &quot;autoApprove&quot;: [],<br>      &quot;disabled&quot;: false<br>    }<br>  }<br>}</pre><p>Now relaunch the CLI:</p><pre>q</pre><p>✅ Your Amazon Q CLI is now MCP-enabled and ready to generate diagrams or infrastructure code on-demand from natural language prompts.</p><h3>✨ Let’s Generate a Diagram</h3><p>Run:</p><pre>q chat</pre><p>Prompt:</p><pre>Create an AWS architecture diagram for a serverless data pipeline using S3, Lambda, and DynamoDB.</pre><p>Amazon Q will:</p><ol><li>Understand your request</li><li>Trigger the AWS Diagram MCP Server</li><li>Convert the idea to Python Diagrams code</li><li>Render the output using Graphviz</li><li>Save image in your local machine (default: ~/.amazonq)</li></ol><p>✅ <strong>Your diagram is ready!</strong></p><p>🔁 Real-World Prompts to Try</p><p>Prompt</p><blockquote>Build a three-tier web architecture with ALB, ECS, and RDS</blockquote><blockquote>Create architecture for a secure VPC with public/private subnets and NAT Gateway</blockquote><blockquote>Generate diagram for a CI/CD pipeline using CodePipeline, CodeBuild, and Lambda</blockquote><h3>💻 Developer Workflows (Quick Use Cases)</h3><ul><li><strong>Pre-Design Brainstorming</strong> — Quickly visualize architectures while discussing ideas.</li><li><strong>Documentation Automation</strong> — Add AI-generated diagrams to README, Confluence, or Notion docs.</li><li><strong>CI/CD Integration</strong> — Use in pipelines to auto-generate architecture visuals for changes.</li><li><strong>Infra Reviews</strong> — Share clear diagrams during pull requests or retros.</li></ul><h3>🛠️ Troubleshooting Tips (Quick Fixes)</h3><ul><li><strong>Browser doesn’t open on login</strong> — Run q login --no-browser and open the URL manually.</li><li><strong>No diagrams are generated</strong> — Make sure Graphviz is installed and dot is available in your system PATH.</li><li><strong>MCP servers not detected</strong> — Check that mcp.json exists in ~/.aws/amazonq and is correctly formatted.</li><li><strong>It’s too slow on first use</strong> — Be patient; dependencies might be downloading in the background.</li></ul><h3>🎯 Best Practices</h3><ul><li>Use clear and descriptive prompts — the more specific, the better the results.</li><li>Keep your mcp.json file in version control for consistency across your team.</li><li>Combine this with IaC tools like CDK or Terraform to complete your automation workflow.</li><li>For longer prompts or structured inputs, use q chat /editor.</li></ul><h3>🤝 Final Thoughts</h3><p>Using <strong>Amazon Q CLI + MCP</strong> transforms how you build, explain, and document cloud systems. Whether you’re:</p><ul><li>Pitching a new architecture</li><li>Creating client deliverables</li><li>Documenting infra for your team</li><li>Or building projects on the fly</li></ul><p>This toolchain helps you <strong>move fast with clarity and confidence</strong>.</p><p>📬 Let’s Connect</p><p>🔗 <a href="https://www.linkedin.com/in/bhavnesh-sharma98/">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=434eb0d41719" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>