Skip to content

Commit eca5ca7

Browse files
jiahuifk8s-publishing-bot
authored andcommitted
HealthCheckable interface.
Kubernetes-commit: 42405442e71fb602d174e484051203ad86d70660
1 parent e9caa6b commit eca5ca7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

controller/interfaces.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ limitations under the License.
1616

1717
package controller
1818

19-
import "net/http"
19+
import (
20+
"net/http"
21+
22+
"k8s.io/controller-manager/pkg/healthz"
23+
)
2024

2125
// Interface defines the base of a controller managed by a controller manager
2226
type Interface interface {
@@ -36,3 +40,16 @@ type Debuggable interface {
3640
// The handler will be accessible at "/debug/controllers/{controllerName}/".
3741
DebuggingHandler() http.Handler
3842
}
43+
44+
// HealthCheckable defines a controller that allows the controller manager
45+
// to include it in the health checks.
46+
//
47+
// If a controller implements HealthCheckable, and the returned check
48+
// is not nil, the controller manager can expose the check to the
49+
// /healthz endpoint.
50+
type HealthCheckable interface {
51+
// HealthChecker returns a UnnamedHealthChecker that the controller manager
52+
// can choose to mount on the /healthz endpoint, or nil if no custom
53+
// health check is desired.
54+
HealthChecker() healthz.UnnamedHealthChecker
55+
}

0 commit comments

Comments
 (0)