Skip to content

Commit

Permalink
Bump log level for health check warning for missing components
Browse files Browse the repository at this point in the history
Default api server manifest whose liveness check looks like:
"/livez?exclude=etcd&exclude=kms-provider-0&exclude=kms-provider-1"

Which causes spurious messages in apiserver logs every 10 mins:
```
W1017 00:03:39.938956       9 healthz.go:256] cannot exclude some health checks, no health checks are installed matching "kms-provider-0","kms-provider-1"
```

Let's not log excessive messages especially at warning level. We should
do this at a higher level (6 instead of 4).

NOTE: we don't change the message returned to the http request, we keep
that as-is (does not change on log level)

Also see:
https://github.com/aws/eks-distro/blob/v1-19-eks-12/projects/kubernetes/kubernetes/1-19/patches/0016-EKS-PATCH-apiserver-healthz-upper-log-verbosity-for-.patch

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
  • Loading branch information
dims committed Oct 17, 2022
1 parent 48608cf commit 20de240
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go
Expand Up @@ -253,7 +253,7 @@ func handleRootHealth(name string, firstTimeHealthy func(), checks ...HealthChec
}
if excluded.Len() > 0 {
fmt.Fprintf(&individualCheckOutput, "warn: some health checks cannot be excluded: no matches for %s\n", formatQuoted(excluded.List()...))
klog.Warningf("cannot exclude some health checks, no health checks are installed matching %s",
klog.V(6).Infof("cannot exclude some health checks, no health checks are installed matching %s",
formatQuoted(excluded.List()...))
}
// always be verbose on failure
Expand Down

0 comments on commit 20de240

Please sign in to comment.