mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
add 'metrics/slis' to kcm health checks
Change-Id: I8c2114e538bb417deff8c3f9f107758c089227dc
This commit is contained in:
parent
bb2101bac1
commit
bd2417b435
@ -55,7 +55,9 @@ import (
|
|||||||
"k8s.io/component-base/configz"
|
"k8s.io/component-base/configz"
|
||||||
"k8s.io/component-base/logs"
|
"k8s.io/component-base/logs"
|
||||||
logsapi "k8s.io/component-base/logs/api/v1"
|
logsapi "k8s.io/component-base/logs/api/v1"
|
||||||
|
"k8s.io/component-base/metrics/features"
|
||||||
controllersmetrics "k8s.io/component-base/metrics/prometheus/controllers"
|
controllersmetrics "k8s.io/component-base/metrics/prometheus/controllers"
|
||||||
|
"k8s.io/component-base/metrics/prometheus/slis"
|
||||||
"k8s.io/component-base/term"
|
"k8s.io/component-base/term"
|
||||||
"k8s.io/component-base/version"
|
"k8s.io/component-base/version"
|
||||||
"k8s.io/component-base/version/verflag"
|
"k8s.io/component-base/version/verflag"
|
||||||
@ -77,6 +79,7 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
utilruntime.Must(logsapi.AddFeatureGates(utilfeature.DefaultMutableFeatureGate))
|
utilruntime.Must(logsapi.AddFeatureGates(utilfeature.DefaultMutableFeatureGate))
|
||||||
|
utilruntime.Must(features.AddFeatureGates(utilfeature.DefaultMutableFeatureGate))
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -205,6 +208,9 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
|
|||||||
var unsecuredMux *mux.PathRecorderMux
|
var unsecuredMux *mux.PathRecorderMux
|
||||||
if c.SecureServing != nil {
|
if c.SecureServing != nil {
|
||||||
unsecuredMux = genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging, healthzHandler)
|
unsecuredMux = genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging, healthzHandler)
|
||||||
|
if utilfeature.DefaultFeatureGate.Enabled(features.ComponentSLIs) {
|
||||||
|
slis.SLIMetricsWithReset{}.Install(unsecuredMux)
|
||||||
|
}
|
||||||
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication)
|
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication)
|
||||||
// TODO: handle stoppedCh and listenerStoppedCh returned by c.SecureServing.Serve
|
// TODO: handle stoppedCh and listenerStoppedCh returned by c.SecureServing.Serve
|
||||||
if _, _, err := c.SecureServing.Serve(handler, 0, stopCh); err != nil {
|
if _, _, err := c.SecureServing.Serve(handler, 0, stopCh); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user