Readiness probe gives out of service error
05:16 10 Aug 2021

I have updated spring boot to 2.5.2 from 2.1.8.RELEASE. Before that liveness and readiness probe was fine. Now after updating the spring boot I have updated my application properties file:

management.endpoints.web.exposure.include=*
management.endpoints.jmx.exposure.include=health,info
management.endpoint.metrics.enabled=true
management.endpoint.prometheus.enabled=true
management.metrics.enable.*=true
management.metrics.enable.all=true
management.metrics.export.prometheus.enabled=true
management.metrics.use-global-registry=true




management.endpoint.health.probes.enabled=true
management.health.livenessstate.enabled=true
management.health.readinessstate.enabled=true
management.endpoint.health.show-details=always

I have added last 4 lines respective to some documents.

After starting the project locally and checking from browser:

http://localhost:8090/actuator/health/liveness gives {"status":"UP"}

But http://localhost:8090/actuator/health/readiness gives {"status":"OUT_OF_SERVICE"} which is 503 status.

{
    "status": "OUT_OF_SERVICE",
    "components": {
        "diskSpace": {
            "status": "UP",
            "details": {
                "total": 499963174912,
                "free": 326313852928,
                "threshold": 10485760,
                "exists": true
            }
        },
        "livenessState": {
            "status": "UP"
        },
        "ping": {
            "status": "UP"
        },
        "readinessState": {
            "status": "OUT_OF_SERVICE"
        }
    },
    "groups": [
        "liveness",
        "readiness"
    ]

}

In my pom file under dependency:


            org.springframework.boot
            spring-boot-starter-web
            ${spring-boot.version}
            runtime
        
        
            org.springframework.boot
            spring-boot-starter-actuator
            ${spring-boot.version}
            runtime
        
spring-boot maven kubernetes readinessprobe livenessprobe