spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Improve Kubernetes liveness and readiness probes customization documentation

Open bedla opened this issue 2 years ago • 4 comments

Hi, when I was looking into docs how to customize k8s liveness and readiness probes, I was not able to find it explicitly how to do it. This PR add tests and improves documentation little bit. What do you think? Thx Ivos

bedla avatar Apr 13 '23 18:04 bedla

I suppose you are talking about this section: image

I found it, but there is group-name equal to live, but AvailabilityProbesHealthEndpointGroups is registering liveness and readiness groups.

I understand docs from screenshot, that I can create group-name with any name. What I want to achive is to customize those automatic /livez and /readyz endpoints automatically added by management.endpoint.health.probes.add-additional-paths flag.

Do I understand it correctly?

Anyways, I am also not keen to duplicate the stuff :)

edit: I have added test ManagementPortAvailabilityProbesCustomPathWithoutFlagEnabledTests to show that when I register additional-paths with same group name liveness & readiness, it does not matter if I enable or disable management.endpoint.health.probes.add-additional-paths flag.

bedla avatar Apr 13 '23 19:04 bedla

Yes, you understand it correctly. The probes documentation notes that the probes are implemented as health groups:

They are also exposed as separate HTTP Probes by using health groups: "/actuator/health/liveness" and "/actuator/health/readiness"

And the documentation on health groups to which it links describes how to customise the additional paths of any health group. This is the section in your screenshot above.

wilkinsona avatar Apr 14 '23 07:04 wilkinsona

I have changed wordings and added link to groups docs. What do you think?

bedla avatar Apr 16 '23 19:04 bedla

tests fixed, rebased to recent upstream/main

bedla avatar Apr 20 '23 19:04 bedla

We'd like to make the change to the documentation. We don't feel the tests are necessary as we think we have sufficient coverage elsewhere.

wilkinsona avatar Jun 14 '23 15:06 wilkinsona

Thanks very much @bedla, this is now in 2.7.x and merged forwards to all supported branches.

philwebb avatar Jul 04 '23 14:07 philwebb