AWS
Nginx Ingress
Classic Load Balancer
Application Load Balancer
Kubernetes

AWS Nginx Ingress creating Classic Load Balancer instead of Application Load Balancer

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

In the modern era of cloud computing, deploying applications that are scalable and resilient is essential. Amazon Web Services (AWS), one of the leading cloud service providers, offers robust solutions such as Elastic Kubernetes Service (EKS) for container orchestration. When deploying applications on AWS EKS, it's crucial to expose them to the internet using a Load Balancer. Typically, Nginx Ingress controllers are configured to create an Application Load Balancer (ALB). However, there are instances where a Classic Load Balancer (CLB) is created instead. Let's delve into the nuances of why this happens and how to ensure that the desired Load Balancer type is deployed.

Understanding Load Balancers in AWS

AWS provides various types of Load Balancers, which are part of the Elastic Load Balancing (ELB) service:

  1. Classic Load Balancer (CLB): The original load balancer that provides basic load balancing for EC2 instances. It operates at both the request and connection levels and is suitable for simple use cases.
  2. Application Load Balancer (ALB): A more advanced option introduced later, optimized for HTTP and HTTPS traffic. It operates at Layer 7 of the OSI model and offers features like path-based routing and native WebSocket support.
  3. Network Load Balancer (NLB): Ideal for applications that require extreme performance and static IP addresses.

Most modern applications deployed on AWS EKS seek the advanced features of ALB, making it the preferred choice for Kubernetes Ingress resources.

Why is a Classic Load Balancer Created Instead?

Configuration Anomalies

One of the primary reasons the Nginx Ingress controller might create a CLB instead of an ALB might be due to specific annotations or configurations within the Kubernetes Ingress resource or the Load Balancer Service. Here’s a detailed look:

  • Ingress Annotations:
    • Ensure you are using the right annotations for ALB. Misconfigured or missing annotations can lead the Nginx controller to default to creating a CLB.
    • Example Annotation:
  • Service Annotations:
    • For ALB:
    • Incorrect or missing type annotations can result in a CLB being created.

Course illustration
Course illustration

All Rights Reserved.