healthv3connect

package
v1.16.1-20240426201503... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: unknown License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HealthDiscoveryServiceStreamHealthCheckProcedure is the fully-qualified name of the
	// HealthDiscoveryService's StreamHealthCheck RPC.
	HealthDiscoveryServiceStreamHealthCheckProcedure = "/envoy.service.health.v3.HealthDiscoveryService/StreamHealthCheck"
	// HealthDiscoveryServiceFetchHealthCheckProcedure is the fully-qualified name of the
	// HealthDiscoveryService's FetchHealthCheck RPC.
	HealthDiscoveryServiceFetchHealthCheckProcedure = "/envoy.service.health.v3.HealthDiscoveryService/FetchHealthCheck"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// HealthDiscoveryServiceName is the fully-qualified name of the HealthDiscoveryService service.
	HealthDiscoveryServiceName = "envoy.service.health.v3.HealthDiscoveryService"
)

Variables

This section is empty.

Functions

func NewHealthDiscoveryServiceHandler

func NewHealthDiscoveryServiceHandler(svc HealthDiscoveryServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewHealthDiscoveryServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type HealthDiscoveryServiceClient

type HealthDiscoveryServiceClient interface {
	//  1. Envoy starts up and if its can_healthcheck option in the static
	//     bootstrap config is enabled, sends HealthCheckRequest to the management
	//     server. It supplies its capabilities (which protocol it can health check
	//     with, what zone it resides in, etc.).
	//  2. In response to (1), the management server designates this Envoy as a
	//     healthchecker to health check a subset of all upstream hosts for a given
	//     cluster (for example upstream Host 1 and Host 2). It streams
	//     HealthCheckSpecifier messages with cluster related configuration for all
	//     clusters this Envoy is designated to health check. Subsequent
	//     HealthCheckSpecifier message will be sent on changes to:
	//     a. Endpoints to health checks
	//     b. Per cluster configuration change
	//  3. Envoy creates a health probe based on the HealthCheck config and sends
	//     it to endpoint(ip:port) of Host 1 and 2. Based on the HealthCheck
	//     configuration Envoy waits upon the arrival of the probe response and
	//     looks at the content of the response to decide whether the endpoint is
	//     healthy or not. If a response hasn't been received within the timeout
	//     interval, the endpoint health status is considered TIMEOUT.
	//  4. Envoy reports results back in an EndpointHealthResponse message.
	//     Envoy streams responses as often as the interval configured by the
	//     management server in HealthCheckSpecifier.
	//  5. The management Server collects health statuses for all endpoints in the
	//     cluster (for all clusters) and uses this information to construct
	//     EndpointDiscoveryResponse messages.
	//  6. Once Envoy has a list of upstream endpoints to send traffic to, it load
	//     balances traffic to them without additional health checking. It may
	//     use inline healthcheck (i.e. consider endpoint UNHEALTHY if connection
	//     failed to a particular endpoint to account for health status propagation
	//     delay between HDS and EDS).
	//
	// By default, can_healthcheck is true. If can_healthcheck is false, Cluster
	// configuration may not contain HealthCheck message.
	// TODO(htuch): How is can_healthcheck communicated to CDS to ensure the above
	// invariant?
	// TODO(htuch): Add @amb67's diagram.
	StreamHealthCheck(context.Context) *connect.BidiStreamForClient[v3.HealthCheckRequestOrEndpointHealthResponse, v3.HealthCheckSpecifier]
	// TODO(htuch): Unlike the gRPC version, there is no stream-based binding of
	// request/response. Should we add an identifier to the HealthCheckSpecifier
	// to bind with the response?
	FetchHealthCheck(context.Context, *connect.Request[v3.HealthCheckRequestOrEndpointHealthResponse]) (*connect.Response[v3.HealthCheckSpecifier], error)
}

HealthDiscoveryServiceClient is a client for the envoy.service.health.v3.HealthDiscoveryService service.

func NewHealthDiscoveryServiceClient

func NewHealthDiscoveryServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HealthDiscoveryServiceClient

NewHealthDiscoveryServiceClient constructs a client for the envoy.service.health.v3.HealthDiscoveryService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type HealthDiscoveryServiceHandler

type HealthDiscoveryServiceHandler interface {
	//  1. Envoy starts up and if its can_healthcheck option in the static
	//     bootstrap config is enabled, sends HealthCheckRequest to the management
	//     server. It supplies its capabilities (which protocol it can health check
	//     with, what zone it resides in, etc.).
	//  2. In response to (1), the management server designates this Envoy as a
	//     healthchecker to health check a subset of all upstream hosts for a given
	//     cluster (for example upstream Host 1 and Host 2). It streams
	//     HealthCheckSpecifier messages with cluster related configuration for all
	//     clusters this Envoy is designated to health check. Subsequent
	//     HealthCheckSpecifier message will be sent on changes to:
	//     a. Endpoints to health checks
	//     b. Per cluster configuration change
	//  3. Envoy creates a health probe based on the HealthCheck config and sends
	//     it to endpoint(ip:port) of Host 1 and 2. Based on the HealthCheck
	//     configuration Envoy waits upon the arrival of the probe response and
	//     looks at the content of the response to decide whether the endpoint is
	//     healthy or not. If a response hasn't been received within the timeout
	//     interval, the endpoint health status is considered TIMEOUT.
	//  4. Envoy reports results back in an EndpointHealthResponse message.
	//     Envoy streams responses as often as the interval configured by the
	//     management server in HealthCheckSpecifier.
	//  5. The management Server collects health statuses for all endpoints in the
	//     cluster (for all clusters) and uses this information to construct
	//     EndpointDiscoveryResponse messages.
	//  6. Once Envoy has a list of upstream endpoints to send traffic to, it load
	//     balances traffic to them without additional health checking. It may
	//     use inline healthcheck (i.e. consider endpoint UNHEALTHY if connection
	//     failed to a particular endpoint to account for health status propagation
	//     delay between HDS and EDS).
	//
	// By default, can_healthcheck is true. If can_healthcheck is false, Cluster
	// configuration may not contain HealthCheck message.
	// TODO(htuch): How is can_healthcheck communicated to CDS to ensure the above
	// invariant?
	// TODO(htuch): Add @amb67's diagram.
	StreamHealthCheck(context.Context, *connect.BidiStream[v3.HealthCheckRequestOrEndpointHealthResponse, v3.HealthCheckSpecifier]) error
	// TODO(htuch): Unlike the gRPC version, there is no stream-based binding of
	// request/response. Should we add an identifier to the HealthCheckSpecifier
	// to bind with the response?
	FetchHealthCheck(context.Context, *connect.Request[v3.HealthCheckRequestOrEndpointHealthResponse]) (*connect.Response[v3.HealthCheckSpecifier], error)
}

HealthDiscoveryServiceHandler is an implementation of the envoy.service.health.v3.HealthDiscoveryService service.

type UnimplementedHealthDiscoveryServiceHandler

type UnimplementedHealthDiscoveryServiceHandler struct{}

UnimplementedHealthDiscoveryServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedHealthDiscoveryServiceHandler) FetchHealthCheck

func (UnimplementedHealthDiscoveryServiceHandler) StreamHealthCheck

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL