Issue
A persistent warning appears in the API Gateway logs in Fusion 5.9.9:
Despite the warning, the API Gateway remains functional, but the repeated log message can clutter logs and lead to concern.
Diagnosis
This issue is present in Fusion 5.9.9 and identifiable by the exact warning message shown above in API Gateway pod logs. The warning indicates that Spring Cloud Kubernetes Discovery is unable to determine the correct service port due to missing primary-port-name labeling or configuration.
Environment
- Fusion 5.9.9-5.9.11 (Self-Hosted)
- Kubernetes 1.29
Cause
Fusion 5.9.9 introduced an update to the Spring Cloud Kubernetes load balancer configuration. When the required service annotations or configurations are missing, the discovery mechanism logs a warning about ambiguous port naming. This behavior was not present in 5.9.8 and has been fixed in Fusion 5.9.12.
Resolution
This issue is resolved in Fusion 5.9.12. To eliminate the warning, upgrade the API Gateway image to version 5.9.12 or later.
If an immediate upgrade is not feasible, the following mitigations may reduce or suppress the warning in earlier versions:
Option 1: Set the primary port name via deployment configuration
Add the following JVM option to the api-gateway deployment to explicitly define the primary port:
This can be set using the JAVA_TOOL_OPTIONS environment variable in the container spec.
Option 2: Apply a label to the Kubernetes service
Add the following label to the service definition for the API Gateway:
This helps Spring Cloud identify which service port to use as the default.
Note: These mitigations have been reported to reduce the warning but may not fully suppress it in all environments. The only definitive resolution is to upgrade to Fusion 5.9.12.