Kubernetes Handbook

    Use Cases of Ingress in Kubernetes

    Introduction#

    Hey, devs! You’re already rocking it with our Kubernetes Handbook, where we learned how Ingress acts like a friendly guide at a Swiggy-like food stall, sending web requests from swiggy.com/restaurants to food services and swiggy.com/instamart to grocery services. Now, let’s dive into the use cases of Ingress. In this short and sweet blog, we’ll cover three key use cases of Ingress: Load Balancing, Domain-Based Virtual Hosting, and SSL Termination, using simple examples from a Swiggy-like food delivery app. By the end, you’ll know exactly when to use Ingress to make your app fast, organized, and secure. Ready to order up some Kubernetes knowledge? Let’s go! 😊🍕

    Quick Recap: What is Ingress?#

    Ingress is Kubernetes’ traffic guide, directing web requests (like swiggy.com/restaurants) to the right API Gateway service under one domain. It’s powered by an Ingress Resource (a map with rules) and an Ingress Controller (a megaphone that follows those rules). But why is Ingress so awesome? Let’s explore the top three use cases of Ingress that make it a game-changer!

    Use Case 1: Load Balancing#

    Load balancing with Ingress

    What’s Load Balancing?#

    Load Balancing is when Ingress spreads web traffic across multiple app workers (pods) to keep your app fast, even when tons of users are visiting. It’s like a guide at a Swiggy-like food stall making sure no single counter gets overwhelmed during a rush.

    How It Works in a Swiggy-Like App#

    In our Swiggy-like app, Ingress uses its Ingress Controller to evenly distribute requests to API Gateway services, ensuring the app stays snappy during peak hours.

    Example 1: Dinner Rush

    On a Friday night, everyone’s hitting swiggy.com/restaurants to order biryani. Ingress sends requests to restaurant-api-gateway, and the Ingress Controller spreads them across multiple restaurant workers (pods). No one waits long for their food, and the app runs smoothly!

    Use Case 2: Domain-Based Virtual Hosting#

    Domain-Based Virtual Hosting with Ingress

    What’s Domain-Based Virtual Hosting?#

    Domain-Based Virtual Hosting lets Ingress route traffic to different services based on the domain or path, keeping everything under one website (like swiggy.com). Instead of separate sites like restaurants.swiggy.com, users get a clean, unified experience.

    How It Works in a Swiggy-Like App#

    At our Swiggy-like food stall, the guide (Ingress) uses a map to send users to the right counter based on the web address, all under swiggy.com. No need for multiple websites!

    Example 3: Food and Groceries Together

    You visit swiggy.com/restaurants to order a burger. Ingress routes it to restaurant-api-gateway. Your friend hits swiggy.com/instamart for snacks, and Ingress sends it to instamart-api-gateway. Both services live happily under swiggy.com, making the app super easy to use.

    Example 4: One App, Many Services

    Even developer tools (like a performance dashboard) can sit at swiggy.com/monitoring. Ingress routes these requests to a monitoring service, keeping everything under one domain for a polished experience.

    Why It’s Awesome: This use case of Ingress creates a seamless app where users don’t need to juggle multiple websites, just like Swiggy’s slick interface.

    My Domain Mess: I once built an app with separate domains—food.app.com, groceries.app.com. Users were so confused! 😅 Ingress saved me by unifying everything under one domain, like turning a messy market into a neat food stall.

    Use Case 3: SSL Termination#

    SSL Termination 

    What’s SSL Termination?#

    SSL Termination is when Ingress handles HTTPS encryption, securing user data (like payment details) by adding a “lock” to web connections. It takes care of the encryption so your app’s services don’t have to.

    How It Works in a Swiggy-Like App#

    In our Swiggy-like food stall, the guide (Ingress) uses a security lock (HTTPS) to protect your order details. The Ingress Controller manages encryption, keeping data safe as it travels to API Gateways.

    Example 5: Safe Payments

    You pay for groceries at swiggy.com/instamart. Ingress uses HTTPS to encrypt your payment info, sending it safely to instamart-api-gateway. Your data stays secure, and you can shop without worry.

    Example 6: Secure Orders

    When you order a dosa at swiggy.com/restaurants, Ingress ensures HTTPS encryption to restaurant-api-gateway. It’s like the guide locking your order in a safe before passing it to the counter.

    Why It’s Awesome: SSL Termination, a critical use case of Ingress, builds trust by keeping user data safe, especially for payment-heavy apps like Swiggy.

    My Security Scare: I once ran an app without HTTPS, thinking it was no big deal. Then I realized hackers could snoop on user payments! 😱 Adding Ingress with SSL Termination was like hiring a security guard for the food stall—users felt safe, and I avoided a disaster.

    When to Use Ingress#

    The use cases of Ingress make it perfect for a Swiggy-like app when you need:

    • Load Balancing: To handle busy traffic like a dinner rush.
    • Domain-Based Virtual Hosting: To keep services under one domain (swiggy.com).
    • SSL Termination: To secure user data with HTTPS.

    Example 7: All-in-One Magic

    A Swiggy-like app uses Ingress to balance traffic to /restaurants and /instamart, unify them under swiggy.com, and add HTTPS for secure payments. It’s fast, organized, and safe!

    When Not to Use Ingress#

    • Non-Web Traffic: Ingress is for web requests (HTTP/HTTPS), not databases or messaging—use Services for those.
    • Internal Traffic: Services handle communication inside the app.

    Example 8: Database Traffic

    The app’s database (storing orders) uses a Service for internal work. Ingress isn’t needed—it’s all about web traffic like swiggy.com/restaurants.

    Conclusion#

    In this blog, you mastered the use cases of Ingress in Kubernetes with simple examples from a Swiggy-like food delivery app. You learned how Ingress shines at Load Balancing to keep apps fast, Domain-Based Virtual Hosting to unify services under one domain, and SSL Termination to secure data.

    Last updated on May 06, 2025