I currently have the following lifecycle hook in my kubernetes config:
lifecycle:
preStop:
httpGet:
path: /path
port: 8080
I would like to call the shutdown endpoint of spring boot actuator in this hook, but this endpoint requires a post request instead of a get. Is this in any way possible or should I define my own endpoint that shuts down my app gracefully?
Thanks for your help!
You can add an exec
lifecycle hook since httpPost
is not a valid one, and assuming you have curl
in your containers:
lifecycle:
preStop:
exec:
command: ["curl", "-XPOST", "http://URL"]