External IP not assigned to service type LoadBalancer in TKGi cluster
search cancel

External IP not assigned to service type LoadBalancer in TKGi cluster

book

Article ID: 405701

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

The service of type LoadBalancer is created in in TKGi cluster but no External IP is assigned to it by NSX.

 

Environment

TKGi with NSX

Cause

The ncp logs are continuously logging the below Warning message:

2025-07-22T12:29:28.986Z 3640c2f5-d56c-44b0-aed7-0ce7d42481ab NSX 87634 - [nsx@6876 comp="nsx-container-ncp" subcomp="ncp" level="WARNING"] nsx_ujo.common.controller LoadBalancerController garbage collector failed collecting for unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/nsx_ujo/common/controller.py", line 588, in garbage_collector_worker
    for key in self.garbage_collector():
  File "/usr/local/lib/python3.10/dist-packages/nsx_ujo/ncp/k8s/loadbalancer_controller.py", line 267, in garbage_collector
    for lb_id in self._lb_l4_service.list_crd_lbs():
AttributeError: 'NoneType' object has no attribute 'list_crd_lbs'

Resolution

The /var/vcap/jobs/ncp/config/ncp.ini config file on Master nodes has the following parameters:

enable_lb_crd = true
use_native_loadbalancer = false

This is an invalid combination and use_native_loadbalancer must be set to true when enable_lb_crd is true.

Update ncp.ini and restart ncp on all Master nodes.

vi /var/vcap/jobs/ncp/config/ncp.ini
monit restart ncp

Note that this change is not persistent so its important to check if it has been set elsewhere, review the manifest for the cluster

bosh -d service-instance_<GUID> manifest | grep use_native_loadbalancer

Also note, use_native_loadbalancer is set true by default when TKGi is integrated with NSX. But it is possible to change it using a network profile by setting nsx_lb parameter in cni_configurations, see Configure the TCP Layer 4 Load Balancer.

For details on updating network profiles, see Creating and Managing Network profiles