Both my liveness and readiness shows status up when I am testing them locally. Running my service in kubernetes is a different story. Seems like the liveness is also working fine but readiness is giving 503. I have tried to test it from my docker image which is also working fine.
configuration properties used:
management.endpoint.health.probes.enabled=true
management.endpoint.metrics.enabled=true
management.endpoints.web.exposure.include=*
management.endpoint.prometheus.enabled=true
management.metrics.export.prometheus.enabled=true
management.endpoint.health.group.readiness.include=*
management.endpoint.health.group.readiness.show-details=always
management.endpoint.health.group.liveness.include=ping
management.endpoint.health.group.liveness.show-details=never
Log from pod:
HttpEntityMethodProcessor:116 - Writing [org.springframework.boot.actuate.health.CompositeHealth@63a928fa]
2022-09-05T11:20:08,814 TRACE [http-nio-8090-exec-3] RequestMappingHandlerAdapter:405 - Applying default cacheSeconds=-1
2022-09-05T11:20:08,815 TRACE [http-nio-8090-exec-3] DispatcherServlet:1155 - No view rendering, null ModelAndView returned.
2022-09-05T11:20:08,815 DEBUG [http-nio-8090-exec-3] DispatcherServlet:1131 - Completed 503 SERVICE_UNAVAILABLE, headers={masked}
The health check in manifest:
readinessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/readiness
port: 8090
scheme: HTTP
periodSeconds: 10
initialDelaySeconds: 120
livenessProbe:
failureThreshold: 3
httpGet:
path: /actuator/health/liveness
port: 8090
scheme: HTTP
periodSeconds: 10
initialDelaySeconds: 60
I am using spring-boot 2.7.2, upgraded from 2.1.8.RELEASE