<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: upendragurugubelli</title>
    <description>The latest articles on DEV Community by upendragurugubelli (@mrupguru).</description>
    <link>https://dev.to/mrupguru</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3202082%2F94aa47e7-ea6a-4411-b4a9-6c9450d4557a.jpeg</url>
      <title>DEV Community: upendragurugubelli</title>
      <link>https://dev.to/mrupguru</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mrupguru"/>
    <language>en</language>
    <item>
      <title>Migrating from Ingress to Gateway API: Lessons from the Trenches</title>
      <dc:creator>upendragurugubelli</dc:creator>
      <pubDate>Sat, 07 Jun 2025 04:59:58 +0000</pubDate>
      <link>https://dev.to/mrupguru/migrating-from-ingress-to-gateway-api-lessons-from-the-trenches-4mnl</link>
      <guid>https://dev.to/mrupguru/migrating-from-ingress-to-gateway-api-lessons-from-the-trenches-4mnl</guid>
      <description>&lt;p&gt;Recently, I carried out a migration from Kubernetes Ingress to Gateway API for one of our production workloads. This post is a distilled summary of the lessons learned, the approach taken, and key insights you might find helpful if you’re considering or planning a similar transition.&lt;/p&gt;

&lt;p&gt;The Kubernetes Gateway API is not just an incremental improvement over Ingress. It’s a rethinking of how routing and traffic control should work in modern, scalable Kubernetes environments. It introduces a more expressive and extensible model, enabling:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Separation of concerns: Decouple infrastructure and application layer routing more cleanly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Rich routing capabilities: HTTP routing, header matching, path rewriting, traffic splitting, and more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Better role-based access control: Via resource boundaries between Gateway, GatewayClass, and HTTPRoute.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Future-ready extensibility: Designed to support gRPC, mesh-style routing, and more advanced features.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why We Decided to Migrate?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;While Ingress has served us well, we started facing challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Tight coupling of routing rules and infrastructure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Difficulty in managing multi-tenant workloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Need for more granular routing policies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Preparing our infrastructure for future scalability and extensibility.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Kubernetes community is also gradually pushing Gateway API as the eventual successor to Ingress, making this a good time to get ahead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Planning the Migration: What to Consider&lt;/strong&gt;&lt;br&gt;
Before jumping into resource definitions, it's crucial to answer the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Are your current ingress controllers supported by Gateway API? &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Will you replace Ingress or run both during transition?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are there any custom annotations, backendConfigs, or load balancer features your current setup depends on?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How is your DNS managed?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What certificate management approach are you using pre-shared certs, cert-manager, or cloud provider-managed certs?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We decided on a one-time conversion for our primary ingress resources, and then gradually onboarded other services to Gateway API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tools That Helped&lt;/strong&gt;&lt;br&gt;
For bootstrapping new Gateway API resources from existing Ingress configurations, can use:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gateway-api.sigs.k8s.io/guides/migrating-from-ingress/#migrating-from-ingress" rel="noopener noreferrer"&gt;migrating from-ingress&lt;/a&gt; guide is really a good place to start with.&lt;/p&gt;

&lt;p&gt;🔧 &lt;a href="https://github.com/kubernetes-sigs/ingress2gateway" rel="noopener noreferrer"&gt;ingress2gateway&lt;/a&gt;  a CLI tool that helps convert Ingress resources into Gateway API format.&lt;/p&gt;

&lt;p&gt;⚠️ Note: It currently only supports the ingress-nginx provider, so it’s not a universal solution but very handy as a starting point.&lt;/p&gt;

&lt;p&gt;🔧 Architecture Comparison&lt;br&gt;
Before (Ingress-Based)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[External LB] --&amp;gt; [Ingress Controller] --&amp;gt; [Service] --&amp;gt; [Pods]
           |                            |
        [DNS A Record]             [BackendConfig]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After (Gateway API-Based)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[External LB] --&amp;gt; [Gateway] --&amp;gt; [HTTPRoute] --&amp;gt; [Service] --&amp;gt; [Pods]
           |                                 |
        [DNS A Record]             [Certificate Mgmt]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Real-World Example: Migrating an External Ingress&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Original Setup&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Ingress: Exposed via external load balancer&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS: A record pointing to the Ingress IP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;BackendConfig: Defined for Cloud Armor or timeouts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Service: Type NodePort or ClusterIP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment/Pod: Backend app running on port 8080&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Migration Process&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Create a GatewayClass:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: external-gateway
spec:
  controllerName: k8s.io/gateway-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Define a Gateway:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: my-gateway
  namespace: default
spec:
  gatewayClassName: external-gateway
  listeners:
  - name: http
    port: 80
    protocol: HTTP
    hostname: "example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Replace Ingress with HTTPRoute:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: my-app-route
  namespace: default
spec:
  parentRefs:
  - name: my-gateway
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: "/"
    backendRefs:
    - name: my-service
      port: 8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;DNS Consideration: If your Gateway exposes a new load balancer IP, update the A record in DNS to point to the new IP.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Certificates: You can now move toward managed certificates using cert-manager or your cloud provider-managed certs via Gateway annotations or controller-specific config.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can as well create a BackendConfig, Gateway policy for SSL, healthcheckpolicy etc as per required configuration.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Challenges Faced&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Some annotations from Ingress didn’t map 1:1 (e.g., &lt;code&gt;backendConfig.cloud.google.com&lt;/code&gt;) — needed equivalent Gateway API controller support.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DNS propagation during switch can cause short-term disruption if not carefully planned. Consider updating ttl accordingly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ingress2gateway&lt;/code&gt; tool required post-editing of YAML to match specific load balancer or controller nuances.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Migrating from &lt;code&gt;Ingress&lt;/code&gt; to &lt;code&gt;Gateway API&lt;/code&gt; is more than just replacing YAML manifests. It’s about rethinking how your applications are exposed, routed, and secured. While it requires upfront effort, the long-term benefits in maintainability and scalability are worth it.&lt;/p&gt;

&lt;p&gt;If you're working with a supported provider like &lt;code&gt;ingress-nginx&lt;/code&gt;, tooling like &lt;code&gt;ingress2gateway&lt;/code&gt; can help kickstart your journey.&lt;/p&gt;

&lt;p&gt;🔑 Key Takeaways&lt;br&gt;
✅ Gateway API enables better separation of concerns and more robust routing policies.&lt;/p&gt;

&lt;p&gt;🔍 Analyze current Ingress dependencies (certs, annotations, configs) before migrating.&lt;/p&gt;

&lt;p&gt;🛠 Use &lt;code&gt;ingress2gateway&lt;/code&gt; as a scaffold, not a final product.&lt;/p&gt;

&lt;p&gt;🌐 Don’t forget DNS! Plan your switch carefully.&lt;/p&gt;

&lt;p&gt;📈 Gateway API is future-forward, migrating early positions your infrastructure for what's coming next.&lt;/p&gt;

&lt;p&gt;📬 Got questions or want to share your migration experience? Drop a comment or reach out. Let’s grow together!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
