Skip to content

ingress-nginx controller LoadBalancer to NodePort conversion

The ingress-nginx controller LoadBalancer to NodePort conversion is a configuration adjustment performed on the ingress-nginx controller Service within a Kubernetes cluster. This conversion is typically required when the underlying infrastructure does not support external LoadBalancers, leaving the service in a <pending> state.^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md]

Background

When deploying the ingress-nginx controller using the standard cloud provider manifests, the associated Service is often defined with type: LoadBalancer.^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md] In environments that support this type (such as cloud platforms), the cluster provisions an external IP or FQDN automatically^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md].

However, in local or bare-metal clusters that lack this support, the EXTERNAL-IP field will remain <pending> indefinitely^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md]. This indicates that the Kubernetes cluster cannot configure a load balancer for that service.^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md]

Conversion to NodePort

To make the Ingress Controller accessible in environments without LoadBalancer support, the Service type must be changed to NodePort.

  1. Identify Pending State: Verify that the ingress-nginx-controller service is stuck with EXTERNAL-IP as <pending>^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md].
  2. Modify Service Type: Edit the service definition to change type: LoadBalancer to type: NodePort. This can be done by modifying the source YAML file before deployment or patching the existing service.
  3. Verify Exposure: After applying the change, the controller will be accessible via the NodePorts (e.g., 32411 for HTTP and 30176 for HTTPS) assigned to the nodes in the cluster^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md].

Sources

^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md]