<p>We have Spring Boot service running in Kubernetes.<br>
This service has endpoint:<br>
- GET /healthz</p>

<p>We have liveness probe that uses this endpoint. Probe runs successfully.<br>
It means that the endpoint is reachable from the service pod (localhost).    </p>

<p>When I run in the service pod :
    <code>wget https://localhost:8080/healthz</code>
I get an answer (OK)</p>

<p>When I try to call this endpoint outside the pod <code>wget https://myhost:8080/healthz</code>, I get <strong>response 400 without body</strong>.<br>
I don't see any logs of Sprint. It seems that it does not reach the Sprint .<br>
When I added flag <code>-Djavax.net.debug=all</code> I see in log that TLS handshake finished and then:    </p>

<pre><code>GET /healthz HTTP/1.1    
host: myhost:8080    
accept: application/json    
Connection: close     
</code></pre>

<p>and immediately</p>

<pre><code>HTTP/1.1 400 
Transfer-Encoding: chunked
Date: Mon, 25 Jun 201 8 08:43:43 GMT
Connection: close
</code></pre>

<p>When I try <code>wget https://myhost:8080/blahblah</code> (non existing endpoint),
I still get 400, not 404!</p>

<p>When I try <code>wget https://myWronghost:8080/healthz</code> (wrong host), I get an error <code>Bad address</code>. It means that host 'myhost' is correct (otherwise I would get this error).    </p>

<p>Docker file:  </p>

<blockquote>
  <p>FROM openjdk:8-jdk-alpine<br>
    VOLUME /tmp<br>
    ARG JAR_FILE<br>
    COPY ${JAR_FILE} app.jar<br>
    ENV JAVA_TOOL_OPTIONS -Dfile.encoding=UTF8<br>
    ENTRYPOINT ["java","-Djavax.net.debug=all", "-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]<br>
    EXPOSE 8080</p>
</blockquote>

<p>Summing up:<br>
The service endpoints are accessible from within service pod, but not accessible from outside the pod.<br>
Any idea why?</p>

<p>Update:<br>
The problem was solved by calling the service with <strong>fully qualified domain name</strong> : <em>serviceName.namespaceName.svc.cluster.local</em><br>
Tomcat didn't accept calls with short domain <em>serviceName.namespaceName</em>, it responded 400.</p>

Tantre
<p>Your issue can be caused by <a href="https://github.com/spring-projects/spring-boot/issues/13205" rel="nofollow noreferrer">https://github.com/spring-projects/spring-boot/issues/13205</a>.
All you have to do is upgrade Tomcat version to 8.5.32. You can do that by adding the version in pom.xml file.</p>

<pre><code> &lt;properties&gt;
    &lt;!-- your properties --&gt;
    &lt;tomcat.version&gt;8.5.32&lt;/tomcat.version&gt;
 &lt;/properties&gt;
</code></pre>
