From 2d9114c58d34cfa71c782817e6798c1a52ea38ae Mon Sep 17 00:00:00 2001 From: javex Date: Sun, 9 Mar 2025 08:19:53 +1030 Subject: [PATCH] Use command probe for increased accuracy (#344) The liveness & readiness probes previously checked that the web server was up, but did not check that FTL was running. There are conditions under which the web server starts, but FTL fails to start. Using HTTP probes does not catch those conditions, but the web server offers an endpoint that returns the DNS status. If the web server is not up, this probe will continue to fail since it can't `curl` the endpoint. In addition, it will now also fail if the DNS server is down. Signed-off-by: javex --- charts/pihole/values.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/charts/pihole/values.yaml b/charts/pihole/values.yaml index 1c3a9c4e..1bae5b84 100644 --- a/charts/pihole/values.yaml +++ b/charts/pihole/values.yaml @@ -167,12 +167,12 @@ probes: # -- probes.liveness -- Configure the healthcheck for the ingress controller liveness: # -- Generate a liveness probe - # 'type' defaults to httpGet, can be set to 'command' to use a command type liveness probe. - type: httpGet - # command: - # - /bin/bash - # - -c - # - /bin/true + # 'type' defaults to command, can be set to 'httpGet' to use a HTTP GET type liveness probe. + type: command + command: + - /bin/sh + - -c + - "curl --silent http://localhost/api/info/login | jq 'if (.dns | not) then halt_error(1) end'" enabled: true # -- wait time before trying the liveness probe initialDelaySeconds: 60 @@ -180,16 +180,16 @@ probes: failureThreshold: 10 # -- timeout in seconds timeoutSeconds: 5 - port: http - scheme: HTTP + # port: http + # scheme: HTTP readiness: # -- Generate a readiness probe - # 'type' defaults to httpGet, can be set to 'command' to use a command type readiness probe. - type: httpGet - # command: - # - /bin/bash - # - -c - # - /bin/true + # 'type' defaults to command, can be set to 'httpGet' to use a HTTP GET type readiness probe. + type: command + command: + - /bin/sh + - -c + - "curl --silent http://localhost/api/info/login | jq 'if (.dns | not) then halt_error(1) end'" enabled: true # -- wait time before trying the readiness probe initialDelaySeconds: 60 @@ -197,8 +197,8 @@ probes: failureThreshold: 10 # -- timeout in seconds timeoutSeconds: 5 - port: http - scheme: HTTP + # port: http + # scheme: HTTP # -- We usually recommend not to specify default resources and to leave this as a conscious # -- choice for the user. This also increases chances charts run on environments with little