external-ip remains pending on controller-service after installation of Nginx Ingress Controller on AWS EKS
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Setting up an Nginx Ingress Controller on Amazon Web Services (AWS) Elastic Kubernetes Service (EKS) is a common choice for managing external traffic to services running within a Kubernetes cluster. However, a frequent issue that users face is the external IP for the Ingress controller remaining in a "Pending" state. This guide delves into the possible causes and resolutions for this problem.
Understanding the Nginx Ingress Controller
Before addressing the problem, it's useful to understand the role of the Nginx Ingress Controller:
- Ingress Controller: An Ingress Controller is a specialized load balancer for Kubernetes environments, managing routing of external traffic to your services as defined by Ingress resources.
- Nginx: Nginx is a popular choice for an Ingress Controller due to its high performance, scalability, and extensive configuration options.
Why External-IP May Remain Pending
The "external-IP pending" issue typically arises due to discrepancies in the configuration between the Kubernetes resources and the AWS environment. Here are a few common causes:
- Service Type Misconfiguration: Often, an issue with the
Servicetype can cause this problem. The Nginx Ingress Controller usually requires aServiceof typeLoadBalancer. If this is configured incorrectly, AWS won't provision a load balancer. - IAM Role Permissions: AWS permissions for the cluster's IAM role must allow the creation of load balancers. Inadequate permissions in the IAM policy will prevent AWS from creating the necessary resources.
- VPC and Subnet Issues: If the specified subnets are not publicly accessible or not tagged properly, AWS will not be able to assign an external IP.
- Controller Config Misconfiguration: Incorrect configurations in the Ingress controller deployment manifest can cause failures in load balancer provisioning.
Troubleshooting Steps
Step 1: Verify Service Type
Ensure that the Service associated with your Nginx Ingress Controller is of type LoadBalancer. You can check this using:
- port: 80
- Subnets should have the tag:
kubernetes.io/role/elb = 1 - If using private subnets, make sure there's a NAT gateway available.
- name: `
<name>`- /nginx-ingress-controller
- --publish-service=$(POD_NAMESPACE)/`
<service-name>` - --election-id=ingress-controller-leader
- --force-namespace-isolation

