quarkus-operator-sdk icon indicating copy to clipboard operation
quarkus-operator-sdk copied to clipboard

[Question]: How to disable Probes, e.g. livenessProbe?

Open Jeansen opened this issue 1 year ago • 3 comments

I have the need to disable probes. But nothing so far worked. I was able to overwrite settings, e.g. the initial delay, but the quarkus kubernetes extensions does not offer any options and the smallrye-health options for disabling that extension did not work either. Every time I have all probes with some defaults set in the generated kubernetes.yml, for example

          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /q/health/live
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 5
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 10

So, my questions is, how do I disable this? I am aware, this is not directly specific to the QOSDK extension, but since these two extensions are a dependency, I thought, I start here. Maybe I am just blind in the tunnel .....

Jeansen avatar Feb 05 '24 17:02 Jeansen

Indeed, there seems to be an issue: https://github.com/quarkusio/quarkus/issues/38613

metacosm avatar Feb 06 '24 17:02 metacosm

May I ask why you need to deactivate the probes, actually? Considering making the probes controlled by a QOSDK property, just trying to figure out what the use case is to see if it makes sense…

metacosm avatar Feb 12 '24 15:02 metacosm

I would like to disable them during development. Probes are the last thing I add, when a POC, MVP etc goes stable. It's exactly the phase when I have something I would like to be build via CI/CD, but where I am still "trying out things". Also, there might be security reasons to not expose probes until reviewed by a security responsible. For instance, for some insurance company, some rules are extraordinarily strict with respect to what exactly is allowed to be exposed.

Of course, this can all be overwritten, but that's exactly the point. I would have to overwrite many settings with dummy values or add some dummy code, which would be removed later on. But being able to deactivate probes, would simply be the easiest AND also reflect the intention. Anyway, it would be easy to pick it up during a review, after all.

If I would seed an application setting that says, e.g: livenessProbe=false, I would quickly notice it and also be able to ask: Why is this disabled? Serving a dummy probe or overwriting it with some dummy settings IMHO a code/config smell.

Jeansen avatar Feb 13 '24 19:02 Jeansen

Hi @Jeansen, I implemented the config disable of the health extension in Quarkus, which also skips adding the probes to the generated resources—https://github.com/quarkusio/quarkus/pull/42361. Please try this with the next Quarkus release and let us know if it solves your case here.

xstefank avatar Aug 08 '24 12:08 xstefank

Hes @xstefank That's great news! Thank you. I'll post my feedback, then.

Jeansen avatar Aug 11 '24 21:08 Jeansen