Ingress TLS certificate is removed after TKGI upgrade
search cancel

Ingress TLS certificate is removed after TKGI upgrade

book

Article ID: 327289

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

Symptoms:

  • After TKGI upgrade (NCP upgrade from 3.0.2 to 3.1.x)  ingress in the cluster lost its TLS certificate 
  • You see messages similar to the following in the ncp/ncp.stdout.log file on the master node
2021-09-20T21:56:06.980Z ########-####-####-####-########95f2 NSX 7933 - [nsx@6876 comp="nsx-container-ncp" subcomp="ncp" level="WARNING"] vmware_nsxlib.v3.client The HTTP request returned error code 409, whereas 201/200 response codes were expected. Response body {'httpStatus': 'CONFLICT', 'error_code': 2038, 'module_name': 'internal-framework', 'error_message': 'Certificate already exists.'}
2021-09-20T21:56:06.980Z ########-####-####-####-########95f2 NSX 7933 - [nsx@6876 comp="nsx-container-ncp" subcomp="ncp" level="INFO"] nsx_ujo.ncp.nsx.manager.nsxapi Attempted to import a certificate which has already been imported
2021-09-20T21:56:06.981Z ########-####-####-####-########95f2 NSX 7933 - [nsx@6876 comp="nsx-container-ncp" subcomp="ncp" level="WARNING"] nsx_ujo.ncp.nsx.lb_l7_service Secret grafana-enterprise-tls-secret-prod with the same PEM data has been imported, use a different secret instead
2021-09-20T21:56:06.981Z ########-####-####-####-########95f2 NSX 7933 - [nsx@6876 comp="nsx-container-ncp" subcomp="ncp" level="INFO"] nsx_ujo.ncp.nsx.lb_l7_service Removing stale cert grafana-enterprise-tls-secret-prod in namespace grafana-enterprise with version number None
2021-09-20T21:56:07.142Z ########-####-####-####-########95f2 NSX 7933 - [nsx@6876 comp="nsx-container-ncp" subcomp="ncp" level="INFO"] nsx_ujo.ncp.k8s.service_lb_controller Successfully updated Loadbalancer resources for service ('grafana-enterprise', 'grafana-enterprise-service-prod')


Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.

Environment

VMware NSX-T Data Center

Cause

The issue is caused by a new secret-tracking feature introduced in NSX Container Plugin (NCP). In this version, NCP began attaching a secret version number as a tag to imported certificates to support dynamic updates.

During a TKGI upgrade (specifically NCP 3.0.2 to 3.1.x), existing certificates lack this version tag. NCP compares the current secret version against the missing tag (None), fails the version validation, and incorrectly identifies the certificate as stale. Consequently, NCP deletes the certificate. Because the underlying secret has not changed, NCP does not trigger a re-import, leaving the Ingress without its TLS certificate.

Resolution

This issue is resolved in NCP 3.1.2.4, which is included in the TKGI 1.11.6 release.
To resolve this issue, upgrade your environment to TKGI 1.11.6 or later. For detailed information, please consult the TKGI Release Notes under Issue 2871314.

Workaround: If an immediate upgrade is not possible, refer to the NCP 3.1.2 Release Notes (Issue 2871314) for temporary mitigation steps.