HealthCheckHandler
is an handler that can be used for health checks.
It works as:
HTTP Handler
Config yaml format becomes like below. And the resource specific spec is defined in in the proto format shown in the Resource Definition.
apiVersion: core/v1
kind: HealthCheckHandler
metadata:
name: "default"
namespace: "default"
spec: {}
The HealthCheckHandler returns a 200 OK status to the health check request.
HealthCheckHandler is defined in the proto/app/v1/handler/healthcheck.proto
1syntax = "proto3";
2package app.v1;
3
4import "buf/validate/validate.proto";
5import "core/v1/http.proto";
6import "kernel/resource.proto";
7
8option go_package = "github.com/aileron-gateway/aileron-gateway/apis/app/v1";
9
10// HealthCheckHandler resource definition.
11// apiVersion="app/v1", kind="HealthCheckHandler".
12message HealthCheckHandler {
13 string APIVersion = 1 [json_name = "apiVersion"];
14 string Kind = 2 [json_name = "kind"];
15 kernel.Metadata Metadata = 3 [json_name = "metadata"];
16 HealthCheckHandlerSpec Spec = 4 [json_name = "spec"];
17}
18
19// HealthCheckHandlerSpec is the specifications for the HealthCheckHandler object.
20message HealthCheckHandlerSpec {
21 // [OPTIONAL]
22 // ErrorHandler is the reference to a ErrorHandler object.
23 // Referred object must implement ErrorHandler interface.
24 // Default error handler is used when not set.
25 kernel.Reference ErrorHandler = 1 [json_name = "errorHandler"];
26
27 // [OPTIONAL]
28 // Patterns is path patterns that this handler
29 // is registered to a server.
30 // Default is not set, or empty string ["/"].
31 repeated string Patterns = 2 [json_name = "patterns"];
32
33 // [OPTIONA]
34 // Methods is the list of HTTP method this handler can handle.
35 // Note that it depends on the multiplexer, or HTTP router,
36 // that the server uses if this field is used or not.
37 // Default multiplexer does not use this field.
38 // Default is not set.
39 repeated core.v1.HTTPMethod Methods = 3 [json_name = "methods"];
40
41 // [OPTIONAL]
42 // Timeout is timeout duration in seconds.
43 // Unhealthy status will be returned when health checking excceeded this duration.
44 // Default is [30].
45 int32 Timeout = 4 [json_name = "timeout", (buf.validate.field).int32 = {gte : 0}];
46
47 // [OPTIONAL]
48 // ExternalProbes is the list of references to HealthChecker objects.
49 // Referred object must implement HealthChecker interface.
50 // No values by default.
51 repeated kernel.Reference ExternalProbes = 5 [json_name = "externalProbes"];
52}
このページは役に立ちましたか?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.