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.
- Identify Pending State: Verify that the
ingress-nginx-controllerservice is stuck withEXTERNAL-IPas<pending>^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md]. - Modify Service Type: Edit the service definition to change
type: LoadBalancertotype: NodePort. This can be done by modifying the source YAML file before deployment or patching the existing service. - Verify Exposure: After applying the change, the controller will be accessible via the NodePorts (e.g.,
32411for HTTP and30176for HTTPS) assigned to the nodes in the cluster^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md].
Related Concepts¶
- Ingress
- Kubernetes Service
- [[ingress-nginx]]
Sources¶
^[400-devops__06-Kubernetes__k8s-learning__06.ingress__README.md]