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

  • Kubernetes object seems to be not in sync with NSX.
  • The service of type LoadBalancer is created in in TKGi cluster but no External IP is assigned to it by NSX.
  • NSX Server pool members point to old pods that no longer exist.
  • 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'


    NOTE: Use the Identifying component leaders of TKGI components KB as reference to identify the NCP leader when checking logs live.

Environment

TKGi with NSX

Cause

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.

Resolution

Update the use_native_loabalancer configuration ncp.ini and restart ncp on all Master nodes:

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

NOTE: 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

 

To persist the use_native_loadbalancer change in ncp.ini, download the manifest, then change the setting and reapply the manifest:

bosh -d service-instance_<GUID> manifest > service-instance_<GUID>.yaml

Edit the resulting service-instance_<GUID>.yaml file and modify the use_native_loadbalancer value, then apply the change:

bosh -d service-instance_<GUID> deploy service-instance_<GUID>.yaml

 

Additional Information

The 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