2
votes

I have set up liveness and readiness probes for an application, e.g.:

    readinessProbe:
      httpGet:
        path: /actuator/health/readiness
        port: 8080
    ...
    livenessProbe:
      httpGet:
        path: /actuator/health/liveness
        port: 8080

What I would like to do is whenever the probe is invoked by Kubernetes, its result is sent to an endpoint passing some additional information suchs as pod name, Docker image used, value from a secret, etc.

PROBE INVOKED -> RESULT COLLECTED -> INVOKE ENDPOINT (http://xxx - payload {"probe": "liveness", "result": "OK", "image" : "app:1.0.0", "key" : "VALUE_EXTRACTED_FROM_A_SECRET", ...}

Could you indicate a way to achieve this?

1

1 Answers

1
votes

There are many ways to do this (e.g. depending on your pipeline).
You could call the probe endpoints yourself and react if the pod is not in the desired state. You could could then call kubectl describe, log etc. and pass the result to your endpoint.
You could do so in with different approaches bash, python, etc...