<?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 Nirupama G R on Medium]]></title>
        <description><![CDATA[Stories by Nirupama G R on Medium]]></description>
        <link>https://medium.com/@nirupamagr738?source=rss-3a231ef0c78a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PkddoqfwvQ2kTH2z7zsEpA@2x.jpeg</url>
            <title>Stories by Nirupama G R on Medium</title>
            <link>https://medium.com/@nirupamagr738?source=rss-3a231ef0c78a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:36:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nirupamagr738/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[Your Kubernetes App Works. But Do You Know What’s Happening Between Your Pods?]]></title>
            <link>https://medium.com/@nirupamagr738/your-kubernetes-app-works-but-do-you-know-whats-happening-between-your-pods-3ddd3ce2d961?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ddd3ce2d961</guid>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Fri, 12 Jun 2026 07:42:05 GMT</pubDate>
            <atom:updated>2026-06-12T07:42:05.022Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A beginner-friendly intro to Istio and why we use service mesh</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y3wPoaIqU1jwAZg51nW58Q.png" /></figure><p>You have got your app running on Kubernetes. Deployments, Services, maybe an Ingress. Things look good on the surface.</p><p><em>what actually happens when Pod A talks to Pod B?</em></p><p>Can you see that traffic? Can you control it? Can you retry automatically if a request fails? Can you encrypt it?</p><p>By default no. You can’t. Kubernetes handles scheduling and networking, but it has no opinion about <em>how</em> your services communicate with each other beyond basic routing.</p><p>That is exactly the gap a <strong>service mesh</strong> fills. And <strong>Istio</strong> is the most widely adopted one.</p><h3>So What Is a Service Mesh?</h3><p>Think of your microservices as people working in a large office building. Kubernetes is the building. It provides rooms (pods), hallways (networking), and a directory (DNS). But it doesn’t control how people talk to each other, whether conversations are private, or what happens if someone doesn’t pick up.</p><p>A service mesh is like adding a <strong>universal communication protocol</strong> to that building, every conversation is logged, secured, retried if needed, and observable from a central control room.</p><p>Technically, a service mesh is an <strong>infrastructure layer</strong> that handles service-to-service communication. Istio does this by injecting a lightweight proxy (called <strong>Envoy</strong>) as a <strong>sidecar container</strong> alongside every pod in your cluster.</p><h3>The Sidecar Pattern — The Heart of Istio</h3><p>Every time you deploy a pod in an Istio-enabled namespace, Istio automatically injects an Envoy sidecar container into it. You don’t write it. You don’t manage it. It just appears.</p><pre>┌─────────────────────────────┐<br>│          Your Pod           │<br>│  ┌─────────┐  ┌──────────┐  │<br>│  │  Your   │  │  Envoy   │  │<br>│  │   App   │  │ Sidecar  │  │<br>│  └────┬────┘  └────┬─────┘  │<br>│       │            │        │<br>└───────┼────────────┼────────┘<br>        │ All traffic│<br>        └────→───────┘<br>         intercepted here</pre><p>All inbound and outbound traffic from your app <em>passes through</em> this sidecar. Your application doesn’t know it’s there. But Istio does, and that’s where all the magic happens.</p><h3>What Does Istio Actually Give You?</h3><h3>1. Observability(You See Everything!)</h3><p>Without Istio, if a request fails between two services, you are digging through logs hoping someone thought to add tracing.</p><p>With Istio, every request is automatically tracked. You get:</p><ul><li><strong>Metrics: </strong>request count, error rate, latency (P50, P99)</li><li><strong>Distributed tracing: </strong>follow a single request across microservices</li><li><strong>Service topology: </strong>a live map of which services talk to which</li></ul><p>Tools like Kiali, Jaeger, and Grafana plug directly into Istio for visualisation.</p><h3>2. Traffic Management — Control the Flow</h3><p>Istio lets you control traffic routing with surgical precision using <strong>VirtualService</strong> and <strong>DestinationRule</strong> objects.</p><p>Want to send 90% of traffic to v1 of your service and 10% to v2 for a canary rollout?</p><p>Here you go:</p><pre>apiVersion: networking.istio.io/v1alpha3<br>kind: VirtualService<br>metadata:<br>  name: my-service<br>spec:<br>  hosts:<br>  - my-service<br>  http:<br>  - route:<br>    - destination:<br>        host: my-service<br>        subset: v1<br>      weight: 90<br>    - destination:<br>        host: my-service<br>        subset: v2<br>      weight: 10</pre><p>That’s it. No code change. No custom load balancer config. Pure YAML.</p><p>You can also configure <strong>retries</strong>, <strong>timeouts</strong>, and <strong>circuit breaking</strong> the same way.</p><h3>3. Security: mTLS by Default</h3><p>Kubernetes networking is flat. Pod A <em>can</em> talk to Pod B without any authentication unless you explicitly set NetworkPolicies.</p><p>Istio enables <strong>mutual TLS (mTLS), </strong>both sides of every connection verify each other’s identity using certificates. Istio manages the certificates automatically via its control plane component called <strong>istiod</strong>.</p><p>Enable it mesh-wide with one object:</p><p>yaml</p><pre>apiVersion: security.istio.io/v1beta1<br>kind: PeerAuthentication<br>metadata:<br>  name: default<br>  namespace: istio-system<br>spec:<br>  mtls:<br>    mode: STRICT</pre><p>Now every pod-to-pod communication in your cluster is encrypted and authenticated. Zero code changes in your app.</p><blockquote>When you deploy Istio, istiod runs as a central control plane. You write YAML (VirtualServices, DestinationRules, PeerAuthentication, etc.) and istiod translates that into Envoy config and pushes it to every sidecar in real-time.</blockquote><p><strong>If plain Kubernetes is TCP/IP, it gets packets from A to B, then Istio is HTTPS + load balancing + observability + auth, applied uniformly across every service in your cluster without touching application code.</strong></p><h3>Should You Use It?</h3><p>Istio is powerful, but it comes with real operational overhead. Here’s a quick gut-check:</p><p><strong>Istio is worth it when you have:</strong></p><ul><li>Many microservices talking to each other</li><li>A need for zero-trust security between services</li><li>Teams that need visibility into service-level traffic</li><li>Canary deployments or A/B testing requirements</li></ul><p><strong>It might be overkill if:</strong></p><ul><li>You have a monolith or 2–3 services</li><li>Your team is still learning Kubernetes itself</li><li>You can’t justify the extra CPU/memory overhead from sidecars</li></ul><p>The shift from “my pods are running” to “I understand and control every connection between my pods” is a significant one. Istio is how production teams make that leap.</p><p>Start small, enable it on one namespace, and let the observability alone justify the investment!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ddd3ce2d961" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Terraform State: The File That Quietly Manages Your Entire Infrastructure]]></title>
            <link>https://medium.com/@nirupamagr738/terraform-state-the-file-that-quietly-manages-your-entire-infrastructure-77ad6c7f3257?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/77ad6c7f3257</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Thu, 08 Jan 2026 05:28:46 GMT</pubDate>
            <atom:updated>2026-01-08T05:28:46.639Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XMQ5l7t8VTO4XDyksOSOIQ.png" /></figure><p>A lot of people use Terraform state, but not many people really know what it is.</p><p>At first, it seems safe. It is just a file that shows up after you run terraform apply. Terraform makes something for you.</p><p>A lot of engineers don’t even look at it. Don’t touch it unless Terraform tells you to!</p><p>That’s why state becomes dangerous later, not because it’s mysterious, but because it’s powerful without making a big deal out of it.</p><p>Terraform doesn’t manage infrastructure by constantly re-discovering the cloud from scratch. It manages infrastructure by treating the state file as the source of truth.</p><p>Once you get that, a lot of Terraform behaviour that seemed random before makes a lot of sense.</p><h4>In the Beginning: When the State Seems Like a Small Thing</h4><p>When you first start using Terraform, state doesn’t come up very often.</p><p>You make a few .tf files. You start terraform by running <em>terraform init</em>. Terraform gets providers, sets up the working directory, and makes a folder called .terraform. Then you use <em>terraform apply</em>. Infrastructure shows up. A new file called terraform.tfstate appears. You don’t check it out. You don’t change it. You don’t have to worry about it.</p><p>Why would you? Everything is fine.</p><p>At this point, state seems like an implementation detail. Something Terraform needs on its own, not something you need to worry about. And for a while, that idea is true.</p><h4>What Terraform Does When You Run It</h4><p>People often say that Terraform is “declarative,” but that doesn’t tell the whole story.</p><p>Terraform doesn’t check your cloud account and ask: “What should be there because of this setup?”</p><p>Terraform asks instead: “What does my state say is there, and how is that different from what the configuration says?”</p><blockquote>The state file is like Terraform’s brain.</blockquote><p>It has information about the resources, such as their IDs, how they are connected, and what Terraform thinks their attributes are.</p><p>Terraform doesn’t always find infrastructure again on every run. It has faith in its memory. That memory is the file for the state.</p><h4>Why there is a state at all</h4><p>This makes you wonder: why does Terraform need state in the first place? The answer is easy: cloud APIs don’t work with declarative tools.</p><p>Cloud providers don’t give a clear, reversible, idempotent description of infrastructure. They have APIs that make things, change things, and delete things, but they often have side effects.</p><p>Terraform needs a way to find:</p><ul><li>configuration blocks turn into real infrastructure objects</li><li>logical names → IDs that are specific to the provider</li></ul><p>State is how Terraform fills in the gaps.</p><p>Without state, Terraform wouldn’t know which EC2 instance goes with which resource block, whether a change is an update or a replacement, or what it made last time.</p><p>State is not an option. It is basic.</p><h4>When State Starts to Matter</h4><p>State matters as soon as Terraform stops being personal. Something changes as soon as another engineer joins the project. Terraform is more than just something you run now. The team runs it.</p><p>No one person can keep the state file on their laptop anymore. It needs to be shared. So teams set up a remote backend:</p><ul><li>S3</li><li>GCS</li><li>Terraform Cloud</li><li>Azure Storage</li></ul><p>The state goes out of sight. And this is where most teams go wrong:</p><p>They think of remote state as a storage issue instead of a coordination issue.</p><h4>State Is the Only Place to Find the Truth and the Only Place to Fail</h4><p>There is one state file for each Terraform workspace. That file is the one to follow. If it’s wrong, Terraform, plans, and applies are all wrong.</p><p>If it’s out of date, Terraform may suggest changes that don’t make sense, resources may be recreated, and dependencies may break.</p><p>If you change it the wrong way, Terraform might completely lose track of resources.</p><p>Centralising state makes things safer, but it also makes them more fragile. And you can’t see how fragile something is until it breaks.</p><h3>The False Sense of Safety That Comes with State Locking</h3><p>State locking makes most teams feel safer.</p><blockquote>Before an apply, Terraform locks the state. It can only be changed by one person at a time.</blockquote><p>This sounds safe. But locking only stops concurrent writes, not:</p><ul><li>wrong plans</li><li>wrong assumptions</li><li>drift</li><li>partial failures</li></ul><p>Locking stops two people from applying at the same time.<br>It doesn’t stop someone from using the wrong thing.</p><p>This is why a lot of Terraform problems happen even when locking is on. Concurrency is not the issue. The issue is trust.</p><h4>Drift: When the state of things slowly stops matching reality</h4><p>Drift is one of the ideas in Terraform that people get wrong the most. Drift doesn’t mean that Terraform isn’t working.</p><blockquote>That means that Terraform’s memory and reality are no longer the same.</blockquote><p>Drift happens when:</p><ul><li>someone changes infrastructure by hand</li><li>automation outside of Terraform changes resources</li><li>providers give back data that isn’t consistent</li></ul><p>Terraform only finds drift when it updates its state. And even then, it doesn’t automatically fix drift. It suggests making up. This is why drift is dangerous:</p><blockquote>It builds up slowly.</blockquote><p>Everything seems fine until Terraform suggests a huge, confusing plan one day. That plan didn’t just happen. It’s the result of drift building up over time.</p><h4>Why Bringing in Resources Seems So Dangerous</h4><p>The purpose of Terraform import is to fix a certain issue: “This resource is there, but Terraform doesn’t know about it.”</p><p>Import writes directly to the state. That’s why it feels scary. Import doesn’t check for intent. It doesn’t check the design. It doesn’t check to see if the resource needs to be managed. It only teaches Terraform:</p><p>“This thing is real.” Keep it in mind!</p><p>Terraform will handle it according to the configuration once it has been imported, whether that is safe or not. This is why teams with a lot of experience are careful when they import.</p><blockquote>They know that importing is not onboarding; it’s binding.</blockquote><h4>State Is Not Just Data; It Holds Choices</h4><p>To think that state is just a picture of infrastructure is a mistake. It is much more than that. State file provides:</p><ul><li>decisions about the lifecycle</li><li>behaviour of replacement</li><li>graphs of dependency</li><li>historical context</li></ul><p>When Terraform chooses to replace a resource instead of updating it, that choice usually comes from state file. When Terraform won’t change something without recreating it, that limitation is usually built into how the resource is shown in state. This is why it can seem like changes to the state are permanent.</p><p>Terraform isn’t stubborn; it’s steady.</p><h4>Partial Applies and the Mess They Make</h4><p>A failed apply is one of the most stressful things that can happen with Terraform.</p><p>Some resources were made.<br>Some were changed.<br>Some didn’t work.</p><p>Terraform changes the state little by little as operations work. If an apply fails halfway through, the state may not be completely accurate, some resources may be there but not complete, and dependencies may be broken. Terraform doesn’t automatically go back.</p><p>Why?</p><p>Terraform doesn’t understand intent, it records outcomes, so rollback would require Terraform to understand both intent and outcome. It keeps track of what happened. This is where the state turns into a forensic artefact.</p><p>Experienced engineers learn to read state as proof, not as truth.</p><h4>Why the advice “Just Fix the State” is bad</h4><p>Every Terraform team gets this advice at some point: “Simply change the state file.” This is almost always bad advice. When you edit the state by hand, you skip validation, lifecycle rules, and provider logic.</p><p>Yes, it is sometimes necessary. But it should be handled like surgery on a database:</p><ul><li>not common</li><li>planned</li><li>recorded</li><li>checked</li></ul><p>The state isn’t weak, which is the problem.</p><blockquote>The risk is that it’s simple to not realise how much it means.</blockquote><h4>The Change in State of Mind</h4><p>As teams get better at using Terraform, something interesting happens. They stop seeing state as output.</p><blockquote>They begin to see it as important infrastructure.</blockquote><p>They add:</p><ul><li>stricter controls on who can access things</li><li>requirements for reviews</li><li>separation of environments</li><li>clear ownership</li></ul><p>State is no longer “Terraform’s file”.</p><blockquote>It is now the system’s memory.</blockquote><p>That change makes people act differently. Plans are looked over more carefully. Applies happen less often. Drift is looked into sooner. Not because Terraform changed, but because the team did.</p><h4>Why Terraform State Seems Heavy in Production</h4><p>Making mistakes in dev is still okay, you can delete and create new resources. The same cannot be said about production. It can mean:</p><ul><li>losing data</li><li>downtime</li><li>broken dependencies</li><li>exposing security</li></ul><blockquote>Terraform is powerful because of its state, but power also makes things vulnerable.</blockquote><p>Terraform seems easy at first and hard later for this reason. It’s not actually getting hard. It’s just that you are asked to grow along with it.</p><h4>Terraform Isn’t Keeping Anything Secret</h4><p>Terraform doesn’t hide how complicated things are. It just doesn’t make you face it right away. This is on purpose.</p><p>Terraform is meant to grow along with you:</p><ul><li>New users can get started quickly</li><li>More experienced users can go deeper</li></ul><p>The problem comes up when teams grow faster than they can understand the state. Terraform feels unpredictable at that point not because it is, but because its rules were never internalised.</p><h4>Last thought</h4><p>Terraform state is not a technical detail. It is the deal between what you want and what is real. Terraform feels predictable as long as that contract is in place.</p><p>Terraform feels harsh when it breaks, but it’s just following the rules it always had. Knowing how Terraform works doesn’t make it safer. It keeps you safe. You stop treating Terraform like a simple configuration tool and start to realise that it is a state-driven system. You begin to treat it like what it is:</p><blockquote>A system that can remember your infrastructure better than any person ever could.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77ad6c7f3257" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Production Kubernetes YAML Decoded: From “It Worked in Dev” to “It Survived Production”]]></title>
            <link>https://medium.com/@nirupamagr738/a-production-kubernetes-yaml-decoded-from-it-worked-in-dev-to-it-survived-production-443c07987c7b?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/443c07987c7b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 14:32:01 GMT</pubDate>
            <atom:updated>2026-01-05T14:32:01.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYneYmrkrtEsJ9gERtz2ag.png" /></figure><p>When I first learnt about Kubernetes, most of the examples seemed too easy. A Deployment with one replica. No probes. No resource limits. No rollout strategy.</p><p>It used to work.<br>Until it stopped.</p><p>A production Deployment YAML, on the other hand, had so many things I barely understood and it looked extremely defensive.</p><p>I learnt something important over time:</p><p>It’s not an accident that production Kubernetes YAML is intentional.<br>It’s written by systems that have already broken down once.</p><p>Let me show you what a real production deployment looks like and, more importantly, why each part is there, so you can understand it better than I did the first time.</p><p>— — — — —</p><p><strong>The Deployment That Works in Production</strong></p><p>This is a sample yaml file which reflects the patterns used by high-traffic product companies that operate Kubernetes at scale.</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: backend-api<br>  labels:<br>    app: backend-api<br>spec:<br>  replicas: 4<br>  revisionHistoryLimit: 5<br><br>  strategy:<br>    type: RollingUpdate<br>    rollingUpdate:<br>      maxSurge: 1<br>      maxUnavailable: 0<br><br>  selector:<br>    matchLabels:<br>      app: backend-api<br><br>  template:<br>    metadata:<br>      labels:<br>        app: backend-api<br>    spec:<br>      terminationGracePeriodSeconds: 30<br><br>      containers:<br>        - name: backend-api<br>          image: myregistry/backend-api:1.3.7<br>          imagePullPolicy: IfNotPresent<br><br>          ports:<br>            - containerPort: 8080<br><br>          envFrom:<br>            - configMapRef:<br>                name: backend-api-config<br>            - secretRef:<br>                name: backend-api-secrets<br><br>          resources:<br>            requests:<br>              cpu: &quot;500m&quot;<br>              memory: &quot;512Mi&quot;<br>            limits:<br>              cpu: &quot;1&quot;<br>              memory: &quot;1Gi&quot;<br><br>          readinessProbe:<br>            httpGet:<br>              path: /health/ready<br>              port: 8080<br>            initialDelaySeconds: 5<br>            periodSeconds: 5<br><br>          livenessProbe:<br>            httpGet:<br>              path: /health/live<br>              port: 8080<br>            initialDelaySeconds: 20<br>            periodSeconds: 10<br><br>          securityContext:<br>            runAsNonRoot: true<br>            runAsUser: 10001<br>            allowPrivilegeEscalation: false<br>            readOnlyRootFilesystem: true<br><br>      imagePullSecrets:<br>        - name: regcred</pre><p>At first, this might seem like a lot to handle. But this is the difference between a deployment file written by a beginner versus someone who has already survived production incidents.</p><p>— — — — —</p><p><strong>Why There Are Multiple Replicas (Why One Pod Is Not Enough)</strong></p><pre>replicas: 4</pre><p>The first production outage I saw was caused by a single pod crash/error.</p><p>One replica implies:</p><ul><li>One crash =&gt; downtime</li><li>One node drain =&gt; downtime</li><li>One rollout =&gt; downtime</li></ul><p>Multiple replicas are not for dealing with traffic. They are about not going away when things go wrong. That’s why production always starts with redundancy.</p><p>— — — — —</p><p><strong>Deployment Strategies That Prevent Accidental Downtime</strong></p><pre>maxUnavailable: 0</pre><p>This line usually shows up after someone has a “successful” deployment that caused a short outage. If this setting is not set, Kubernetes can kill Pods before replacements are ready. In production, even a few seconds of downtime matter.</p><p>So teams make it very clear to Kubernetes:</p><blockquote>Don’t take anything down until the new one is healthy.</blockquote><p>— — — — —</p><p><strong>Why Old ReplicaSets Are Kept in Systems ?</strong></p><pre>revisionHistoryLimit: 5</pre><p>This is because rollbacks are real. You can go back to previous version when things don’t work out.</p><p>Deployments can go wrong in multiple ways:</p><ul><li>wrong settings</li><li>broken image</li><li>missed environment variable</li></ul><p>Keeping old ReplicaSets lets you roll back right away without having to rebuild state. This is not about perfection but it’s about planning for failure.</p><p>— — — — —</p><p><strong>The 30 Seconds That Keep User Requests Safe</strong></p><pre>terminationGracePeriodSeconds: 30</pre><p>There is another thing with Kubernetes. Kubernetes respects the work a Pod is doing. When something goes wrong, Kubernetes doesn’t kill a Pod right away when it stops it. What happens between stopping a pod to killing a pod is,</p><ul><li>stop taking new traffic</li><li>finish requests that are already in progress</li><li>close database connections</li></ul><p>Without this, engineers get random errors when they deploy.</p><p>— — — — —</p><p><strong>Configuration Always Resides Outside</strong></p><pre>envFrom:<br>  - configMapRef<br>  - secretRef</pre><p>A deployment goes through dev, staging and production environment. Each of these environments has different requirements.</p><p>It is always a good idea to keep the deployment file same across all the environment. But somewhere you need to change the requirements, environmental variables and secrets right?</p><p>This is done on the config maps and secrets. They live as separate YAML files and are attached to the Deployment. In this way, you can change the configuration without having to edit the deployments.</p><p>— — — — —</p><p><strong>The Scheduler Looks at Resource Requests</strong></p><pre>requests:<br>  cpu: &quot;500m&quot;<br>  memory: &quot;512Mi&quot;</pre><p>This section is checked by the Scheduler when it makes a call to whether to place a pod on a node or not.</p><p>Without requests:</p><ul><li>the Scheduler makes guesses</li><li>Pods stack up on one node</li><li>noisy neighbours show up</li><li>HPA stops working right</li></ul><p>When the requests is defined right, scheduler knows which nodes can provide what the pod needs, and places it there. The kubelet knows how much resources it needs to provide as well. It is always important to define what the requirements clearly.</p><p>Missing or wrong requests are often the first sign of a production outage.</p><p>— — — — —</p><p><strong>Readiness: When Traffic Is Allowed In</strong></p><pre>readinessProbe:</pre><p>This is the line that tells you if your service is really usable. A pod might show that it is running, healthy or signed in but that doesn’t mean it is ready to handle the traffic.</p><p>Readiness keeps users safe from Pods that are warming up, reconnecting, or not fully set up.</p><p>Most problems that say “it works locally but not in Kubernetes” go away when readiness is set up right.</p><p>— — — — —</p><p><strong>Liveness: Knowing When to Start Over</strong></p><pre>livenessProbe:</pre><p>Not everything is perfect all the time. Sometimes apps get stuck. Be it deadlocks, losing memory or the hanging threads. Kubernetes needs to know when to stop waiting and move on.</p><p>Kubernetes with the help of livenessProbe restart the pods when it is needed.</p><p>A lot of teams make the mistake of making this probe too aggressive, which leads to endless restarts.</p><p>That’s why production often splits:</p><ul><li>readiness = traffic</li><li>liveness = staying alive</li></ul><p>— — — — —</p><p><strong>Why Security Contexts Seem So Strict</strong></p><pre>runAsNonRoot: true<br>readOnlyRootFilesystem: true</pre><p>Production clusters are set up to deal with the possibility of compromise. Engineers constantly think about how the systems they build might be attacked. How can I safe guard it?</p><p>These settings make the blast radius smaller, stop privilege escalation, and pass security audits.</p><p>— — — — —</p><p><strong>The Service That Links Everything</strong></p><pre>kind: Service<br>type: ClusterIP</pre><p>The Service provides stable identity, load balancing and separation from Pod IPs.</p><p>Most production services are not directly available. They are usually protected by ingress, API gateways and service meshes.</p><p>— — — — —</p><p><strong>What This YAML Really Means</strong></p><p>The important thing is this deployment is not “advanced”. It is experienced.</p><p>Every field answers a question like</p><ul><li>What happens when a Pod dies?</li><li>What happens when you deploy?</li><li>What happens when there is a load?</li><li>What happens when the configuration changes?</li><li>What happens when a node goes away?</li></ul><p>Sample yamls that are made for teaching don’t ask you these questions. YAMLs for production do.</p><p>— — — — —</p><p><strong>Last thought: Kubernetes makes you be honest about failure.</strong></p><p>In the DevOps world, we are not looking for perfect systems that is never compromised, hacked or error prone.</p><p>It is about designing, implementing and maintaining things which can last with what we have. Failures, pod errors, crashloopbackoff, cluster failures are all to be expected. How we handle these failures while still serving users is what truly matters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=443c07987c7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Terraform Seems Simple Until It Breaks in Production]]></title>
            <link>https://medium.com/@nirupamagr738/why-terraform-seems-simple-until-it-breaks-in-production-2fb658c5bf39?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fb658c5bf39</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 17:32:54 GMT</pubDate>
            <atom:updated>2026-01-03T17:32:54.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-N9xYR2gNtgn8_Pemp9qg.png" /></figure><p>Terraform has a strange reputation.</p><p>People say it’s strong, scary, and unforgiving, but when you first use it, none of that seems true. It feels calm. Predictable. Almost friendly.</p><p>You write a few configuration files. You run terraform init, then terraform plan. Terraform politely tells you what it plans to do. You run terraform apply, and the infrastructure shows up.</p><p>No dashboards.<br>No clicking.<br>No more wondering if you missed a checkbox.</p><p>It seems like infrastructure finally makes sense.</p><p>That’s why Terraform quickly earns the trust of so many engineers. And that trust is usually earned at first.</p><h4>When Terraform Is Still Easy</h4><p>Most of the time, nothing happens when you use Terraform for the first time.</p><p>There is one environment. One person runs the commands. A few resources.</p><p>You don’t think about the state very much. It’s just a file on your computer. Plans are easy to read and short. Applies happen fast. If there’s a permission issue or a typo, you fix it and move on. Let’s fix it and move on.</p><p>Terraform seems like a better version of scripting at this point. It’s declarative and it’s still easy to understand!</p><p>The problem is that this phase doesn’t show what Terraform really does. It doesn’t matter yet. No sharing. Nothing lasts long. Reality hasn’t tested Terraform yet.</p><h4><strong><em>Where the Shift Begins</em></strong></h4><p>The change doesn’t come about in a big way. It usually starts with a small change, like adding another engineer to the team.</p><p>That moment terraform moves from running by one person to a team.</p><p>It is essential for the team to see the states. So you add a remote backend. Locking is now a thing. Plans start to include changes that you didn’t make.</p><p>The tone changes, but everything still works. Terraform starts to feel less like a tool you own and more like a piece of machinery that everyone uses. Something you need to plan around.</p><p>People often say, “We should be careful with applies” at this point. Terraform is still working. But it is no longer casual.</p><h4><strong>Terraform Stops Being Predictable</strong></h4><p>Most teams remember when Terraform stopped being safe. It doesn’t often fail dramatically. Instead,</p><blockquote>It’s more often confusion.</blockquote><p>The plan seems like a good idea, but the outcome doesn’t feel right. Instead of being updated, a resource is made again. Something goes away and then comes back with a new name. Terraform didn’t do anything out of the ordinary, but you didn’t expect what it did. That’s when people realise something that makes them uncomfortable:</p><blockquote>Terraform is only as accurate as the model it has of the real world.</blockquote><p>That model lives inside the state file. And up to this point, you probably hadn’t given it much thought.</p><h4><strong>Terraform state is the backbone</strong></h4><p>Terraform state is more than just keeping track of things. It’s not a cache. It’s not metadata.</p><blockquote>Terraform understands the world only through its state.</blockquote><p>State is what Terraform uses to decide what to make, change, or get rid of. Terraform is wrong if the state is wrong.</p><p>This is why Terraform problems often have to do with state:</p><ul><li>state drift</li><li>state corruption</li><li>state conflicts</li><li>state being changed by the wrong person at the wrong time</li></ul><p>Terraform won’t keep you safe in these situations. It requires discipline. And that’s where discipline is put to the test in production systems.</p><h4><strong>Why “The Plan Looked Fine” Is So Common</strong></h4><p>The same sentence is in almost every Terraform incident. <em>The plan looked good.</em></p><p>It’s not because engineers don’t care. Terraform plans seem like they know what they’re talking about. They are clean. Organised. Deterministic.</p><blockquote>But a plan is not a promise. It’s a prediction based on assumptions.</blockquote><p>It assumes that:</p><ul><li>providers respond correctly</li><li>infrastructure works the same way every time</li><li>nothing changes between plan and apply</li><li>the state is a true picture of reality</li></ul><p>Production often goes against all of these ideas. Terraform doesn’t know that, and it doesn’t tell you.</p><h4><strong>Declarative Code Works with Bad Infrastructure</strong></h4><p>Terraform was made to be declarative. You tell Terraform what you want, and it figures out how to get there.</p><p>The reality is the infrastructure can change at any time. Cloud APIs are eventually consistent. But defaults can change over time. People change things outside of the band. It takes time for resources to settle. Permissions changes.</p><p>Terraform sees things that are different. And it does something when it sees differences. That’s not a problem. That’s what it’s supposed to do. But this is where Terraform starts to feel harsh. It doesn’t hold back. It doesn’t ask why things changed.</p><h4><strong>When Terraform Touches Too Much</strong></h4><p>Terraform is easier to handle when it only controls a small area. When it controls everything, it feels heavy.</p><p>VPCs. IAM. Databases. DNS. Load Balancers.</p><p>At that point, a single terraform apply is no longer a small task. It’s an event for the whole system. Terraform doesn’t know what a blast radius is. It doesn’t know which change is dangerous and which one isn’t.</p><blockquote>To Terraform, it’s all just a diff.</blockquote><p>That’s when engineers stop seeing Terraform applies as something they do every day and start seeing them as choices.</p><h4><strong>Terraform Isn’t Dangerous, it’s Literal</strong></h4><p>Terraform doesn’t break things for no reason. It follows its own rules when it causes outages. It uses the configuration you gave it, the state it trusts, and the responses it gets from the provider.</p><p>Terraform isn’t the problem.</p><p>The problem is that there is a difference between what engineers think Terraform does and what it really does. At first, that gap is small.</p><blockquote>It grows slowly in production until it matters.</blockquote><h4><strong>The Change in Thinking</strong></h4><p>At some point, people who have used Terraform a lot stop seeing it as a way to set things up.</p><p>They begin to see it as a way to manage states.</p><p>That change makes everything different.</p><p>The state becomes holy. Plans turn into review artefacts. Applies turn into planned events.</p><blockquote>Terraform starts to feel serious.</blockquote><h4><strong>Why Terraform Is Still a Good Deal</strong></h4><p>If you have read until now, you may wonder then why do people go for terraform? The answer is not that terraform stops mistakes.</p><blockquote>Terraform shows you when you make mistakes.</blockquote><p>It makes changes to infrastructure code.<br>It makes audit trails.<br>It shows what someone wants.</p><p>Terraform doesn’t get rid of risk. It brings the risks to the surface. You can always work on the problems that you are aware of.</p><h4><strong>Last Thought</strong></h4><p>Terraform feels simple when you’re building infrastructure. It feels heavy when you’re responsible for it.</p><blockquote>The moment Terraform “breaks” in production is rarely the moment it fails.</blockquote><p>It’s the moment you finally understand what it has been doing all along. Terraform was never just a convenience tool. It was always a system that remembers your infrastructure more precisely than you do. Once you realise that, you stop using Terraform casually. You start treating it like what it really is:</p><blockquote>production software that manages production systems.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fb658c5bf39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Kubernetes Pods Restart Even When Everything Seems Fine]]></title>
            <link>https://medium.com/@nirupamagr738/why-kubernetes-pods-restart-even-when-everything-seems-fine-45bbd30f55f2?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/45bbd30f55f2</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 17:08:31 GMT</pubDate>
            <atom:updated>2025-12-29T17:24:28.853Z</atom:updated>
            <content:encoded><![CDATA[<p>A Story About Production That Most Engineers Learn the Hard Way</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GG30nT_Nz-UOpTKA0ZC6PA.png" /></figure><p>I didn’t even know it was a problem the first time it happened. There were no problems during the deployment. Pods were showing that they were running. The service was working. Dashboards looked calm. There was nothing that seemed wrong enough to look into.</p><p>Then someone asked almost as an afterthought, “Why is the restart count going up?”</p><p>I opened the terminal once more.</p><p>The Pod was still going.<br>But the number of restarts was no longer zero.</p><p>I wasn’t worried at first. There are many reasons why a restart might happen. A short-term problem. A small problem that won’t hurt anything. After all, Kubernetes is strong.</p><p>But the number kept going up.</p><p>Two. Three. Five.</p><p>— — — — —</p><p><strong><em>The Restart That Wasn’t a Crash</em></strong></p><p>There were no alerts going off. There were no logs that were screaming. The application was still responding to requests.</p><p>From the outside, everything seemed fine.</p><blockquote>“Running” Doesn’t Mean “Safe”</blockquote><p>When I mostly worked with Docker, it was easy to see when things needed to be restarted. Something went wrong. A process stopped working. The startup failed because an environment variable was missing. You fixed the mistake and went on.</p><p>That’s not how Kubernetes works.</p><p>A Pod can restart in Kubernetes even if your app thinks it’s doing everything right. You don’t get that realisation from reading the documentation. It comes from production problems, the ones that don’t make a lot of noise.</p><p>I did what most engineers do at first. I went right to the logs.</p><p>I raised the levels of the logs. Added more logging to the startup process. Kept a close eye on the output.</p><p>There was nothing there.</p><p>No exceptions.<br>No deadly mistakes.<br>No alerts.</p><p>It was like someone had just pulled the plug on the app.</p><p>The logs didn’t give the answer. I didn’t think to run that command at first.</p><p>There was one word in the output that explained everything about the Pod.</p><p>OOMKilled</p><p>The app hadn’t crashed.<br>It had died.</p><p>Not by Kubernetes itself, but by the node itself.</p><p>Under load, memory use had been slowly going up. No sudden rise. There is no clear runaway process. It just kept growing steadily until it hit a limit that was set weeks earlier and stopped thinking about.</p><p>The kernel stepped in and stopped the process right away when that limit was reached. When the container disappeared, Kubernetes did what it always does: it noticed.</p><p>It started it up again.</p><p>There was no stack trace because the app never had a chance to make one. No smooth shutdown. No last log line.</p><p>That restart wasn’t a mess. It was the law.</p><p>— — — — —</p><p><strong><em>The Restart That Only Happened When It Was Loaded</em></strong></p><p>This one was weirder.</p><p>The Pods didn’t start up right away. They only restarted when there was a lot of traffic. Under light load, everything worked fine. The restarts came back as soon as usage went up.</p><p>The memory looked stable. The CPU wasn’t at its limit. The app worked, but it was slower.</p><p>This time, the issue wasn’t resources.</p><p>It was a checkup.</p><p>Someone had linked the liveness probe to an endpoint that checked everything, like whether the database was connected, the cache was available, and the downstream services were working.</p><p>It usually responded quickly.<br>When it was under load, it slowed down just enough to miss the probe’s time limit.</p><p>Kubernetes’ point of view was clear: this container is unhealthy.</p><p>So it killed it.<br>And started it over.</p><p>Again. And again.</p><p>The app wasn’t dead.<br>There were a lot of people there.</p><p>At that point, I understood the difference between being ready and being alive. One person is in charge of traffic. The other one controls life.</p><p>Kubernetes is merciless when you mix them up.</p><p>— — — — —</p><p><strong><em>When the Pod Didn’t Do Anything Wrong</em></strong></p><p>It took even longer to figure out what happened this time.</p><p>Pods were restarting in an unpredictable way. A few stayed up. Some people went away. The logs were clean. The metrics looked normal. There wasn’t an obvious pattern.</p><p>The problem wasn’t in the Pod at all.</p><p>There was pressure on the node.</p><p>The amount of disc space used had gone up. The memory on the node fell below safe levels. Kubernetes had to pick one.</p><p>It kicked Pods out.</p><p>Not because they weren’t healthy.<br>But there had to be a reason for it to go.</p><p>From the app’s point of view, this looked like random instability. Kubernetes thought it was protecting the cluster.</p><p>This was the moment I got something small but important:</p><p>Pods can restart even if they didn’t do anything wrong.</p><p>— — — — —</p><p><strong><em>The Quiet Restarts That No One Talks About</em></strong></p><p>Some restarts aren’t violent. They are quiet.</p><p>Containers come out all the time. On purpose sometimes. Sometimes they don’t handle it right when they get a termination signal.</p><p>Kubernetes doesn’t see your application exiting instead of shutting down gracefully as a success. It sees a process that is done and starts it over. As a rule.</p><p>This is why graceful shutdowns are important. Why it’s important to handle SIGTERM. Why terminationGracePeriodSeconds isn’t just a line in a YAML file that you found on the internet.</p><p>If you don’t handle termination correctly, Kubernetes kills Pods in the middle of a request. The restart seems to come out of nowhere. The logs don’t look complete.</p><p>Engineers get mixed up.</p><p>Kubernetes did what it said it would do.</p><p>— — — — —</p><p><strong><em>The Pattern That Causes “Random” Restarts</em></strong></p><p>These events started to happen in a pattern over time.</p><p>Kubernetes was unstable, so pods weren’t restarting.<br>They weren’t restarting because the platform was “too complicated.”</p><p>They were restarting because Kubernetes was making sure contracts were followed.</p><blockquote>Contracts set limits on memory.<br>Contracts set limits on the CPU.<br>Probe timings are agreements.<br>Node pressure thresholds are like contracts.</blockquote><p>Kubernetes resets the state if you break one. Debugging changed completely when I stopped asking, “Why is Kubernetes restarting my Pods?” and started asking, “Which rule did this Pod break?”</p><p>— — — — —</p><p><strong><em>Kubernetes Chooses Recovery Over Investigation</em></strong></p><p>Kubernetes doesn’t try to figure out how your app works.<br>It doesn’t wait to see if things get better on their own.</p><blockquote>In distributed systems, waiting is often more risky than restarting.</blockquote><p>Traffic can be stopped by a process that is stuck.<br>A slow container can cause a chain reaction of failures.<br>A node can crash because of a memory leak.</p><p>Kubernetes chooses recovery over looking into things.</p><p>That choice can seem cruel, but it’s what keeps big systems running.</p><p>— — — — —</p><p><strong><em>When Restarts Don’t Feel Random Anymore</em></strong></p><p>Eventually, I stopped thinking of restarts as chaos. I began to view them as feedback. Straightforward feedback.</p><p>The cluster didn’t say anything about how bad my code was. It told me that my assumptions were wrong.</p><p>Once you get that, Pods restarting without warning stops don’t feel random anymore.</p><p>They begin to seem like messages.And when you learn how to read those messages, production isn’t scary anymore, even when things go wrong.</p><p>— — — — —</p><p><strong><em>Last Thought</em></strong></p><p>Kubernetes is not broken if pods restart even when everything seems fine. Kubernetes is just being honest about how things are. And once you learn to listen to that honesty, you stop fighting to restart. You begin to make systems that can handle them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45bbd30f55f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your App Works in Docker but Not in Kubernetes: A Practical Deep Dive for Real Engineers]]></title>
            <link>https://medium.com/@nirupamagr738/why-your-app-works-in-docker-but-not-in-kubernetes-a-practical-deep-dive-for-real-engineers-30da5a8cc636?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/30da5a8cc636</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Sat, 20 Dec 2025 12:24:25 GMT</pubDate>
            <atom:updated>2025-12-23T08:00:18.738Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Your App Works in Docker but Not in Kubernetes: A Practical Deep Dive for Engineers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*046myN52KsX5Qt63N8m5uA.jpeg" /></figure><p>If you’ve used Kubernetes for a while, you’ve probably come across this strange situation:</p><p>Your app runs perfectly in Docker…<br>But as soon as you put it on Kubernetes, something goes wrong.</p><p>The UI might not load. The backend might not let connections through. The logs might look fine, yet the app is unreachable.</p><p><em>It could be that everything is “Running,” but nothing really works.</em></p><p>I used to think, “Kubernetes is just Docker, right?” So why does my container work fine on my computer but not in the cluster?</p><p>The truth is that Docker and Kubernetes run your containers in very different ways, with different rules, networks, and environments.</p><p>Once you know what those differences are, debugging gets a bit easier.</p><p>I’m going to explain the main reasons why apps work differently in Docker and Kubernetes in this article.</p><p>Let’s start at the beginning.</p><p>— — — — —</p><p>1. <strong>Docker Runs Your App as a Container. Kubernetes Orchestrates Containers.</strong></p><p>When you type in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*rBoMBjkYBvBFZYfjlbdz8A.png" /></figure><p>what it says is start this container with the port 8080 and map the host to the container. That’s all.</p><p>There is no service, no overlay network, no checks for readiness, no DNS layers, and no multi-hop routing.</p><p><strong>In Docker, the container sits directly on your machine. In Kubernetes, the container is wrapped inside the Pod, which lives inside a virtual network, and the Pod lives inside nodes.</strong></p><p>This one difference is what makes many things happen that you didn’t expect.</p><p>— — — — —</p><p>2. <strong>The Most Common Reason: Your App Is Listening on the Wrong Interface</strong></p><p>This is the main reason why apps work in Docker but not in Kubernetes.</p><p>A lot of people write apps in Docker that only listen on: 127.0.0.1 which is a loopback address. This works fine on the host machine because Docker forwards traffic from the host to the container.</p><p>But what about inside Kubernetes?</p><p>You can’t forward host ports unless you set it up yourself. Your Pod needs to listen on: 0.0.0.0. If this isn’t set correctly, traffic will never reach the Pod. The symptom is that the Pod is running and the logs look fine, but the Service says “no endpoints reachable.”</p><p>The main reason is that your app is only listening inside.</p><p>— — — — —</p><p>3. <strong>The Kubernetes ENVIRONMENT Is NOT the Same as Docker</strong></p><p>In Docker:</p><ul><li>You have to set environment variables by hand</li><li>Everything is local</li><li>DNS is simple</li><li>The network hop count is 1</li></ul><p>In Kubernetes: ENV vars come from ConfigMaps or Secrets. If configs are missing, the app won’t work. DNS is internal (CoreDNS). App URLs must use the service DNS name. The network path has multiple hops.</p><p>For example:</p><p>Your backend runs in Docker: <a href="http://localhost:8080/">http://localhost:8080</a></p><p>But in Kubernetes, the frontend HAS to use:</p><p><a href="http://backend-svc.default.svc.cluster.local:8080/">http://backend-svc.default.svc.cluster.local:8080</a> or the service can’t be resolved by the cluster. This one change makes a lot of first-time Kubernetes deployments fail.</p><p>— — — — —</p><p>4. <strong>The “Localhost Trap” works in Docker. It will never work in Kubernetes</strong>.</p><p>Apps often use the following to call backend services: <a href="http://localhost:5000/">http://localhost:5000</a>. This only works when all the containers are on the same Docker network or when everything runs on the host.</p><p>However, in Kubernetes each pod is separate and can be running on multiple nodes. Here, localhost refers to the pod itself, not other pods. To communicate with other pods you need to use fully qualified domain names (FQDN) like backend-svc.default.svc.cluster.local:5000</p><p>This is one of the main reasons why “the app loads but does nothing.”</p><p>— — — — —</p><p>5. <strong>Speed of Container Startup: Kubernetes Cares, Docker Doesn’t</strong></p><p>Docker doesn’t mind if your app takes a long time to start.</p><p>But Kubernetes really does care. Before sending traffic, Kubernetes checks to see if everything is ready. Without a readiness probe, your app won’t be ready to go if it needs time to load ML models, run migrations, or compile templates.</p><ul><li>your Pod may be marked running too soon</li><li>Traffic can hit it immeditely</li><li>The pod will fail under load</li><li>It sometimes restarts</li><li>It sometimes just hangs</li></ul><p>This problem goes away when you add a readiness probe:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*-Rwv_lfuOYCMEc89q78COw.png" /></figure><p>This one probe often solves the “works locally but not in cluster” mystery.</p><p>— — — — —</p><p>6. <strong>Kubernetes Networking is Overlaid, but Docker Networking Is Not</strong></p><p>Docker networking is like a simple bridge. Kubernetes networking uses overlay mesh.</p><p>This is how you can remember- Docker uses Client → Container. Kubernetes: Client → Service (ClusterIP) → kube-proxy → PodIP → Container</p><p>In Kubernetes, every request goes through:</p><ol><li>DNS for the cluster</li><li>A Service</li><li>kube-proxy</li><li>Overlay network (VXLAN / BPF)</li><li>Namespace for the pod network</li></ol><p>Your app must act the same way under these hops.</p><p>— — — — —</p><p>7. <strong>Services, Ports, and “Why isn’t my app getting to the backend?!”</strong></p><p>When docker exposes a port, it is instantly available.</p><p>In Kuberentes,</p><ul><li>The containerPort must be 8080.</li><li>The Service targetPort must be 8080.</li><li>The readiness probe must check 8080.</li><li>The app inside the pod must bind to 0.0.0.0.</li></ul><p>If any of these don’t match, the app won’t work. Simple mismatch makes the cluster act like the backend is dead.</p><p>— — — — —</p><p>8. <strong>NodePort, ClusterIP, and LoadBalancer don’t work like Docker ports.</strong></p><p>Docker:</p><p>-p 3000:3000 means simple forwarding.</p><p>Kubernetes:</p><ul><li>ClusterIP is only for internal use</li><li>NodePort exposes through the IP of each node, but not on localhost</li><li>LoadBalancer depends on the cloud provider</li></ul><p>— — — — —</p><p>9. <strong>Mistakes with ConfigMaps and Secrets That Only Break Apps in Kubernetes</strong></p><p>This happens all the time:</p><ul><li>Missing config</li><li>Wrong mount paths</li><li>Wrong key names</li><li>JSON stored wrong</li><li>YAML indentation</li><li>Value quoting problems</li></ul><p>Kubernetes makes the configuration flow more structured. Docker uses simple environment injection. This difference causes a lot of “works locally / fails in cluster” problems.</p><p>— — — — —</p><p>10. <strong>Kubernetes Doesn’t Restart Every Time a File Changes (Docker Compose Does)</strong></p><p>In Docker Compose, dev mode usually reloads quickly.</p><p>In Kubernetes, pods don’t reload on their own, configMaps don’t reload on their own, Secrets don’t reload unless the Pod is restarted, and hot reloading doesn’t work very often inside clusters.</p><p>People deploy a new ConfigMap but forget to restart the Deployment. The app still uses old values, so the “bug continues.”</p><p>— — — — —</p><p>11. <strong>You Don’t Think Health Checks Are Important</strong></p><p>Docker: startup means the app is running.</p><p>Kubernetes: Startup → Liveness → Readiness → Traffic → Scaling</p><p>If your livenessProbe is too harsh:</p><ul><li>The pod keeps restarting.</li><li>The app never stabilises.</li><li>Logs look fine on your computer but crash in Kubernetes.</li></ul><p>If your readiness probe is slow:</p><ul><li>The service thinks the backend is dead.</li><li>The load balancer doesn’t care.</li><li>The frontend shows a blank screen.</li></ul><p>Health probes change everything.</p><p>— — — — —</p><p>12. <strong>File paths, volumes, and mounts all work in different ways.</strong></p><p>Docker frequently employs implicit local paths.</p><p>Kubernetes uses:</p><ul><li>emptyDir</li><li>persistentVolumeClaim</li><li>projected volumes</li><li>volumes for configMap</li><li>volumes for secrets</li></ul><p>If your app needs local filesystem paths to be exactly the same as in Docker, Kubernetes might not be able to do that.</p><p>This breaks: uploads, temp directories, caches, and logs.</p><p>— — — — —</p><p>13. <strong>CORS: The Kubernetes Frontend’s Quiet Killer</strong></p><p>In Docker: Frontend and backend often come from the same place, so there is no CORS issue.</p><p>In Kubernetes: the frontend and backend are typically exposed through different Services or hostnames. So from the browser’s point of view, this is a different origin, CORS enforcement will kick in. If the backend does not explicitly return the Access-Control-Allow-Origin header, the browser blocks the response with errors like:</p><p>CORS policy: No ‘Access-Control-Allow-Origin’ header present</p><p>This is why applications often work locally in Docker but fail once deployed to a Kubernetes cluster.</p><p>— — — — —</p><p>14. <strong>The Deployment Mental Model That Solves Most Problems</strong></p><p><em>The mental checklist to use when debugging Docker-to-Kubernetes issues:</em></p><p>1. Is the container set up to listen on 0.0.0.0?<br>2. Are the environment variables being passed correctly?<br>3. Are the right ports open on the Pod?<br>4. Do the readiness and liveness probes match how the app works?<br>5. Does the service selector match the labels perfectly?<br>6. Is the targetPort for the service the same as the containerPort?<br>7. Does DNS work correctly on the backend?<br>8. Is it possible for the Pod to use curl to get to the backend?<br>9. Are ConfigMaps and Secrets set up correctly?<br>10. Are there any problems with CrashLoopBackOff or probes?</p><p>Your app will work the same way in both Docker and Kubernetes if all 10 match.</p><p>— — — — —</p><p>If your app works in Docker but not in Kubernetes, it’s not because Kubernetes is hard to use: it’s because Kubernetes expects your app to follow rules that Docker doesn’t.</p><p>When you think this way:</p><ul><li>Debugging becomes predictable</li><li>Deployments become reliable</li><li>Kubernetes starts to feel like a controlled system instead of a mystery box</li></ul><p>This knowledge will make you a better DevOps engineer, a better SRE, and someone who can think logically about systems instead of just guessing.</p><p>Please leave a comment if you want me to go into more detail about any part of Kubernetes, such as kube-proxy, DNS, probes, Services, Deployments, or Pod internals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30da5a8cc636" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Story from kubectl apply to a Running Application: What Really Happens Inside a Kubernetes…]]></title>
            <link>https://medium.com/@nirupamagr738/a-story-from-kubectl-apply-to-a-running-application-what-really-happens-inside-a-kubernetes-c85b8603b904?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c85b8603b904</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Tue, 09 Dec 2025 06:20:07 GMT</pubDate>
            <atom:updated>2025-12-09T06:34:24.568Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Story from kubectl apply to a Running Application: What Really Happens Inside a Kubernetes Deployment</h3><p>Most engineers run a Deployment and immediately check Pods, logs, or Services. I used to do the same. But the real machinery starts much earlier. After I went through that sequence end-to-end, Kubernetes stopped being unpredictable and started acting like a system I could actually reason about.</p><p>Here is the exact Deployment and Service I used to trace the internal flow for this article, which will make this walkthrough more concrete.</p><figure><img alt="A deployment file defining replicas+ labels + matchLabels + image + readinessProbe + livelinessProbe + resources and imagePullSecrets" src="https://cdn-images-1.medium.com/max/598/1*ovOvcWbuAM2nb5BwFlywMA.png" /></figure><p>and here is a service file which exposes the pods</p><figure><img alt="Service file with selectors and ports and type of service mentioned in it." src="https://cdn-images-1.medium.com/max/418/1*ZnMf3YhcJTdJpmcU2BBEGQ.png" /></figure><p>Now, let’s walk through what the cluster does with this deployment and service.</p><p>— — — — —</p><ol><li><strong>kubectl apply is what we do right?</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*mLTSnHBm1uCI-VTWUS-3Ag.png" /></figure><p>The biggest surprise when I first looked into this process was realising that kubectl doesn’t actually deploy anything. It just reads your YAML, turns it into JSON, and sends a request to the Kubernetes API server. The API server checks the manifest’s structure, schema, and permissions very carefully before writing it to etcd.</p><p>At this point, the cluster “records” what you want. You have now saved a desired state in the store, but nothing is running yet. The Deployment is only a record of what you want to do.</p><p>— — — — —</p><p>2. <strong>The Deployment controller is the first to interact.</strong></p><p>When the API server finishes the Deployment, the Deployment controller takes over. It reads the specification, which in this case says there should be three replicas, and then it makes the ReplicaSet that will keep those Pods running. The ReplicaSet is like the worker who makes the Pod objects based on the template that is built into the Deployment.</p><p>But just because you make Pods doesn’t mean you have to run them. As of now, the Pods only exist in the cluster’s state. They have names, UIDs, and labels, but they don’t have any containers or node assignments yet. They begin in the Pending state.</p><p>— — — — —</p><p>3. <strong>The Scheduler gives each Pod a place to live.</strong></p><p>A pod can’t run if it doesn’t have a node. This is when the Scheduler starts to matter. It keeps an eye out for Pods that don’t have a node assigned. When it finds one, it looks at all the nodes that are available and compares the Pod’s needs to what each node can offer, such as CPU, memory, taints, tolerations, affinity rules, and general resource availability.</p><p>The Scheduler adds a nodeName to the Pod’s specification after choosing a node. A small change to a field causes a big change: the Pod is now Scheduled. It still isn’t running, but now the node itself is in charge instead of the control plane.</p><p>— — — — —</p><p>4. <strong>Kubelet takes charge and starts preparing the environment.</strong></p><p>When kubelet sees that a Pod on its node needs to start, it starts getting everything ready that the Pod needs. This includes setting up Linux namespaces for isolation, setting cgroups for resource limits, mounting volumes, pulling the container image (if needed), and telling containerd or CRI-O to start the container.</p><p>But a container that doesn’t have networking isn’t useful yet. Kubernetes wants Pods to be able to talk to each other in the cluster, so each Pod needs its own network identity.</p><p>— — — — —</p><p>5. <strong>The CNI plugin gives Pod an IP address.</strong></p><p>This step in networking made everything make sense to me. The Pod’s network interface is made by the CNI plugin, which could be Flannel, Calico, Cilium, or something else. It makes a veth pair, connects one end to the Pod and the other to the node’s bridge (usually cni0), and gives the Pod an IP address.</p><p>This is what a simpler view looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVhS8M3VW_WXu2T9ODiOcA.png" /><figcaption>image from chatGPT</figcaption></figure><p>At this point, the Pod can be reached from inside the cluster’s virtual network.</p><p>When the container runtime says that the container is running, the Pod goes into the Running state. But Kubernetes still doesn’t send any traffic to it.</p><p>— — — — —</p><p>6. <strong>Readiness Probe decides when it can receive traffic.</strong></p><p>The application inside a container might not be ready yet, even though the container is running. That’s why there are readiness probes. The readiness probe checks /health on port 80 in this Deployment. Kubernetes won’t add the Pod to the Service’s endpoint list until this probe gets successful responses.</p><p>The Pod doesn’t become Ready until the probe succeeds. Once the Pod is ready, Pod can start receiving traffic.</p><p>— — — — —</p><p>7. <strong>The Service finally sees its backend Pods.</strong></p><p>The Service (react-frontend-svc) uses app: react-frontend as the selector. Once our new pod with this label is ready, it will be updated in the service endpoint list. At this point if you do,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*7o7R9CzrzfCncU2x5y6s1A.png" /></figure><p>you should see the Pod cluster ip’s with port numbers. These are the real applications that are running behind the ClusterIP. None of these Pods would be here if they weren’t ready(by readinessProbe).</p><p>— — — — —</p><p>8. <strong>kube-proxy changes the routing so that the Service can send traffic.</strong></p><p>Kube-proxy runs on every node in the cluster. When the Service changes its endpoints, kube-proxy changes its rules so that any request to: react-frontend-svc:80 will be forwarded to the podIP’s.</p><p>The flow looks something like this -&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*sev-3sZ1zdmDn7Lf80Fipg.png" /><figcaption>image from chatGPT</figcaption></figure><p>Finally the deployment is running and is reachable to the users.</p><p>— — — — —</p><p><strong>What happens when you update the Deployment?</strong></p><p>Rolling updates safely replace Pods. When you update the Deployment image or any changes where the old replica sets gets replaced by new ones, a sequence starts. Kubernetes creates a new ReplicaSet, gradually scales it up while scaling the old one down, and relies on readiness probes to make sure that traffic doesn’t go to Pods that is not ready.</p><p>The rollout stops if readiness fails. If everything goes well, Kubernetes finishes the update without any problems.</p><p>— — — — —</p><p><strong>This is what the whole flow looks like:</strong></p><p><strong>kubectl apply -f deploy.yaml<em><br>→ API server validates and stores the configuration in etcd<br>→ Deployment controller creates ReplicaSet<br>→ ReplicaSet creates Pods (in Pending state)<br>→ Scheduler assigns nodes<br>→ kubelet prepares pod environment and starts containers<br>→ CNI plugin sets up networking and assigns a PodIP<br>→ readinessProbe succeeds → Pod becomes Ready<br>→ Service registers the Pod to its endpoints list<br>→ kube-proxy updates routing rules so traffic to the service will be routed to the PodIp</em></strong></p><p>When you look at Kubernetes from this angle, Kubernetes is not a vague system at all. It is a series of very specific actions carried out by clearly defined parts, each of which has a specific job to do.</p><p>When you understand this sequence, you have a mental model that makes debugging more systematic.</p><p>— — — — —</p><p><em>Thanks</em> <em>for reading. I appreciate every person who takes the time to go through it. If you enjoyed this breakdown, feel free to comment, share, or follow for more Kubernetes and DevOps deep dives.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c85b8603b904" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What really happens inside VXLAN and why Kubernetes uses overlay networks]]></title>
            <link>https://medium.com/@nirupamagr738/what-really-happens-inside-vxlan-and-why-kubernetes-uses-overlay-networks-b20d675e7a4d?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b20d675e7a4d</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Wed, 03 Dec 2025 03:18:36 GMT</pubDate>
            <atom:updated>2025-12-03T03:40:33.000Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Note</em>: This article talks about the networking for Kubernetes that uses overlay CNI like Flannel, Calico (VXLAN mode) or weave. For managed cloud CNI’s like Azure CNI or AWS VPC CNI, the general flow is similar but pod traffic routes through VPC (cloud provider’s native CNI) instead of through VXLAN tunnels.</p><p>Also, I felt it is important to mention what underlay networking is before we begin the overlay networks. Underlay is a real physical/VPC network.</p><p>— — — — —</p><p>If you’ve ever used Kubernetes to deploy apps, you may have noticed something strange: every pod gets its own IP address, even though the cloud provider has already given IP addresses to the nodes that the pods are running in.</p><p>How does that even work?</p><p>When:<br>• The VPC can’t route to pod IP ranges<br>• The cloud network only knows about the IPs of nodes <br>• Kubernetes still promises “pod-to-pod communication across nodes”!</p><p>This is the problem that Kubernetes fixes with overlay networks, which are often powered by VXLAN.</p><p>This article talks about why overlays are needed, how VXLAN works, where packets are rewritten, and what happens when something goes wrong behind the scenes.</p><p>I hope by the end of this article, this article will make you 1 step closer to understanding Kubernetes.</p><p>— — — — —</p><p>💡 <strong>Why overlays are necessary for pod networking</strong></p><p>Before we can understand overlays, we need to know what problem they fix:</p><p>1. Pod IPs aren’t real things on the network.</p><p>Your cloud network (AWS VPC, GCP VPC, Azure VNet) knows about<br>• Node IP<br>• CIDRs for subnets<br>• Routing tables and gateways</p><p>But it doesn’t know about the internal pod IP ranges, like 10.188.1.5 or 10.188.2.9. You can’t add 5000 pod CIDRs to a route table for a VPC.</p><p>2. Kubernetes needs a “flat pod network.”</p><p>Kubernetes expects:<br>• All pods can talk to each other, even if they are on different nodes<br>• No NAT<br>• No manual routes<br>• The application doesn’t know about nodes</p><p>For example: Using plain HTTP, a pod on Node1 can talk to a pod on Node2:</p><p><a href="http://10.244.3.14:8080/">http://10.188.1.5:8080</a></p><p>But your VPC can’t send that packet on its own. This problem is fixed by overlay networking.</p><p><strong>A virtual network that sits on top of the real network is called an overlay network.</strong></p><p>So, what does an overlay network do?</p><p>Kubernetes uses it to:<br>• Set up virtual pod subnets<br>• Direct traffic between pods in the cluster<br>• Make networking flat across all physical nodes<br>• Don’t touch the routing tables that are native to the cloud</p><p>The underlying network only sees Node A and Node B talking to each other, but the real packet is inside that traffic -&gt; Pod A to Pod B (inside the tunnel) The overlay is this “network inside a network.”</p><p>— — — — —</p><p>🔧 VXLAN is the most popular overlay technology.</p><p>One of the most popular ways to connect Kubernetes pods is with VXLAN (Virtual Extensible LAN). Flannel, Calico, and Canal all use different versions of it.</p><p>What VXLAN does:</p><p>VXLAN puts the original Pod packet inside a UDP packet so that it can move between nodes using their IPs.</p><p>Think of it like this:<br>• Inside packet: PodIP → PodIP<br>• Packet from the outside: NodeIP → NodeIP (this is the only one the cloud network can see)</p><p>It’s like putting a letter in a bigger envelope to send it around the world. This is why cloud only sees nodeIP traffic and not the podIP traffic.</p><p>— — — — —</p><p><strong>Step by Step: What Happens When Pod A and Pod B Talk</strong></p><p>Let’s say:<br>• Node 1 has Pod A<br>• Node 2 has Pod B on it<br>• They are in different Pod CIDRs</p><p>Here’s the real flow in full detail:</p><p>1. Pod A makes a packet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*Y-F2y7FgWckSf5bcxMLuEQ.png" /><figcaption>image from chatGPT</figcaption></figure><p>It sends it through its virtual Ethernet interface (veth).</p><p>2. The packet goes into the Linux bridge (cni0). This is the virtual switch that connects all of the pod interfaces. Linux is now checking its routing table: Is 10.244.2.7 on my computer? No, send through flannel.1 (VXLAN tunnel). This route was written by CNI during node setup.</p><p>3. VXLAN wraps it up. VXLAN puts the whole Pod packet inside a UDP packet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*d9xa9CnnggQ154yukB1Ytw.png" /><figcaption>image from chatGPT</figcaption></figure><p>The cloud network only sees traffic going from Node1 to Node2 now.</p><p>4. The VPC routes it normally. AWS, GCP, and Azure all think this is just node traffic.</p><p>5. The packet goes to Node 2. The original Pod-to-Pod packet is taken out of the VXLAN tunnel. Node 2 now sends traffic to veth interface of Pod B. It goes across:<br>• flannel.1 → cni0 → Pod B’s veth → Pod container</p><p>The pod gets the packet but doesn’t know anything about VXLAN. From the outside, it looks magical. Once you know what’s going on, it makes perfect sense.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*uozDnuD54zFtXaI2wLbCTA.png" /><figcaption>image from chatGPT</figcaption></figure><p>— — — — —</p><p>🎨 Where Packet Rewrites Take Place</p><p>There are two main rewrites in the internals of Kubernetes:</p><p>1. ServiceIP → PodIP (kube-proxy DNAT)</p><p>When the front end calls a service <a href="http://backend.default.svc.cluster.local/">http://backend.default.svc.cluster.local</a>:8080, DNS only gives back 10.96.0.25 (ClusterIP) of the service. Then kube-proxy rewrites it with selected backend PodIP : PodPort (192.168.2.10:8080). This is DNAT, which stands for Destination NAT, it rewrites the destination IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*jAm6QWwuZFJhWLevUKV8nA.png" /><figcaption>image from chatGPT</figcaption></figure><p>2. PodIP → NodeIP encapsulation (VXLAN)</p><p>If PodB is on a different node: VXLAN wraps the pod packet in order to send from Node1 to Node2. This lets VPC send packets without knowing the pod CIDRs.</p><p>— — — — —</p><p>📉 What Happens When Overlay Networks Don’t Work</p><p>Some of the hardest things to fix in Kubernetes are overlay failures.</p><p>Common signs:</p><ol><li>DNS works, but HTTP doesn’t (Drop in traffic between nodes)</li></ol><p>2. “Upstream timed out” errors (Problems with the MTU or tunnel configuration)</p><p>3. The node can ping the PodIP, but the pods can’t (Wrong entries in the flannel FDB)</p><p>4. Requests that are stuck at 1500 bytes (Encapsulation overhead leads to fragmentation and drops)</p><p>5. One node gets cut off from the rest of the network (Wrong routing entry<br>Or a broken flannel.1 interface)</p><p>— — — — —</p><p>Tools You Need to Know for Debugging Overlays</p><p>These commands give you power: ip link show flannel.1, ip addr show cni0, ip route, bridge fdb show dev flannel.1, tcpdump -i eth0 udp port 4789, tcpdump -i flannel.1, iptables -t nat -L -n</p><p>It becomes easy to use overlay networking once you know how to read these outputs.</p><p>— — — — —</p><p>💭 Last Thought</p><p>Overlays are one of the main reason Kubernetes works.</p><p>An IP address for a pod is not “just an IP.” It’s a virtual identity that travels through a tunnel that the cloud network can’t see.</p><p>When you get this:<br>• Debugging becomes faster<br>• Network failures follow clear patterns<br>• You start to understand how Kubernetes networking works</p><p>Once you start diving into overlays and networking, you are one step closer to understanding Kubernetes and turning it into a predictable system. Predictable systems are usually easier to operate and debug.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b20d675e7a4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Request Travels Through Kubernetes Using Gateway API and Istio (A Real Networking Story)]]></title>
            <link>https://medium.com/@nirupamagr738/how-a-request-travels-through-kubernetes-using-gateway-api-and-istio-a-real-networking-story-2ff03adc4ba7?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ff03adc4ba7</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Mon, 24 Nov 2025 18:33:52 GMT</pubDate>
            <atom:updated>2025-11-24T18:33:52.655Z</atom:updated>
            <content:encoded><![CDATA[<p>Most Kubernetes tutorials stop at “Ingress sends traffic to a pod.”</p><p>Real production systems are much more interesting.</p><p>More and more modern clusters are using the Gateway API instead of Ingress and a service mesh like Istio to manage traffic, security, and visibility.</p><p>This is the story of how one request goes from a user’s browser to an application pod and then to a database.</p><p>— — — — —</p><p>It All Begins with a User</p><p>A person opens a browser and types:</p><p><a href="https://myapp.com/">https://myapp.com</a></p><p>DNS resolves the domain, makes a TCP connection, and sends the request over the internet to your cloud load balancer.</p><p>At a high level, the request goes like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*lBJs2rNapSehX3G5DyXNqA.png" /><figcaption>image from chatGPT</figcaption></figure><p>The request has now made it into your Kubernetes cluster.</p><p>The Gateway API Takes Control :</p><p>Instead of using the older Ingress model, the Gateway API uses separate, more powerful building blocks: <br>• GatewayClass: This tells the controller (like Istio or another provider) what to do.<br>• Gateway: sets the listener (ports, protocols, TLS)<br>• HTTPRoute — defines rules like hostnames and paths</p><p>This means that traffic routing is no longer just one Ingress object.<br>It is a structured, extensible model that lets you control traffic much more precisely. You can look at this layer with:</p><p>-&gt; kubectl get gateway<br>-&gt; kubectl get httproute</p><p>The Gateway controller sends the request to the right Kubernetes Service based on the defined rules.</p><p>— — — — —</p><p>Istio Quietly Steps In-</p><p>Something strong but unseen happens now. When you install Istio, Envoy is usually added to your application pods as a sidecar proxy. This means that the traffic doesn’t go straight to your container. Instead, Linux sends the traffic through the Envoy proxy first. The path inside the pod looks something like this:</p><p>Service → iptables redirect → Envoy → Application</p><p>You can see these rules for redirection by going to:</p><p>-&gt; iptables -t nat -L -n</p><p>At this point, Istio can do the following:<br>• Encryption with mTLS<br>• Rules for traffic<br>• Timeouts and retries<br>• Breaking the circuit</p><p>Your app doesn’t even know this is going on.</p><p>— — — — —</p><p>When one pod talks to another pod -</p><p>Now think about what would happen if the frontend pod had to call the backend pod. It has a simple name for the service, like:</p><p><a href="http://backend.default.svc.cluster.local/">http://backend.default.svc.cluster.local</a></p><p>First, the pod looks up the DNS:</p><p>-&gt; cat /etc/resolv.conf<br>-&gt; nslookup backend</p><p>CoreDNS gives back a ClusterIP.</p><p>This is a virtual IP managed by kube-proxy. It is not a real computer. Iptables DNAT rewrites ClusterIP into a real Pod IP by following rules set up by kube-proxy. You can see these rules in action with:</p><p>-&gt; iptables -t nat -L -n</p><p>Istio stops the packet again and sends it through the source Envoy proxy before it leaves the pod. The packet is now ready to move between nodes.</p><p>This is where overlay networking comes into play.</p><p>— — — — —</p><p>The Real Cross-Node Journey with Istio and VXLAN</p><p>The packet takes a longer path when the destination pod is on a different node. This is how it really flows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*33Ls3KiDAgngFMGdnp3wNg.png" /><figcaption>image from chatGPT</figcaption></figure><p>In simple words:</p><p>The app sends the request to the Envoy proxy on its own server.<br>The packet goes through a virtual Ethernet port.<br>It goes over the Linux bridge.<br>It goes inside a VXLAN tunnel.<br>It goes through the cloud network.<br>It is opened on the other node.<br>It goes through the Envoy proxy at the destination.<br>And finally, it gets to the backend app.</p><p>You can inspect this network layer with:</p><p>-&gt; show flannel.1 on ip link<br>-&gt; bridge fdb show dev flannel.1</p><p>— — — — —</p><p>When the Backend Speaks to the Database-</p><p>The backend often needs data after it gets a request. If the database is running inside the cluster it will take the below path -</p><p>Pod → Envoy → Service → Pod (Database)</p><p>The packet leaves the node completely if the database is outside the cluster. That part of the trip looks like this-</p><p>Pod → Envoy → Node routing → VPC → Database</p><p>You can see this routing with:</p><p>-&gt; ip route <br>-&gt; tcpdump -i eth0</p><p>This is where Kubernetes networking and regular cloud networking come together.</p><p>— — — — —</p><p>Why Systems Fail in the Real World</p><p>When you use Gateway API, Istio, VXLAN, and Linux networking together, things can go wrong in a lot of places.</p><p>The Gateway setup is wrong sometimes.<br>There are times when the HTTPRoute doesn’t match.<br>A policy can sometimes stop traffic in Istio.<br>DNS doesn’t always work.<br>There are times when iptables rules don’t work.<br>The tunnel doesn’t always send packets along.</p><p>A lot of the time, engineers say “Kubernetes is down,” but really, it’s just one layer in this chain that broke.</p><p>How This Information Changes How You Debug-</p><p>Fixing a network issues makes more sense when you follow the path of packets. Where did the packet come in? Which proxy touched it? Was it covered? Did it fall? Was it turned down?</p><p>These are some of the questions which help to find the fixes and makes the concept to be understood in a much deeper way.</p><p>— — — — —</p><p>Last Thought -</p><p>Kubernetes networking isn’t just about pods and services anymore, thanks to Gateway API and Istio. A single user request can now go through:</p><p>A load balancer in the cloud, a controller for the gateway, rules for routing, envoy sidecars, bridges in Linux, tunnels for VXLAN, and layers for cloud networking.</p><p>Every successful response is just a packet that took the right path. Every time something goes wrong, it’s just a packet that didn’t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ff03adc4ba7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to Kubernetes DNS, ClusterIP, and Basic DevOps Networking Commands]]></title>
            <link>https://medium.com/@nirupamagr738/a-practical-guide-to-kubernetes-dns-clusterip-and-basic-devops-networking-commands-7309c138a92f?source=rss-3a231ef0c78a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7309c138a92f</guid>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Nirupama G R]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 16:15:30 GMT</pubDate>
            <atom:updated>2025-11-17T16:18:41.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tWoHQTjrpVTFaDMBKJDz1g.png" /></figure><p>If you’ve ever tried to figure out why services aren’t connecting in Kubernetes, you’ve probably run into the same confusing problem that every DevOps engineer has:</p><p>“Why does DNS work in a pod but not on the master node?”</p><p>“Why does ClusterIP work when DNS doesn’t?”</p><p>“When should I use dig, nslookup, curl, ping, netcat, or tcpdump?”</p><p>This article gives you a clear, ready-to-use explanation of how Kubernetes DNS works, as well as a single cheat sheet of the most important networking commands for DevOps that you’ll use every day.</p><p>Let’s get right to it.</p><p>🟢How Kubernetes DNS Really Works-</p><p>CoreDNS helps Kubernetes figure out fully qualified service names like these:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*UZh6pDxR09a7KabS0ne3kw.png" /></figure><p>This is what matters:</p><ul><li>CoreDNS runs as a normal Deployment and Service inside the cluster.</li><li>Every pod automatically points to CoreDNS through its /etc/resolv.conf file.</li><li>The cluster’s CNI (Calico, Flannel, Weave, etc.) handles sending DNS traffic to CoreDNS.</li></ul><p>Result: You can resolve Kubernetes service names inside a pod without doing anything special.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*e4ArG-CIucFEGlKbMzi9Vg.png" /></figure><p>Works great inside pods.</p><p>— — — — —</p><p>🔴 Why DNS Doesn’t Work on the Master Node</p><p>This is where a lot of people get mixed up. CoreDNS is not used by nodes, including the master. They use the DNS settings of their host OS, which usually point to something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*2_kV6yAsf1F16nC29HCyaw.png" /></figure><p>Since CoreDNS is not the host’s DNS resolver, the node can’t resolve *.svc.cluster.local.</p><p>dig airport-svc.backend-ns.svc.cluster.local and curl airport-svc.backend-ns.svc.cluster.local doesn’t work.</p><p>Service DNS resolution will always fail on nodes unless you change the nameserver to CoreDNS by hand (not recommended).</p><p>— — — — —</p><p>🟢 Why the Master Node Can Use ClusterIP</p><p>This is the important difference:</p><p>DNS resolution doesn’t work on nodes. Cluster networking works. Kube-proxy and iptables/nftables rules manage ClusterIP, which is a virtual IP inside the cluster network. The master node can reach the ClusterIP directly because it is part of the cluster network.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*R2LgB2KXD2MMwqEAMhAKgQ.png" /></figure><p>This will still work even if the service DNS goes down. This is why Kubernetes docs say things like:</p><ul><li>Inside pods, use the service DNS name.</li><li>On nodes, use ClusterIP.</li><li>Outside the cluster, use NodePort/LoadBalancer/Ingress or port-forward.</li></ul><p>— — — — —</p><p>🧭 Getting to Services: The Right Way</p><p>In a Pod, DNS and clusterIP both works (curl http://&lt;service-name&gt;.&lt;namespace&gt;.svc.cluster.local).</p><p>On master and worker nodes DNS doesn’t work but ClusterIP does (curl http://&lt;ClusterIP&gt;:&lt;port&gt;).</p><p>Outside the cluster nodeport, load balancer, port forward or ingress works. DNS and ClusterIP doesn’t( kubectl port-forward svc/myservice 8080:80).</p><p>— — — — —</p><p>DevOps Networking commands: cheatsheet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzO26Y-jdcPJt-BAgAl37g.png" /><figcaption>table created with the help of chatGPT</figcaption></figure><p>🔧 Kubernetes Context for These Commands</p><ul><li>In a pod debugging you can use DNS (dig &lt;service-name&gt;). Check the port (nc &lt;service&gt; &lt;port&gt;). Test the api (curl &lt;service-name&gt;:&lt;port&gt;).</li><li>DNS will fail on a Node, so don’t test service names here. Instead, use ClusterIP.</li><li>Outside of the cluster, use curl with NodePort, LB, Ingress or kubectl port-forward.</li></ul><p>— — — — —</p><p>Final Thoughts-</p><p>The main reason people get confused about Kubernetes networking is because of one thing:</p><p>CoreDNS is used by pods, but not by nodes. Technically you can but not recommended. You don’t want circular dependency!</p><p>Once you get that, everything is easy to guess:</p><ul><li>DNS doesn’t work on nodes that don’t use CoreDNS.</li><li>ClusterIP works because the node is in the cluster network. Routed by the kube-proxy, not CoreDNS.</li><li>Pods have full DNS through CoreDNS.</li><li>Outside access needs to be exposed through NodePort/LB/Ingress.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7309c138a92f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>