mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
add statusz for kubelet
This commit is contained in:
parent
a499facee6
commit
a04df83f86
@ -67,6 +67,8 @@ import (
|
||||
metricsfeatures "k8s.io/component-base/metrics/features"
|
||||
"k8s.io/component-base/metrics/legacyregistry"
|
||||
"k8s.io/component-base/metrics/prometheus/slis"
|
||||
zpagesfeatures "k8s.io/component-base/zpages/features"
|
||||
"k8s.io/component-base/zpages/statusz"
|
||||
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
|
||||
"k8s.io/cri-client/pkg/util"
|
||||
podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1"
|
||||
@ -105,6 +107,8 @@ const (
|
||||
debugFlagPath = "/debug/flags/v"
|
||||
podsPath = "/pods"
|
||||
runningPodsPath = "/runningpods/"
|
||||
|
||||
kubeletComponent = "kubelet"
|
||||
)
|
||||
|
||||
// Server is a http.Handler which exposes kubelet functionality over HTTP.
|
||||
@ -406,6 +410,10 @@ func (s *Server) InstallDefaultHandlers() {
|
||||
checkers = append(checkers, s.extendedCheckers...)
|
||||
healthz.InstallHandler(s.restfulCont, checkers...)
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(zpagesfeatures.ComponentStatusz) {
|
||||
statusz.Install(s.restfulCont, kubeletComponent, statusz.NewRegistry())
|
||||
}
|
||||
|
||||
slis.SLIMetricsWithReset{}.Install(s.restfulCont)
|
||||
|
||||
s.addMetricsBucketMatcher("pods")
|
||||
|
Loading…
Reference in New Issue
Block a user