This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.
I'm experiencing an intermittent UnknownHostException in my Kubernetes cluster. The issue occurs with some microservices (built with Spring Boot 2.7.RELEASE using the eclipse-temurin:17-jre base image) when trying to request another service through its Kubernetes service name
Environment:Kubernetes version: 1.26 (Google Cloud) Spring Boot version: 2.7.RELEASE Java base image: eclipse-temurin:17-jre.
Issue:Occasionally, some services fail to resolve the hostname of other services and throw an UnknownHostException. Here is the relevant log snippet:
Exception caught. Returning HTTP status 500 INTERNAL_SERVER_ERROR. org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://kantoor:8097/api/v1.0/configTopic/king": kantoor; nested exception is java.net.UnknownHostException: kantoor at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:784) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:710) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:601)
Troubleshooting Steps Taken:
Curl Tests: Ran over 10,000 curl requests from one service to another using the Kubernetes service name, all succeeded.
Despite all these checks and adjustments, the issue persists intermittently. Any insights or suggestions on what might be causing this intermittent UnknownHostException would be greatly appreciated.