I'm running a web service that I can not change any of the specifications. I want to use liveness probe with HTTP POST on Kubernetes. I couldn't find anything available. All of my efforts with busybox and netcat have failed.
Is there a solution? Is it possible to build a custom liveness probe from any Linux dist?
Kubernetes Probes only support HTTP GET, TCP & Command.
If you must check something over HTTP POST you could use a command approach and just curl -XPOST ..
An example would be:
...
containers:
- name: k8-byexamples-spring-rest
image: gcr.io/matthewdavis-byexamples/k8-byexamples-spring-rest:1d4c1401c9485ef61322d9f2bb33157951eb351f
ports:
- containerPort: 8080
name: http
livenessProbe:
exec:
command:
- curl
- -X POST
- http://localhost/test123
initialDelaySeconds: 5
periodSeconds: 5
...
For more explanation see: https://matthewdavis.io/kubernetes-health-checks-demystified/.
Hope that helps!