title: Spring Boot Actuator Kubernetes Probes returning 404
body: <p>I'm trying to use <a href="https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/production-ready-features.html#production-ready-kubernetes-probes" rel="noreferrer">Kubernetes Probes</a> from Spring Boot Actuator, but it isn't working.</p>
  <p>I have set the following in application.properties:</p>
  <pre><code>management.endpoints.web.path-mapping.health=probes
  management.endpoint.health.group.ping.include=ping
  management.endpoint.health.group.liveness.include=livenessState
  management.endpoint.health.group.readiness.include=readinessState
  </code></pre>
  <p>The groups are listed as expected:</p>
  <pre><code>$ curl http://localhost:8080/actuator/probes
  {&quot;status&quot;:&quot;UP&quot;,&quot;groups&quot;:[&quot;liveness&quot;,&quot;ping&quot;,&quot;readiness&quot;]}
  </code></pre>
  <p>And <code>ping</code> works as expected:</p>
  <pre><code>$ curl http://localhost:8080/actuator/probes/ping
  {&quot;status&quot;:&quot;UP&quot;}
  </code></pre>
  <p><strong>However both <code>liveness</code> and <code>readiness</code> return <code>Status Code: 404</code> and <code>Content-Length: 0</code>.</strong></p>
  <hr />
  <p>I'm using <code>spring-boot-starter-parent</code> version <code>2.3.1.RELEASE</code>.</p>
  <p>The probes I want are documented in the list of <a href="https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/reference/html/production-ready-features.html#production-ready-health-indicators" rel="noreferrer">Auto-configured HealthIndicators</a>.</p>
  <p>The feature is also described at: <a href="https://spring.io/blog/2020/03/25/liveness-and-readiness-probes-with-spring-boot" rel="noreferrer">https://spring.io/blog/2020/03/25/liveness-and-readiness-probes-with-spring-boot</a>.</p>
  <p>I've tried several spellings of <code>livenessState</code>, inluding <code>livenessProbe</code> (which is in the blog post), with no effect.</p>
  <p>Here's a related answer, but it doesn't directly address my problem: <a href="https://stackoverflow.com/a/62585531/86967">Kubernetes - Liveness and Readiness probe implementation</a></p>
  <p><em>What bit of configuration am I missing?</em></p>
  <hr />
  <h2>Update</h2>
  <p>There is some verbiage in the linked sites that indicates a potential clue...</p>
  <blockquote>
  <p>If deployed in a Kubernetes environment, actuator will gather the &quot;Liveness&quot; and &quot;Readiness&quot; information...</p>
  </blockquote>
  <p>Maybe this indicates that the probes <em>only work</em> if deployed in a Kubernetes environment -- although I don't know how that would be detected or why that would be the case.</p>