dhalfageme
dhalfageme

Reputation: 1545

Spring boot Kubernetes readyness / liveness probes 404 on local deployment

I've enabled liveness and readiness endpoints using Spring Boot actuator (v2.6.1)

What I have is the following config:

management
  endpoint:
    health:
      enabled: true
      probes:
        enabled: true
      group:
        readiness:
          include: readinessStateProbeIndicator
        exploratory:
          include:
            - livenessState
            - readinessState
            - ping
          show-details: always
  health:
    enabled: true
    probes:
      livenessstate:
        enabled: true
      readinessstate:
        enabled: true

Probably endpoint.health.enabled, endpoint.health.group.explotatory... are not required but I set it because I've seen it for some working solution, but I don't think there will affect if are not needed.

What I have read, but not in official docs, is that this endpoints are not available in a local deployment (running the application). Is this the reason why I'm getting 404 when I try to call http://localhost:8080/actuator/health/readiness and /actuator/health/liveness or I'm missing something?

I checked some posts like this but it seems management.health.enabled has been deprecated and management.endpoint.health.probes.enabled should be enough.

Thanks

Upvotes: 0

Views: 1416

Answers (1)

dhalfageme
dhalfageme

Reputation: 1545

This is the setting I was looking for, and it works fine on localhost:

endpoint:
    health:
      probes:
        enabled: true
      enabled: true

Upvotes: 1

Related Questions