openfaas / of-watchdog

Reverse proxy for STDIO and HTTP microservices
MIT License
259 stars 115 forks source link

Silence logging from custom kubelet probes #131

Closed alexellis closed 2 years ago

alexellis commented 2 years ago

Signed-off-by: Alex Ellis (OpenFaaS Ltd) alexellis2@gmail.com

Description

Silence logging from custom kubelet probes

Motivation and Context

The kubelet's health check probe results in many log lines so this checks for the prefix of "kube-probe" and silences any logs for the http mode.

Fixes an issue reported by an OpenFaaS Pro customer.

Fixes: #130

How Has This Been Tested?

go build && fprocess=cat mode=http upstream_url=http://192.168.0.15:8080 \
  ./of-watchdog

curl -i localhost:8080/healthz --user-agent "kube-probe/1.21"

Output before:

2022/02/20 10:42:18 GET /healthz - 200 OK - ContentLength: 0

After: no output.

Types of changes

This change is automatic and does not require a documentation change.