<?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: kelvin manavar</title>
    <description>The latest articles on DEV Community by kelvin manavar (@kelvinmanavar).</description>
    <link>https://dev.to/kelvinmanavar</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%2F3456320%2F19e15437-6463-4222-b586-da5e6e977d35.png</url>
      <title>DEV Community: kelvin manavar</title>
      <link>https://dev.to/kelvinmanavar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kelvinmanavar"/>
    <language>en</language>
    <item>
      <title>Crafting the Perfect Golden AMI for Auto Scaling Groups in AWS</title>
      <dc:creator>kelvin manavar</dc:creator>
      <pubDate>Mon, 22 Sep 2025 17:54:43 +0000</pubDate>
      <link>https://dev.to/kelvinmanavar/crafting-the-perfect-golden-ami-for-auto-scaling-groups-in-aws-22gk</link>
      <guid>https://dev.to/kelvinmanavar/crafting-the-perfect-golden-ami-for-auto-scaling-groups-in-aws-22gk</guid>
      <description>&lt;p&gt;If you’ve ever worked with Auto Scaling Groups (ASGs) in AWS, you know the magic they bring, instances that launch, heal, and scale automatically based on demand. But here’s the catch: the speed and reliability of your scaling process often depends on the quality of the AMI (Amazon Machine Image) behind it.&lt;/p&gt;

&lt;p&gt;This is where golden AMIs prove their value: reliable, pre-configured images built for production. Instead of launching a raw instance and installing everything on the fly, you spin up servers that are already dressed, polished, and ready to serve traffic.&lt;/p&gt;

&lt;p&gt;So, how do you create one that truly deserves to be called golden? Let’s break it down.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the OS Base Image 🖥️
&lt;/h2&gt;

&lt;p&gt;The foundation matters. Choose a lightweight, secure, and well-supported base image - Amazon Linux 2, Ubuntu LTS, or RHEL are the usually chosen. Keep it patched to the latest updates before you bake your own version. No one wants to scale vulnerable servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Package &amp;amp; Dependency Installation 📦
&lt;/h2&gt;

&lt;p&gt;What goes into the image depends on your philosophy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Pre-install required software and configure (e.g., Nginx or Apache, PHP, Node.js, python, Java, etc.).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install monitoring/logging agents (e.g., CloudWatch agent, SSM agent, AWS CodeDeploy agent).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install AWS CLI&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Application Code / Artifacts 👨‍💻
&lt;/h2&gt;

&lt;p&gt;Decide whether to bake the application inside the AMI or fetch it dynamically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Immutable pattern: Bake application code + dependencies in AMI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mutable pattern: Use UserData or CodeDeploy to pull the latest version during launch.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security Hardening and Clean Up 🔐
&lt;/h2&gt;

&lt;p&gt;Security isn’t optional. Before you turn an instance into an AMI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disable root SSH login.&lt;/li&gt;
&lt;li&gt;Remove unnecessary users and packages.&lt;/li&gt;
&lt;li&gt;Configure proper firewall rules (if required).&lt;/li&gt;
&lt;li&gt;Apply CIS/benchmark hardening (if compliance required).&lt;/li&gt;
&lt;li&gt;Clear out temporary files and old logs.&lt;/li&gt;
&lt;li&gt;Remove existing SSH host keys (/etc/ssh/ssh_host_*) to avoid duplicate keys. This ensures that each instance feels unique, not a clone with security baggage.&lt;/li&gt;
&lt;li&gt;Use cloud-init or systemd to generate new keys at boot.&lt;/li&gt;
&lt;li&gt;Ensure the EC2 instance connect / key-pair login works as expected.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Cleanup before AMI bake
sudo rm -f /etc/ssh/ssh_host_*
# Clean apt cache
sudo apt clean
sudo rm -rf /var/lib/apt/lists/*
# Clear bash history
history -c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Don’t Forget Cloud-Init 🧠
&lt;/h2&gt;

&lt;p&gt;There are two ways to use below script to make sure that unique SSH host keys generated for every new instance.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;When launching the EC2 via AWS Console put cloud-init script in to User data.&lt;/li&gt;
&lt;li&gt;While working with auto scaling group setup we can specify script at user data when we create Launch Template (LT) or Launch Configuration (LC) for the ASG.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#cloud-config
ssh_deletekeys: true
ssh_genkeytypes:
  - rsa
  - ecdsa
  - ed25519
runcmd:
  - systemctl restart ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: If we remove existing SSH host keys then we must use cloud-init script otherwise we can not ssh in to new EC2 instances .&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Performance Tuning 🛠️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Set tuned profiles or sysctl optimizations (if required).&lt;/li&gt;
&lt;li&gt;Configure web/app server settings (PHP-FPM, Nginx, JVM heap, etc.).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Validation 🕵️
&lt;/h2&gt;

&lt;p&gt;Never trust an untested image. Launch an instance from your new AMI and run through a checklist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure SSH/SSM works.&lt;/li&gt;
&lt;li&gt;Ensure all services start automatically.&lt;/li&gt;
&lt;li&gt;Ensure app/agents start correctly.&lt;/li&gt;
&lt;li&gt;Ensure monitoring agent reporting data.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Only after passing these checks should you bless it as “golden.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Final Thoughts 🎯
&lt;/h2&gt;

&lt;p&gt;Golden AMIs might take a little extra effort to set up, but the payoff is huge. With a well-crafted image, your Auto Scaling Groups can launch faster, stay consistent, and reduce the risk of last-minute surprises during traffic spikes. Instead of wasting time configuring servers on the fly, you’re giving your infrastructure a head start with an image that’s already secure, patched, and production-ready.&lt;/p&gt;

&lt;p&gt;In short, a solid golden AMI isn’t just a convenience, it’s the foundation of reliable, scalable infrastructure on AWS. Build it once, test it well, and let your Auto Scaling Groups do the rest.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Packer or AWS Image Builder to automate AMI creation. It makes your images reproducible and reduces human error.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>aws</category>
      <category>devops</category>
      <category>cloud</category>
      <category>devsecops</category>
    </item>
    <item>
      <title>Migrating from Kubernetes Ingress to Gateway API: A Step-by-Step Guide</title>
      <dc:creator>kelvin manavar</dc:creator>
      <pubDate>Sun, 07 Sep 2025 04:15:53 +0000</pubDate>
      <link>https://dev.to/kelvinmanavar/migrating-from-kubernetes-ingress-to-gateway-api-a-step-by-step-guide-5bhi</link>
      <guid>https://dev.to/kelvinmanavar/migrating-from-kubernetes-ingress-to-gateway-api-a-step-by-step-guide-5bhi</guid>
      <description>&lt;p&gt;In Kubernetes, one of the most critical tasks is managing how services inside the cluster are exposed to the outside world. For a long time, the Ingress API has been the standard way to handle HTTP(S) traffic, acting as the gateway that routes requests from external clients to the right services within the cluster. While Ingress has served its purpose well, it comes with limitations—particularly around extensibility, consistency across implementations, and support for advanced traffic management scenarios.&lt;/p&gt;

&lt;p&gt;To address these gaps, Kubernetes introduced the Gateway API, a next-generation alternative to Ingress. Unlike Ingress, which primarily focuses on simple routing, the Gateway API provides a richer, role-oriented model. It is designed to be more expressive, flexible, and vendor-neutral, making it easier to define complex networking behaviors while maintaining a consistent user experience across different environments.&lt;/p&gt;

&lt;p&gt;If your organization is currently relying on Ingress and considering a migration to the Gateway API, this guide will walk you through the process. We’ll explore why the Gateway API is worth adopting, what changes you need to be aware of, and the practical steps to migrate from your existing Ingress setup to the modern Gateway API within a running Kubernetes cluster.&lt;br&gt;
To explore the reasons for migration, follow this link:&lt;br&gt;
&lt;a href="https://dev.to/kelvinmanavar/gateway-api-the-future-of-kubernetes-networking-successor-to-the-ingress-api-5hjn"&gt;Link&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Challenges in Migrating to Gateway API 🔥
&lt;/h2&gt;

&lt;p&gt;Although the Gateway API brings powerful improvements over Ingress, transitioning to it is not always straightforward. Organizations should be prepared for the following challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Controller Support&lt;/strong&gt; – Not all Ingress controllers have full Gateway API compatibility yet. This can limit features or require choosing a new controller that natively supports Gateway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learning Curve&lt;/strong&gt; – Gateway introduces new resources (Gateways, Routes, Policies) and a role-based design. Teams need time and training to adapt their workflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Feature Gaps&lt;/strong&gt; – While Gateway API is more expressive, certain advanced use cases may still depend on vendor-specific extensions, reducing portability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Operational Overhead&lt;/strong&gt; – During migration, you may need to run both Ingress and Gateway in parallel, which increases configuration complexity and resource consumption.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Best Practices for Migrating to Gateway API 🌟
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start Small&lt;/strong&gt; – Begin with non-critical services to test the migration workflow. This allows your team to build confidence, refine processes, and uncover challenges before moving mission-critical applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Leverage Role Separation&lt;/strong&gt; – One of Gateway API’s strengths is its role-based design. Clearly define ownership: infrastructure teams can manage Gateways, while application developers focus on Routes. This separation improves security, scalability, and team efficiency.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adopt GitOps Practices&lt;/strong&gt; – Store Gateway and Route configurations in version control systems like Git. This enables collaboration, auditability, and quick rollbacks if issues arise during migration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor and Observe&lt;/strong&gt; – Use logging, tracing, and monitoring tools to validate routing behavior, ensure performance, and detect anomalies early.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay updated&lt;/strong&gt; – The Gateway API continues to evolve, with features like mTLS, gRPC routing, and traffic splitting being standardized. Keeping up-to-date helps your organization take advantage of new capabilities as they become stable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Migration Strategy: Moving from Ingress to Gateway API 🎯
&lt;/h2&gt;

&lt;p&gt;Migrating from Ingress to Gateway API requires planning, testing, and phased adoption. Below are the recommended steps.&lt;/p&gt;
&lt;h3&gt;
  
  
  Research &amp;amp; Planning:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Check your current setup: Collect details about existing Ingress objects, controllers, hosts, paths, TLS configurations, annotations, and backend services.
&lt;code&gt;kubectl get ingress -A -o yaml &amp;gt; all-ingresses.yaml
&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select a compatible Gateway controller: The Gateway API is only a specification. you’ll need an implementation. Examples include:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;NGINX ➡︎ NGINX Gateway Fabric&lt;/li&gt;
&lt;li&gt;Traefik ➡︎ Traefik Proxy with Gateway API&lt;/li&gt;
&lt;li&gt;HAProxy ➡︎ HAProxy kubernetes Ingress Controller with Gateway API&lt;/li&gt;
&lt;li&gt;Istio ➡︎ Istio Gateway API&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Map Ingress to Gateway API
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;IngressClass ➡︎ GatewayClass&lt;/li&gt;
&lt;li&gt;Ingress ➡︎ Gateway + HTTPRoute&lt;/li&gt;
&lt;li&gt;Review RBAC changes, as Gateway API introduces more granular access control.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Proof of Concept
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Deploy Gateway API resources in a non-production namespace.&lt;/li&gt;
&lt;li&gt;Validate routing, TLS, and service connectivity before rolling out further.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Run Both resources in Parallel
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Keep Ingress for production traffic.&lt;/li&gt;
&lt;li&gt;Deploy equivalent Gateway + HTTPRoute resources in parallel.&lt;/li&gt;
&lt;li&gt;Use staging domains (e.g.,myapp.example.com) to validate behavior.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Migrate TLS
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Unlike Ingress (which often uses annotations), Gateway API treats TLS as a first-class citizen.&lt;/li&gt;
&lt;li&gt;Create TLS secrets and reference them in Gateway listeners.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Handle Vendor-Specific Annotations
&lt;/h3&gt;

&lt;p&gt;Ingress often relies on annotations like nginx.ingress.kubernetes.io/rewrite-target. In Gateway API, these are replaced with native fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Header matching ➡︎ matches.headers&lt;/li&gt;
&lt;li&gt;Path rewriting ➡︎ filters.requestRedirect, filters.urlRewrite&lt;/li&gt;
&lt;li&gt;Traffic splitting ➡︎ backendRefs.weight
&lt;strong&gt;Example:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rules:
- backendRefs:
  - name: v1-service
    port: 80
    weight: 80
  - name: v2-service
    port: 80
    weight: 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Shift Production Traffic
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Update DNS to point to the Gateway load balancer.&lt;/li&gt;
&lt;li&gt;Monitor traffic using logs and metrics.&lt;/li&gt;
&lt;li&gt;Roll back to Ingress if needed (since it still runs in parallel).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Decommission Ingress
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Remove old Ingress objects.&lt;/li&gt;
&lt;li&gt;Uninstall the Ingress controller.&lt;/li&gt;
&lt;li&gt;Retain Gateway API resources as the single source of truth for service networking.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fymw9mpfzrqu59iuh6hlz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fymw9mpfzrqu59iuh6hlz.png" alt="difference in between Ingress API and Gateway API" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Migrating an existing Kubernetes Ingress resource to the Gateway API
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Prerequisites ⚙️
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A running Kubernetes cluster(1.24+) having deployment, services, pods running with ingress resource.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Step 1: Install Gateway API Resources
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Install Gateway API resources
kubectl kustomize "https://github.com/nginx/nginx-gateway-fabric/config/crd/gateway-api/standard?ref=v1.5.1" | kubectl apply -f -

# Verify installation
kubectl get crd | grep gateway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 2: Configure NGINX Gateway Fabric
&lt;/h3&gt;

&lt;p&gt;We'll install NGINX Gateway Fabric as our Gateway API controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Deploy NGINX Gateway Fabric CRDs
kubectl apply -f https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/v1.6.1/deploy/crds.yaml

# Deploys NGINX Gateway Fabric with NGINX OSS using a Service type of NodePort
kubectl apply -f https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/v1.6.1/deploy/nodeport/deploy.yaml

# Verify the deployment
kubectl get pods -n nginx-gateway
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's configure specific ports for the gateway service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# View the nginx-gateway service
kubectl get svc -n nginx-gateway nginx-gateway -o yaml

# Update the service to expose specific nodePort values
kubectl patch svc nginx-gateway -n nginx-gateway --type='json' -p='[
  {"op": "replace", "path": "/spec/ports/0/nodePort", "value": 30080},
  {"op": "replace", "path": "/spec/ports/1/nodePort", "value": 30081}
]'

# Verify the service has been updated
kubectl get svc -n nginx-gateway nginx-gateway

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Create GatewayClass and Gateway Resources
&lt;/h3&gt;

&lt;p&gt;let's create the GatewayClass and Gateway resources. Save the following YAML to a file named gateway-resources.yaml:&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: nginx
spec:
  controllerName: gateway.nginx.org/nginx-gateway-controller

---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: nginx-gateway
  namespace: nginx-gateway
spec:
  gatewayClassName: nginx # Use the gateway class that matches your controller
  listeners:
  - name: https
    port: 443
    protocol: HTTPS
    hostname: myweb.k8s.local
    tls:
      mode: Terminate
      certificateRefs:
      - kind: Secret
        name: web-tls-secret
        namespace: web-app
    allowedRoutes:
      namespaces:
        from: All
  - name: http
    port: 80
    protocol: HTTP
    hostname: myweb.k8s.local
    allowedRoutes:
      namespaces:
        from: All

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: here, in above code we have used “web-tls-secret”. Which is already being used by Ingress resource.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Apply the YAML: 
kubectl apply -f gateway-resources.yaml
# Verify the Gateway resource
kubectl get gateway -n nginx-gateway

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: Create the HTTPRoute Resource
&lt;/h3&gt;

&lt;p&gt;Create YAML file for HTTPRoute for http with name http.yaml.&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: web-route
  namespace: web-app
spec:
  parentRefs:
  - name: nginx-gateway
    kind: Gateway
    namespace: nginx-gateway
    sectionName: http
  hostnames:
  - myweb.k8s.local
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: web-service
      port: 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create YAML file for HTTPRoute for https with name https.yaml.&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: web-route-https
  namespace: web-app
spec:
  parentRefs:
  - name: nginx-gateway
    kind: Gateway
    namespace: nginx-gateway
    sectionName: https
  hostnames:
  - myweb.k8s.local
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: web-service
      port: 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Here, we have choose namespace=web-app at metadata of resource which is same as Deployment resource namespace.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Apply the resource YAML:
kubectl apply -f http.yaml
kubectl apply -f https.yaml

# Verify the HTTPRoute resources
kubectl get httproute -n web-app

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5: Verify the Gateway API Configuration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Check the Gateway status
kubectl describe gateway nginx-gateway -n web-app

# Check the HTTPRoute status
kubectl describe httproute web-route -n web-app

# Check if the HTTPRoute is properly bound to the Gateway
kubectl get httproute web-route -n web-app -o jsonpath='{.status.parents[0].conditions[?(@.type=="Accepted")].status}'
kubectl get httproute web-route-https -n web-app -o jsonpath='{.status.parents[0].conditions[?(@.type=="Accepted")].status}'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The output for the last command should be "True" if the HTTPRoute is properly accepted by the Gateway.&lt;br&gt;
Note: If you are facing error with the listener, make sure that secret was created in the same namespace as gateway, if not, create the below reference grant.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat &amp;lt;&amp;lt;EOF | kubectl apply -f -
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: allow-gateway-to-web-app-secrets
  namespace: web-app 
spec:
  from:
  - group: gateway.networking.k8s.io
    kind: Gateway
    namespace: nginx-gateway 
  to:
  - group: "" 
    kind: Secret
    name: web-tls-secret
EOF

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 6: Test the Gateway API Configuration
&lt;/h3&gt;

&lt;p&gt;Now, we are testing to see that application is accessible through the new Gateway API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Test the / endpoint
curl -v -H "Host: myweb.k8s.local" http://$NODE_IP:30080/

# Add the entry in /etc/hosts
# ${NODE_IP}   myweb.k8s.local

# Test the / endpoint
curl -v -k https://myweb.k8s.local:30081/

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 7: After successful Verification Remove the Old Ingress Resource
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get ingress -A
kubectl delete ingress &amp;lt;ingress-name&amp;gt; -n web-app

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Final Thoughts 📝
&lt;/h2&gt;

&lt;p&gt;Migrating from Ingress to Gateway API isn’t just about swapping tools. it’s about future-proofing your Kubernetes platform. With clearer roles, richer features, and fewer vendor lock-ins, Gateway API helps teams collaborate better while handling complex networking with ease. Start small, experiment, and scale gradually. Each step moves you closer to a more reliable, flexible, and modern foundation for your applications and the teams that build them.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>cloudnative</category>
      <category>aws</category>
    </item>
    <item>
      <title>Gateway API: The Future of Kubernetes Networking &amp; Successor to the Ingress API</title>
      <dc:creator>kelvin manavar</dc:creator>
      <pubDate>Tue, 26 Aug 2025 11:49:21 +0000</pubDate>
      <link>https://dev.to/kelvinmanavar/gateway-api-the-future-of-kubernetes-networking-successor-to-the-ingress-api-5hjn</link>
      <guid>https://dev.to/kelvinmanavar/gateway-api-the-future-of-kubernetes-networking-successor-to-the-ingress-api-5hjn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When we talk about Kubernetes networking, one of the first things that comes up is Ingress. It’s been the go-to way of exposing applications to the outside world for years. But if you’ve worked with it, you already know the pain points: Ingress mostly focuses on HTTP/S traffic, behaves differently depending on which controller you use, and quickly becomes limiting when you need advanced routing, multi-tenancy, or protocols beyond HTTP.&lt;/p&gt;

&lt;p&gt;This is exactly where the Gateway API steps in. Think of it as the next generation of Kubernetes networking—built to be more flexible, more consistent across implementations, and friendlier for different teams to collaborate on. It supports not just HTTP but also TCP, TLS, and gRPC, while giving you cleaner ways to manage policies and traffic routing at scale.&lt;/p&gt;

&lt;p&gt;Gateway API aims to solve the issues we face with ingress&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the Gateway API?
&lt;/h2&gt;

&lt;p&gt;The Gateway API is a set of Kubernetes resources that bring more power and flexibility to how we manage networking. Instead of relying on rigid configurations, it allows you to dynamically provision infrastructure and set up advanced traffic routing in a clean, consistent way.&lt;/p&gt;

&lt;p&gt;What makes it stand out is its design: it’s extensible, so it can grow with your needs; role-oriented, so different teams (like platform engineers, infra teams, and app developers) can manage their parts without conflict; and protocol-aware, meaning it works seamlessly across HTTP, TCP, TLS, gRPC, and beyond.&lt;br&gt;
In short, Gateway API makes exposing and managing network services in Kubernetes smarter, more flexible, and ready for modern workloads.&lt;/p&gt;
&lt;h2&gt;
  
  
  Gateway API design concepts
&lt;/h2&gt;

&lt;p&gt;The Gateway API was built with a few guiding principles that shape how it works and why it’s more powerful than Ingress:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Role-oriented Design:&lt;/strong&gt; Gateway API kinds are modeled after organizational roles that are responsible for managing Kubernetes service networking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Infrastructure Provider: Manages infrastructure that allows multiple isolated clusters to serve multiple tenants, e.g. a cloud provider.&lt;/li&gt;
&lt;li&gt;Cluster Operator: Manages clusters and is typically concerned with policies, network access, application permissions, etc. &lt;/li&gt;
&lt;li&gt;Application Developer: Manages an application running in a cluster and is typically concerned with application-level configuration and service composition.
&lt;strong&gt;Portable:&lt;/strong&gt; Gateway API resources are Kubernetes custom resources (CRDs), and they work consistently across different implementations, so you’re not locked into a single vendor.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Expressiveness:&lt;/strong&gt;  In addition to HTTP host/path matching and TLS, Gateway API can express capabilities like HTTP header manipulation, traffic weighting &amp;amp; mirroring, TCP/UDP routing, and other capabilities that were only possible in Ingress through custom annotations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extensible:&lt;/strong&gt; The API is flexible enough to let you plug in custom resources at different layers, giving you fine-grained control and customization possible at the appropriate places within the API structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhiloif1d7n8r4xoeoq0n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhiloif1d7n8r4xoeoq0n.png" alt=" " width="630" height="500"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Key Resources in the Gateway API
&lt;/h2&gt;

&lt;p&gt;Gateway API has three stable API kinds:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GatewayClass:&lt;/strong&gt; These are cluster-wide resources that work like templates for networking. They define the behavior and configuration for Gateways created from them. If you’ve used StorageClasses in Kubernetes, it’s a similar concept—only here it’s applied to the networking data plane instead of storage.&lt;br&gt;
A sample GatewayClass CRD:&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: my-gateway-class
spec:
  controllerName: example.com/gateway-controller

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Gateway:&lt;/strong&gt; These are the actual instances created from a GatewayClass. You can think of them as the “real” networking components that handle traffic. A Gateway could be an in-cluster proxy, a hardware load balancer, or even a cloud provider’s load balancer. It takes the traffic from outside the cluster. Gateways are attached to respective GatewayClass.&lt;br&gt;
A sample Gateway CRD:&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: my-gateway-class
  listeners:
    - name: http
      protocol: HTTP
      port: 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Routes:&lt;/strong&gt; Which are not a single resource, but represent many different protocol-specific Route resources. The HTTPRoute has matching, filtering, and routing rules that get applied to Gateways that can process HTTP and HTTPS traffic. Similarly, there are TCPRoutes, UDPRoutes, and TLSRoutes which also have protocol-specific semantics. This model also allows the Gateway API to incrementally expand its protocol support in the future.&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-httproute
      namespace: default
    spec:
      parentRefs:
        - name: my-gateway
      hostnames:
        - "example.com"
      rules:
        - matches:
            - path:
                type: PathPrefix
                value: /app
          backendRefs:
            - name: my-service
              port: 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How the Request Flows
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hznmfxuyera9spawi2c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8hznmfxuyera9spawi2c.png" alt=" " width="800" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s walk through what happens when a request goes through a Gateway acting as a reverse proxy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A client tries to reach &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;http://www.example.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The client’s DNS resolver looks up &lt;a href="http://www.example.com" rel="noopener noreferrer"&gt;www.example.com&lt;/a&gt; and gets back the IP address of the Gateway.&lt;/li&gt;
&lt;li&gt;The client sends the HTTP request to that Gateway IP. The reverse proxy receives it and checks the Host header to find the right configuration defined by the Gateway and its attached HTTPRoute.&lt;/li&gt;
&lt;li&gt;If needed, the proxy can do extra checks like matching headers or paths based on the rules in the HTTPRoute.&lt;/li&gt;
&lt;li&gt;It can also tweak the request, for example by adding or removing headers, using filters defined in the route.&lt;/li&gt;
&lt;li&gt;Finally, the reverse proxy forwards the request to the right backend services.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Gateway API is the successor to the Ingress API. However, it does not include the Ingress kind. As a result, a one-time conversion from your existing Ingress resources to Gateway API resources is necessary.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you are already using ingress then want to use Gateway API, we require migrating Ingress resources to Gateway API resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Use Cases for Gateway API:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Multi-tenant clusters → Perfect for environments where multiple teams share the same cluster but still need isolation and clear boundaries.&lt;/li&gt;
&lt;li&gt;Progressive delivery → Enables deployment strategies like canary releases or blue/green rollouts, making it easier to test changes safely before full rollout.&lt;/li&gt;
&lt;li&gt;Beyond HTTP → Unlike traditional Ingress, Gateway API supports other protocols too—like TCP, gRPC, and WebSockets—making it a versatile choice for modern applications.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts:
&lt;/h2&gt;

&lt;p&gt;Kubernetes has made deploying and scaling applications much easier, but networking has always been one of its tougher challenges. Ingress did the job for simple scenarios, but as apps, teams, and protocols grew more complex, its limits quickly showed.&lt;/p&gt;

&lt;p&gt;That’s where the Gateway API comes in. It’s the next generation of Kubernetes networking-flexible, extensible, and designed for today’s workloads. With role-based design, multi-protocol support, and consistency across implementations, it brings infrastructure providers, operators, and developers onto the same page.&lt;/p&gt;

&lt;p&gt;Whether you’re just starting with Kubernetes or planning for the future, Gateway API is more than just an upgrade to Ingress-it’s the new foundation for Kubernetes networking.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the next article, I will write about how to migrate existing Ingress resources to Gateway API resources.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>aws</category>
      <category>azure</category>
    </item>
  </channel>
</rss>
