From 20de240d5bdb7fc50de3fe9b8cdd95f81bf47034 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Mon, 17 Oct 2022 09:42:09 -0400 Subject: [PATCH] Bump log level for health check warning for missing components 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 --- staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go b/staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go index 425b7a742e78..63ff59750f03 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go +++ b/staging/src/k8s.io/apiserver/pkg/server/healthz/healthz.go @@ -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