is there any way to resolve liveness probe failure issue in Kubernetes environment after upgrading to spring boot 3.0.0 from spring boot 2.7,7? - spring

I have upgraded spring boot application from version 2.7.7 to 3.0.0.
After upgrading it is working fine on local machine and able to access all the actuator health endpoints.
But, after deploying the same code to Kubernetes cluster we are getting error as "Readiness probe failed. 404 not found".
It is not able to call health endpoints and giving 404 error.
From the pod logs we can see that application is started properly on port 8080.
Please refer following image for error.
enter image description here
We tried the same on local machine it is working fine.
We redeployed the previous build with old springboot version it is working fine.
We also tried deploying the jar in minikube environment it is working fine.We are expecting to resolve the readiness probe issue.
We are expecting to resolve this issue and start the app with springboot 3.0.0 in kubernetes environment.

Verify you actuators didn't move to a different port. In v3 there is a configuration for management port where by default the actuators are served.
https://docs.spring.io/spring-boot/docs/3.0.0/reference/htmlsingle/#actuator.endpoints.kubernetes-probes
management.server.port
Also make sure they are enabled
management.endpoint.health.probes.enabled

Related

Springboot actuator endpoints are not working after deploying app to pcf

I have a springboot app which has 3 actuators enabled as below out of which 3rd one is custom,
application.properties code snippet
management.endpoints.web.exposure.include=health,refresh,customEndpoint
the endpoints when hit from local are working correctly. For example:-
http://localhost:8081/MyAppName/system/health gives below expected details:-
but when we hit the same endpoint(with pcf app route mapped) which is my_route_url/MyAppName/system/health, after deploying the app to pcf, it gives below 404 error:-
404 Not Found: Requested route ('my_route_url') does not exist.
Tried redeploying the app to pcf but that did not help.
Tried looking for solutions in other questions posted here but they are not matching scenario.
it's working in a different pcf foundation though.

Change in default Service host-port

I'm upgrading a project that uses the kubernetes extension from quarkus 1.13 to 2.2.2.
The http Service generated in the kubernetes.yml went from using port 8080 to 80. That however did not work on minikube for me when adding a loadbalancer to expose that service for testing (minikube expose service ...). I was able to workaround by adding an override to the configuration:
quarkus.kubernetes.ports.http.host-port=8080
Is this an expected change in quarkus 2.x?
Yes, this is expected the expected behavior for 2.0.
See https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.0#service-port-mapping

Pivotal Cloud Foundry - Deployed Spring Boot App failed to run because of java netsocket(port) permission denied

so, i tried to deploy spring boot app to a PCF Server. When i deployed it, the logs showed that my application was shut down because it failed to open a tomcat server because there is a java.netsocketexception where it says that permission denied. The tomcat server was fine for a moment (it successfully use the port) but the next moment, it was shut down because there is the permission denied netsocketexception.
the port i tried to use is port 443. i tried to look up to several kinds of problems. one of it said that i need to have root access to be able to use port lower than 1000. the problem is, my other apps, which is eureka server run perfectly even when i use port 443.
the configuration, build-pack, and everything is the same. and it is even deployed on a same pcf platform. so, why can this app failed but the other (eureka server) can use the 443 port.
can anyone tell me for the things i need to check to make sure of the problem?
Remove server.port configuration from Spring Boot yml / properties configuration. It will by default expose the service to 443 on PCF

Spring Boot Devtools Remote cause error at Pivotal Cloud Foundry

Sorry, cant post images with low reputation)
Here is my settings:
Spring Boot: 2.3.0.RELEASE
secret
build.gradle
Intellij Idea IDE Run/Debug Configuration
I have this app working at Pivotal Cloud Foundry. I have runing Remote App and after build through IDE or using
./gradlew clean assemble
I get
Exception in thread "File Watcher" java.lang.IllegalStateException: Unexpected 404 NOT_FOUND response uploading class files
error
Ok, so after looking through your demo app I believe the issue is that you're using Spring Webflux and that's not supported at the moment.
The remote devtools functionality is only available with Spring WebMVC & Servlet. See this Github issue for reference: https://github.com/spring-projects/spring-boot/issues/13092#issuecomment-387350811

Process Metrics in Springboot not coming

I am facing a weird problem in spring boot application. I am exposing metrics through actuator and micrometer-registry-prometheus.
I am able to see all expected metrics in when I run from my localhost but I am not able to see ProcessMetrics(cpuUsage, processUsage) when I deploy my application in my k8s environment.
I have checked the version of the actuator and micrometer-prometheus as well, They are all same.
I have referred the link: https://github.com/micrometer-metrics/micrometer/issues/513. The solution suggested did not work for me. My service also contains Kafka and Postgres dependency.
I dont know What is causing the issue. Any help will be much appreciated.

Resources