<?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 Prabhav Mishra on Medium]]></title>
        <description><![CDATA[Stories by Prabhav Mishra on Medium]]></description>
        <link>https://medium.com/@prabhavmishra19?source=rss-f07d3e64c8fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EVaXDX7xKpbyu8LUTKLDfA.jpeg</url>
            <title>Stories by Prabhav Mishra on Medium</title>
            <link>https://medium.com/@prabhavmishra19?source=rss-f07d3e64c8fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 09:51:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prabhavmishra19/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[Multi-Region Architecture on Kubernetes: Designing for High Availability and Disaster Recovery]]></title>
            <link>https://medium.com/@prabhavmishra19/multi-region-architecture-on-kubernetes-designing-for-high-availability-and-disaster-recovery-6f88571b3018?source=rss-f07d3e64c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f88571b3018</guid>
            <category><![CDATA[multi-region-deployment]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[disaster-recovery]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Prabhav Mishra]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 07:40:47 GMT</pubDate>
            <atom:updated>2026-11-10T07:40:47.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y5nBdgKgSgBDXk_d" /></figure><h3>Multi-Region Architecture on Kubernetes: Designing for High Availability and Disaster Recovery</h3><p>What happens when an entire cloud region becomes unavailable?</p><p>For applications running in production, a regional outage can affect thousands of users, interrupt business operations, and cause significant downtime.</p><p>Deploying an application across multiple availability zones improves resilience against localized infrastructure failures. However, it does not necessarily protect an application against a complete regional outage.</p><p>This is where <strong>Multi-Region Architecture</strong> becomes important.</p><p>In this article, we’ll explore how to design a multi-region application architecture using Kubernetes, cloud networking, traffic management, and database replication.</p><h3>1. Why Multi-Region Architecture?</h3><p>A traditional deployment might look like this:</p><pre>Users<br>                |<br>                v<br>          Load Balancer<br>                |<br>                v<br>          Kubernetes Cluster<br>                |<br>                v<br>           Application<br>                |<br>                v<br>             Database</pre><p>This architecture can work well, but it introduces a major availability concern: the application depends on a single region.</p><p>If the region experiences a significant outage, the application may become unavailable.</p><p>A multi-region architecture distributes application infrastructure across two or more geographical regions.</p><p>For example:</p><ul><li>Region A: Primary production region.</li><li>Region B: Secondary production region.</li><li>Region C: Optional testing or canary region.</li></ul><p>The objective is to maintain service availability even when one region experiences a failure.</p><h3>2. Understanding the Multi-Region Architecture</h3><p>A simplified architecture looks like this:</p><pre>Users<br>                      |<br>                      v<br>              Global Traffic Manager<br>                      |<br>             +--------+--------+<br>             |                 |<br>             v                 v<br>        Region A           Region B<br>        Primary            Secondary<br>             |                 |<br>             v                 v<br>        Kubernetes         Kubernetes<br>          Cluster            Cluster<br>             |                 |<br>             v                 v<br>        Application         Application<br>             |                 |<br>             +--------+--------+<br>                      |<br>                      v<br>              Database Layer<br>             Replication / BCDR</pre><p>A global traffic management layer directs incoming requests to healthy application endpoints.</p><p>Each region maintains its own application infrastructure, while the data layer is designed to support replication and recovery.</p><p>The exact architecture depends on the application’s consistency, availability, and recovery requirements.</p><h3>3. Deploy Independent Kubernetes Infrastructure</h3><p>One important principle of multi-region design is infrastructure independence.</p><p>Each region should have its own Kubernetes cluster and supporting infrastructure.</p><p>For example:</p><p><strong>Region A</strong></p><ul><li>Kubernetes cluster.</li><li>Application workloads.</li><li>Ingress controller.</li><li>Monitoring agents.</li><li>Region-specific networking.</li><li>Access to the database layer.</li></ul><p><strong>Region B</strong></p><ul><li>Independent Kubernetes cluster.</li><li>Equivalent application workloads.</li><li>Ingress controller.</li><li>Monitoring agents.</li><li>Region-specific networking.</li><li>Access to the database layer.</li></ul><p>Infrastructure can be provisioned using tools such as Terraform, Bicep, or cloud-native infrastructure templates.</p><p>The goal is to make deployments repeatable rather than manually recreating infrastructure whenever another region is needed.</p><h3>4. Manage Infrastructure Through IaC</h3><p>Infrastructure as Code helps maintain consistency across regions.</p><p>Instead of manually configuring Kubernetes clusters, networking, and supporting services, define the infrastructure declaratively.</p><p>A simplified example of an infrastructure configuration might look like this:</p><pre>regions:<br>  - name: region-a<br>    environment: production<br>    clusterName: app-cluster-a<br>    replicas: 3</pre><pre>  - name: region-b<br>    environment: production<br>    clusterName: app-cluster-b<br>    replicas: 3</pre><pre>  - name: region-c<br>    environment: canary<br>    clusterName: app-cluster-c<br>    replicas: 1</pre><p>This is illustrative configuration rather than a directly executable Bicep or Terraform template.</p><p>The actual infrastructure provisioning can be implemented using reusable modules and region-specific parameters.</p><p>This approach helps standardize:</p><ul><li>Cluster configuration.</li><li>Network rules.</li><li>Container registries.</li><li>Identity and access management.</li><li>Secrets management.</li><li>Monitoring and logging.</li><li>Deployment configuration.</li></ul><p>The same infrastructure definitions can be reused across environments while allowing region-specific customization.</p><h3>5. Route Traffic Across Regions</h3><p>Having multiple clusters is not enough. Users must be able to reach a healthy region.</p><p>A global traffic management service can sit in front of the regional application endpoints.</p><p>For example, a cloud-based global load balancer or Azure Front Door can provide:</p><ul><li>Global request routing.</li><li>Health-based origin selection.</li><li>TLS termination.</li><li>Web Application Firewall integration.</li><li>Traffic distribution.</li><li>Regional failover.</li></ul><p>A simplified flow:</p><pre>Incoming Request<br>                    |<br>                    v<br>             Global Endpoint<br>                    |<br>             Health Evaluation<br>                    |<br>          +---------+---------+<br>          |                   |<br>          v                   v<br>       Region A            Region B<br>       Healthy             Healthy<br>          |                   |<br>          v                   v<br>      Application         Application</pre><p>If Region A becomes unhealthy, the traffic management layer can stop routing new requests there and direct traffic to Region B, subject to configured health probes and routing policies.</p><p>It is important to configure health probes carefully. A healthy load balancer endpoint does not always mean the entire application is healthy.</p><h3>6. Database Replication and Data Consistency</h3><p>The application layer is often easier to replicate than the database layer.</p><p>The database introduces important architectural decisions.</p><p>For example, consider a primary database in Region A with a secondary replica in Region B.</p><pre>Application A<br>              |<br>              v<br>        Primary Database<br>              |<br>         Replication<br>              |<br>              v<br>       Secondary Database<br>              ^<br>              |<br>        Application B</pre><p>There are different replication approaches:</p><p><strong>Synchronous replication</strong></p><p>Data is committed across multiple locations before a transaction is considered complete.</p><ul><li>Can provide stronger consistency guarantees.</li><li>May increase write latency.</li><li>Depends on the database technology and topology.</li></ul><p><strong>Asynchronous replication</strong></p><p>Changes are replicated after the primary transaction completes.</p><ul><li>Usually offers lower write latency.</li><li>Can introduce replication lag.</li><li>Some recently committed data may not be available after a sudden regional failure.</li></ul><p>For many cloud applications, asynchronous replication is a common disaster recovery approach.</p><p>However, the right choice depends on business requirements, database capabilities, and acceptable data loss.</p><h3>7. Understand RTO and RPO</h3><p>Two important disaster recovery concepts are RTO and RPO.</p><p><strong>Recovery Time Objective (RTO)</strong></p><p>How long can the application remain unavailable before recovery must be completed?</p><p><strong>Recovery Point Objective (RPO)</strong></p><p>How much data loss, measured in time, can the application tolerate?</p><p>An application with a strict RPO may require more frequent replication and stronger data protection mechanisms.</p><p>The important point is to design infrastructure around measurable recovery requirements rather than simply deploying another cluster.</p><h3>8. Automate Failover and Recovery</h3><p>A multi-region architecture should have a well-defined failover process.</p><p>A simplified failover sequence could be:</p><ol><li>Detect an outage in the primary region.</li><li>Evaluate application and infrastructure health.</li><li>Confirm the secondary region is ready.</li><li>Verify database replication and recovery state.</li><li>Promote the secondary database if required.</li><li>Update traffic routing.</li><li>Validate application functionality.</li><li>Monitor the recovered environment.</li></ol><p>Not every step should necessarily be fully automatic.</p><p>Database promotion and other state-changing operations may require safeguards to prevent split-brain scenarios, where multiple regions incorrectly accept writes.</p><p>Failover automation should account for the possibility that a health-check failure is temporary or isolated.</p><h3>9. Disaster Recovery Drills Are Essential</h3><p>A multi-region architecture is only useful if the recovery process actually works.</p><p>This is why regular disaster recovery drills are important.</p><p>Some useful scenarios to test include:</p><ul><li>Primary region becomes unavailable.</li><li>Kubernetes cluster becomes unhealthy.</li><li>Database replication falls behind.</li><li>Global traffic routing fails.</li><li>A deployment introduces an application-level issue.</li><li>A region recovers after failover.</li></ul><p>During each drill, measure:</p><ul><li>Actual recovery time.</li><li>Data consistency.</li><li>Application availability.</li><li>Traffic routing behavior.</li><li>Monitoring and alerting effectiveness.</li><li>Manual intervention required.</li></ul><p>Documenting the results helps identify gaps before a real incident occurs.</p><h3>10. Common Challenges in Multi-Region Systems</h3><p>Multi-region architecture introduces complexity that should not be underestimated.</p><p><strong>Data consistency:</strong> Replicated databases may not always contain the latest changes.</p><p><strong>Network latency:</strong> Cross-region communication can affect application performance.</p><p><strong>Configuration drift:</strong> Different infrastructure configurations can cause inconsistent behavior.</p><p><strong>Secrets and identity:</strong> Each region must securely access the resources it needs.</p><p><strong>Observability:</strong> Logs and metrics should provide visibility across all regions.</p><p><strong>Cost:</strong> Maintaining additional infrastructure increases operational expenses.</p><p>A successful multi-region design balances availability, performance, complexity, and cost.</p><h3>Conclusion</h3><p>Multi-region architecture is about more than running the same application in two geographical locations.</p><p>It requires thoughtful decisions around infrastructure independence, global traffic routing, database replication, recovery objectives, and operational readiness.</p><p>Kubernetes provides a strong foundation for deploying applications across regions, while Infrastructure as Code, global traffic management, and database disaster recovery capabilities help make the architecture resilient.</p><p>Most importantly, don’t assume that having a secondary region means you have disaster recovery.</p><p><strong>A disaster recovery strategy is only as reliable as the recovery process you have tested.</strong></p><p>Start with clear RTO and RPO requirements, automate repeatable infrastructure provisioning, and regularly test regional failover.</p><p>That’s how you move from simply deploying across regions to building systems designed to survive regional failures.</p><p><strong>How does your organization approach disaster recovery? Do you prefer active-active or active-passive architectures?</strong> Share your thoughts in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f88571b3018" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Canary Deployment Pipeline from Scratch: A Practical Guide]]></title>
            <link>https://medium.com/@prabhavmishra19/building-a-canary-deployment-pipeline-from-scratch-a-practical-guide-2f0638742fc6?source=rss-f07d3e64c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f0638742fc6</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Prabhav Mishra]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 07:29:42 GMT</pubDate>
            <atom:updated>2026-11-10T07:29:42.677Z</atom:updated>
            <content:encoded><![CDATA[<p>Deploying a new application version directly to production can be risky. Even after extensive testing, unexpected issues can appear when new code interacts with real traffic, infrastructure, or dependencies.</p><p>This is where <strong>Canary Deployments</strong> become useful.</p><p>Instead of releasing a new version to all users at once, a canary deployment introduces the new version to a smaller portion of traffic. This allows teams to validate the release under real conditions before gradually increasing exposure.</p><p>In this article, we’ll explore how to build a canary deployment pipeline using Kubernetes, Docker, Helm, and CI/CD automation.</p><h3>Where Did the Term “Canary Deployment” Come From?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*59f53JkfvxEX94UW" /></figure><p>Long before the term became part of software engineering vocabulary, a small yellow bird played an important role in coal mine safety.</p><p>During the 19th and early 20th centuries, miners carried caged canaries into underground coal mines to detect dangerous gases, particularly carbon monoxide.</p><p>Why a canary?</p><p>These birds were more sensitive to certain toxic gases than humans. If dangerous concentrations accumulated, the bird would show signs of distress before miners experienced the same effects. This served as an early warning that conditions were becoming unsafe.</p><p>The phrase “Canary in the Coal Mine” eventually became a metaphor for an early warning signal — something that detects trouble before it becomes a much bigger problem.</p><p>The idea translated remarkably well into software engineering.</p><p>Instead of releasing a new application version to every user simultaneously, engineers deploy it to a small subset of production infrastructure or users first.</p><p>That small deployment acts as the canary.</p><p>If it behaves unexpectedly — perhaps showing increased latency, elevated error rates, or resource consumption — engineers can stop the rollout before the issue affects the entire application.</p><p>If everything looks healthy, the release gradually expands to more users.</p><p>The principle remains the same:</p><p>Detect a problem early, limit its impact, and proceed only when it is safe.</p><p>Now that we understand where the name comes from, let’s see how the same early-warning principle can be implemented in a modern Kubernetes environment.</p><h3>1. What Is a Canary Deployment?</h3><p>A canary deployment is a release strategy in which a new application version is deployed alongside the existing stable version.</p><p>For example:</p><ul><li>Stable version: v1</li><li>New version: v2</li><li>Initial canary traffic: 10%</li><li>Remaining traffic: 90% to v1</li></ul><p>If the new version behaves as expected, traffic can gradually shift towards it. If problems occur, traffic can be routed back to the stable version.</p><p>The main objective is to reduce deployment risk without interrupting the existing application.</p><h3>2. Understanding the Architecture</h3><p>A typical canary deployment pipeline involves the following components:</p><ul><li><strong>CI pipeline:</strong> Builds and tests application code.</li><li><strong>Container registry:</strong> Stores versioned Docker images.</li><li><strong>Kubernetes:</strong> Runs stable and canary application versions.</li><li><strong>Helm:</strong> Manages deployment configurations.</li><li><strong>Ingress or traffic management layer:</strong> Controls traffic distribution.</li><li><strong>Monitoring:</strong> Tracks application health and performance.</li></ul><p>The deployment flow looks like this:</p><pre>Developer pushes code<br>        |<br>        v<br>   CI Pipeline<br>        |<br>        v<br> Build &amp; Test<br>        |<br>        v<br> Build Docker Image<br>        |<br>        v<br> Push Image to Registry<br>        |<br>        v<br> Deploy Canary Version<br>        |<br>        v<br> Health Checks &amp; Monitoring<br>        |<br>        v<br>   Release Decision<br>      /       \<br>     /         \<br> Success       Failure<br>   |              |<br>   v              v<br>Increase        Rollback /<br>Traffic         Keep Stable<br>   |<br>   v<br>Full Production Release</pre><h3>3. Containerize the Application</h3><p>Before deploying anything to Kubernetes, package the application into a Docker image.</p><p>Example Dockerfile:</p><pre>FROM python:3.12-slim</pre><pre>WORKDIR /app</pre><pre>COPY requirements.txt .<br>RUN pip install --no-cache-dir -r requirements.txt</pre><pre>COPY . .</pre><pre>EXPOSE 8000</pre><pre>CMD [&quot;python&quot;, &quot;manage.py&quot;, &quot;runserver&quot;, &quot;0.0.0.0:8000&quot;]</pre><p>For production applications, use a production-grade application server rather than Django’s development server.</p><p>Build and push the image:</p><pre>docker build -t myregistry/sample-api:v2 .<br>docker push myregistry/sample-api:v2</pre><p>Using versioned image tags makes it easier to identify exactly which application version is running.</p><h3>4. Deploy Stable and Canary Versions</h3><p>One approach is to maintain two Kubernetes Deployments.</p><p>The stable Deployment runs the current production version, while the canary Deployment runs the new version.</p><p><strong>stable-deployment.yaml</strong></p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: sample-api-stable<br>spec:<br>  replicas: 9<br>  selector:<br>    matchLabels:<br>      app: sample-api<br>      version: stable<br>  template:<br>    metadata:<br>      labels:<br>        app: sample-api<br>        version: stable<br>    spec:<br>      containers:<br>        - name: sample-api<br>          image: myregistry/sample-api:v1<br>          ports:<br>            - containerPort: 8000</pre><p><strong>canary-deployment.yaml</strong></p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: sample-api-canary<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: sample-api<br>      version: canary<br>  template:<br>    metadata:<br>      labels:<br>        app: sample-api<br>        version: canary<br>    spec:<br>      containers:<br>        - name: sample-api<br>          image: myregistry/sample-api:v2<br>          ports:<br>            - containerPort: 8000</pre><p>At this point, both versions are running in the cluster.</p><p>However, Kubernetes Services do not automatically provide percentage-based traffic splitting. We need a traffic management layer for that.</p><h3>5. Configure Traffic Distribution</h3><p>A common approach is to use an ingress controller or service mesh that supports weighted routing.</p><p>For example, an ingress controller with canary support can route a percentage of requests to the canary backend.</p><p>With an NGINX Ingress Controller that supports canary annotations, the configuration can look like this:</p><p><strong>Stable Ingress</strong></p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: sample-api-stable<br>spec:<br>  ingressClassName: nginx<br>  rules:<br>    - host: api.example.com<br>      http:<br>        paths:<br>          - path: /<br>            pathType: Prefix<br>            backend:<br>              service:<br>                name: sample-api-stable<br>                port:<br>                  number: 80</pre><p><strong>Canary Ingress</strong></p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: sample-api-canary<br>  annotations:<br>    nginx.ingress.kubernetes.io/canary: &quot;true&quot;<br>    nginx.ingress.kubernetes.io/canary-weight: &quot;10&quot;<br>spec:<br>  ingressClassName: nginx<br>  rules:<br>    - host: api.example.com<br>      http:<br>        paths:<br>          - path: /<br>            pathType: Prefix<br>            backend:<br>              service:<br>                name: sample-api-canary<br>                port:<br>                  number: 80</pre><p>The canary weight is set to 10, meaning approximately 10% of eligible traffic is routed to the canary backend.</p><p>The exact behavior depends on the ingress controller version and configuration. Also, percentage-based routing is not necessarily equivalent to a percentage of unique users.</p><h3>6. Automate the Deployment Pipeline</h3><p>Now comes the most important part: automation.</p><p>A CI/CD pipeline should handle the following stages:</p><ol><li>Checkout the source code.</li><li>Run unit and integration tests.</li><li>Build the Docker image.</li><li>Push the image to the container registry.</li><li>Update the canary deployment.</li><li>Run health checks.</li><li>Evaluate monitoring signals.</li><li>Increase traffic or initiate rollback.</li></ol><p>A simplified deployment script could look like this:</p><pre>#!/bin/bash</pre><pre>set -euo pipefail</pre><pre>NAMESPACE=&quot;production&quot;<br>RELEASE=&quot;sample-api&quot;<br>IMAGE_TAG=&quot;${1:?Image tag is required}&quot;</pre><pre>echo &quot;Deploying canary version: ${IMAGE_TAG}&quot;</pre><pre>helm upgrade --install &quot;${RELEASE}&quot; ./helm/sample-api \<br>  --namespace &quot;${NAMESPACE}&quot; \<br>  --set canary.enabled=true \<br>  --set canary.image.tag=&quot;${IMAGE_TAG}&quot; \<br>  --wait \<br>  --timeout 5m</pre><pre>echo &quot;Checking canary deployment health...&quot;</pre><pre>kubectl rollout status deployment/sample-api-canary \<br>  -n &quot;${NAMESPACE}&quot; \<br>  --timeout=180s</pre><pre>echo &quot;Canary deployment is ready.&quot;</pre><p>This script assumes your Helm chart contains the corresponding canary configuration and Deployment.</p><p>A complete pipeline should also perform application-level checks and evaluate metrics before allowing traffic progression.</p><h3>7. Monitor Before Increasing Traffic</h3><p>A successful Kubernetes rollout does not necessarily mean a successful application release.</p><p>The application might be running while experiencing:</p><ul><li>Increased HTTP 5xx errors.</li><li>Higher response latency.</li><li>Database connection failures.</li><li>Increased CPU or memory consumption.</li><li>Unexpected application exceptions.</li></ul><p>Useful monitoring signals include:</p><p>MetricWhat to monitorError rateHTTP 5xx responsesLatencyp95 and p99 response timesAvailabilitySuccessful request percentageCPUContainer CPU utilizationMemoryContainer memory consumptionRestartsPod restart frequency</p><p>Tools such as Prometheus and Grafana can help visualize these metrics and trigger alerts.</p><p>Only increase canary traffic when the release meets predefined health criteria.</p><h3>8. Gradually Promote or Roll Back</h3><p>A possible rollout strategy could be:</p><p>StageCanary trafficInitial release10%First validation25%Second validation50%Final validation100%</p><p>At every stage, evaluate the health of the new version.</p><p>If the canary starts returning errors or violating latency thresholds, stop the rollout and route traffic back to the stable version.</p><p>For example:</p><pre># Route traffic away from canary<br>kubectl annotate ingress sample-api-canary \<br>  nginx.ingress.kubernetes.io/canary-weight=&quot;0&quot; \<br>  --overwrite</pre><p>The exact annotation update behavior depends on your ingress controller. For a production rollback, also ensure the canary configuration and release state are handled consistently.</p><h3>9. Important Best Practices</h3><p>A few things to consider when implementing canary deployments:</p><ol><li><strong>Use immutable image tags:</strong> Avoid deploying mutable tags such as latest.</li><li><strong>Define health criteria:</strong> Decide acceptable error rates and latency before deployment.</li><li><strong>Keep database changes backward-compatible:</strong> Both application versions may run simultaneously.</li><li><strong>Use automated rollback:</strong> Avoid relying entirely on manual intervention.</li><li><strong>Monitor real application behavior:</strong> Pod readiness alone is insufficient.</li><li><strong>Test the rollback process:</strong> A rollback strategy is only useful if it works.</li><li><strong>Secure your pipeline:</strong> Use managed identities, scoped credentials, and secret management.</li></ol><h3>Conclusion</h3><p>Canary deployments provide a safer way to release application changes by gradually exposing new versions to production traffic.</p><p>Combining Kubernetes, Docker, Helm, CI/CD automation, and monitoring gives engineering teams a repeatable release process that reduces deployment risk and improves visibility.</p><p>The most important lesson is that a canary deployment is not just about deploying another version. It is about making a release decision based on actual application health.</p><p>Start with a small traffic percentage, monitor carefully, and promote only when the evidence supports it.</p><p><strong>How does your team handle production releases? Do you prefer rolling updates, blue-green deployments, or canary releases?</strong> Share your experience in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f0638742fc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Kubernetes YAML to Helm Charts: A Practical Step-by-Step Guide]]></title>
            <link>https://medium.com/@prabhavmishra19/from-kubernetes-yaml-to-helm-charts-a-practical-step-by-step-guide-f00fc5df1f04?source=rss-f07d3e64c8fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/f00fc5df1f04</guid>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[yaml]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[helm-chart]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Prabhav Mishra]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 07:20:11 GMT</pubDate>
            <atom:updated>2026-11-10T07:20:11.228Z</atom:updated>
            <content:encoded><![CDATA[<p>Kubernetes YAML manifests work well when you’re starting out. But as your application grows, maintaining separate YAML files for every environment quickly becomes difficult.</p><p>Imagine deploying the same application across Development, Staging, Production, and Canary environments. You might have nearly identical Deployment, Service, and ConfigMap files, with only a few differences in replicas, image tags, resource limits, or environment variables.</p><p>This is where <strong>Helm</strong> comes in.</p><p>Helm helps you package Kubernetes manifests into reusable, configurable templates. Instead of maintaining multiple copies of YAML files, you maintain one Helm chart and customize it using values.</p><p>In this article, we’ll convert a basic Kubernetes application into a reusable Helm chart, step by step.</p><h3>1. Starting with a Kubernetes Deployment</h3><p>Let’s begin with a standard Kubernetes Deployment.</p><p>Create a file named deployment.yaml:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: sample-api<br>  labels:<br>    app: sample-api<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: sample-api<br>  template:<br>    metadata:<br>      labels:<br>        app: sample-api<br>    spec:<br>      containers:<br>        - name: sample-api<br>          image: nginx:1.25<br>          ports:<br>            - containerPort: 80<br>          resources:<br>            requests:<br>              cpu: &quot;100m&quot;<br>              memory: &quot;128Mi&quot;<br>            limits:<br>              cpu: &quot;500m&quot;<br>              memory: &quot;512Mi&quot;</pre><p>This works perfectly well for a single environment.</p><p>However, what happens when Production needs four replicas, Staging needs two, and Canary needs just one?</p><p>You could maintain three separate YAML files, but that introduces duplication and makes future changes harder to manage.</p><p>Let’s solve that using Helm.</p><h3>2. Create a Helm Chart</h3><p>First, make sure Helm is installed.</p><pre>helm version</pre><p>Create a new chart:</p><pre>helm create sample-api</pre><p>Helm generates a directory structure similar to this:</p><pre>sample-api/<br>├── Chart.yaml<br>├── values.yaml<br>├── charts/<br>└── templates/<br>    ├── deployment.yaml<br>    ├── service.yaml<br>    ├── ingress.yaml<br>    ├── hpa.yaml<br>    ├── serviceaccount.yaml<br>    └── _helpers.tpl</pre><p>For this example, we’ll focus on three files:</p><ul><li>Chart.yaml — chart metadata.</li><li>values.yaml — environment-specific configuration.</li><li>templates/ — reusable Kubernetes manifests.</li></ul><p>You can remove the generated templates you don’t need, or retain them if your application requires them.</p><h3>3. Move Configuration into values.yaml</h3><p>The first step in converting YAML into Helm is identifying which values might change between environments.</p><p>Create or update values.yaml:</p><pre>replicaCount: 2</pre><pre>image:<br>  repository: nginx<br>  tag: &quot;1.25&quot;<br>  pullPolicy: IfNotPresent</pre><pre>service:<br>  type: ClusterIP<br>  port: 80<br>  targetPort: 80</pre><pre>resources:<br>  requests:<br>    cpu: &quot;100m&quot;<br>    memory: &quot;128Mi&quot;<br>  limits:<br>    cpu: &quot;500m&quot;<br>    memory: &quot;512Mi&quot;</pre><p>The idea is simple:</p><p><strong>Static Kubernetes structure stays in templates, while configurable values move into values.yaml.</strong></p><p>This separation makes the chart reusable across multiple environments.</p><h3>4. Convert deployment.yaml into a Helm Template</h3><p>Now let’s create templates/deployment.yaml.</p><p>Notice how hardcoded values are replaced with Helm template expressions.</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: {{ .Release.Name }}<br>  labels:<br>    app: {{ .Release.Name }}<br>spec:<br>  replicas: {{ .Values.replicaCount }}<br>  selector:<br>    matchLabels:<br>      app: {{ .Release.Name }}<br>  template:<br>    metadata:<br>      labels:<br>        app: {{ .Release.Name }}<br>    spec:<br>      containers:<br>        - name: {{ .Release.Name }}<br>          image: &quot;{{ .Values.image.repository }}:{{ .Values.image.tag }}&quot;<br>          imagePullPolicy: {{ .Values.image.pullPolicy }}<br>          ports:<br>            - containerPort: {{ .Values.service.targetPort }}<br>          resources:<br>            {{- toYaml .Values.resources | nindent 12 }}</pre><p>Let’s understand the important Helm expressions:</p><p>ExpressionPurpose.Release.NameName assigned to the Helm release.Values.replicaCountReads replica count from values.yaml.Values.image.repositoryReads the container image repositorytoYamlConverts a value into YAML formatnindent 12Adds a newline and indents content by 12 spaces</p><p>One particularly useful function is:</p><pre>{{- toYaml .Values.resources | nindent 12 }}</pre><p>It allows us to pass an entire nested YAML object into a Kubernetes manifest without manually writing every field as a separate template expression.</p><h3>5. Convert the Kubernetes Service</h3><p>Next, create templates/service.yaml:</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: {{ .Release.Name }}<br>spec:<br>  type: {{ .Values.service.type }}<br>  selector:<br>    app: {{ .Release.Name }}<br>  ports:<br>    - protocol: TCP<br>      port: {{ .Values.service.port }}<br>      targetPort: {{ .Values.service.targetPort }}</pre><p>Now both the Deployment and Service are configurable through the same values file.</p><h3>6. Configure Different Environments</h3><p>This is where Helm becomes especially useful.</p><p>Instead of maintaining separate Kubernetes manifests, create separate values files.</p><p><strong>values-dev.yaml</strong></p><pre>replicaCount: 1</pre><pre>image:<br>  tag: &quot;1.25&quot;</pre><pre>service:<br>  type: ClusterIP</pre><pre>resources:<br>  requests:<br>    cpu: &quot;50m&quot;<br>    memory: &quot;64Mi&quot;<br>  limits:<br>    cpu: &quot;200m&quot;<br>    memory: &quot;256Mi&quot;</pre><p><strong>values-prod.yaml</strong></p><pre>replicaCount: 4</pre><pre>image:<br>  tag: &quot;1.25&quot;</pre><pre>service:<br>  type: ClusterIP</pre><pre>resources:<br>  requests:<br>    cpu: &quot;200m&quot;<br>    memory: &quot;256Mi&quot;<br>  limits:<br>    cpu: &quot;1000m&quot;<br>    memory: &quot;1Gi&quot;</pre><p>The templates remain unchanged. Only the configuration differs.</p><p>You can deploy the same chart into different environments using:</p><pre># Development<br>helm upgrade --install sample-api ./sample-api \<br>  -f ./sample-api/values-dev.yaml</pre><pre># Production<br>helm upgrade --install sample-api ./sample-api \<br>  -f ./sample-api/values-prod.yaml</pre><p>This gives you a consistent deployment structure while allowing environment-specific customization.</p><h3>7. Validate Before Deploying</h3><p>One of the biggest advantages of Helm is that you can inspect the generated Kubernetes YAML before applying it to a cluster.</p><p><strong>Step 1: Lint the chart</strong></p><pre>helm lint ./sample-api</pre><p>This checks the chart for common issues.</p><p><strong>Step 2: Render the templates</strong></p><pre>helm template sample-api ./sample-api \<br>  -f ./sample-api/values-prod.yaml</pre><p>This generates the final Kubernetes manifests locally without deploying anything.</p><p><strong>Step 3: Validate against the Kubernetes API</strong></p><pre>helm upgrade --install sample-api ./sample-api \<br>  -f ./sample-api/values-prod.yaml \<br>  --dry-run=server</pre><p>This performs a server-side dry run against the cluster, subject to the cluster and resource configuration.</p><p><strong>Step 4: Deploy</strong></p><pre>helm upgrade --install sample-api ./sample-api \<br>  -f ./sample-api/values-prod.yaml</pre><p>You now have a reusable Helm-based deployment.</p><h3>8. A Few Best Practices</h3><p>When building Helm charts for real-world applications, keep these points in mind:</p><ol><li><strong>Avoid hardcoding environment-specific values.</strong> Keep replica counts, image tags, resource limits, and other configurable settings in values files.</li><li><strong>Use meaningful defaults.</strong> Your default values.yaml should represent a sensible baseline configuration.</li><li><strong>Use named templates.</strong> Put reusable naming and labeling logic in _helpers.tpl.</li><li><strong>Keep secrets out of values files.</strong> Use Kubernetes Secrets and an appropriate external secret-management solution.</li><li><strong>Validate before deployment.</strong> Run helm lint and render templates before deploying.</li><li><strong>Version your charts.</strong> Update the chart version when making chart-level changes.</li><li><strong>Keep charts environment-agnostic.</strong> Avoid creating separate charts for every environment unless their deployment requirements genuinely differ.</li></ol><h3>Conclusion</h3><p>Moving from raw Kubernetes YAML to Helm charts is more than a change in syntax. It introduces a cleaner way to manage configuration, reduce duplication, and standardize deployments across environments.</p><p>The real benefit becomes clear when you’re managing multiple services and environments. A single reusable chart can replace several nearly identical YAML files, making deployments easier to maintain and changes easier to review.</p><p>Start small: take an existing Deployment and Service, extract their configurable fields into values.yaml, and convert the manifests into templates.</p><p>That’s your first step toward managing Kubernetes deployments more efficiently.</p><p><strong>Have you migrated your Kubernetes deployments to Helm?</strong> Share your approach, challenges, or useful Helm tips in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f00fc5df1f04" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>