Skip to content

GRPC-native healthcheck config option#383

Merged
htuch merged 1 commit intoenvoyproxy:masterfrom
baranov1ch:grpc-healthcheck
Jan 3, 2018
Merged

GRPC-native healthcheck config option#383
htuch merged 1 commit intoenvoyproxy:masterfrom
baranov1ch:grpc-healthcheck

Conversation

@baranov1ch
Copy link
Copy Markdown
Contributor

Part of the work on
envoyproxy/envoy#369

@mattklein123
Copy link
Copy Markdown
Member

@baranov1ch in general LGTM, thank you for your contribution! If you are going to work on envoyproxy/envoy#369 can you please comment there so that we don't duplicate effort? Also this PR will need DCO/docs fixed. Please see failing tests and contribution guide.

// for details.
message GrpcHealthCheck {
// Name of the service to perform check on.
string service = 1;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Envoy uses the term cluster for gRPC. Shall we be consistent with it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea was that this is what will be sent in service field in HealthCheckRequest:
https://github.com/grpc/grpc/blob/master/src/proto/grpc/health/v1/health.proto#L21. Would calling it cluster cause more confusion about how this maps on gRPC health protocol?

// See `GRPC doc <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`
// for details.
message GrpcHealthCheck {
// Name of the service to perform check on.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name => The name.

Please give an example for each field whenever possible.

message GrpcHealthCheck {
// Name of the service to perform check on.
string service = 1;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we send a health check request to a gRPC service? What the request looks like? What is the response would be? How does the client knows whether to use mTLS to send the request or something else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I understand the question correctly. Standard gRPC health protocol will be used, it was chosen here. As for mTLS, I don't think gRPC healthcheck differs from usual HTTP one - all transport layer security stuff is defined in tls_context of the cluster being health-checked.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup exactly. Cluster connection options are used.

@baranov1ch baranov1ch force-pushed the grpc-healthcheck branch 2 times, most recently from 5548a9c to 2031e7a Compare January 3, 2018 10:50
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for making this happening.

// See `GRPC doc <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`
// for details.
message GrpcHealthCheck {
// The name of the service to perform check on.
Copy link
Copy Markdown
Member

@htuch htuch Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go with service terminology, maybe be extra specific and clearly state something like: The semantics of service names are provided in https://github.com/grpc/grpc/blob/master/doc/health-checking.md. If we go with cluster terminology, please provide a similar mapping.

If we think of upstreams as always being part of an Envoy mesh, then cluster ~= service, and it would be good to stick to have consistent terminology as per @wora comment. OTOH, whenever we impedance match with the gRPC world, we end up having to bridge the cluster/service gap (I'm doing this right now when integrating with the Google gRPC library implementation). In general, endpoints might be Google gRPC and not Envoy, at which point it makes more sense to use the "service name" terminology.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to service_name. I've also added more elaborated comment on it and its connection with gRPC health protocol.

}

// [#not-implemented-hide:] grpc.health.v1.Health-based healthcheck.
// See `GRPC doc <https://github.com/grpc/grpc/blob/master/doc/health-checking.md>`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need a trailing underscore for this to render as an external link. Please validate the docs output for this by temporarily deleting the #not-implemented-hide and viewing docs in a browser.

Copy link
Copy Markdown
Contributor Author

@baranov1ch baranov1ch Jan 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed. I've looked through uncommented html, now looks fine:)

Part of the work on
envoyproxy/envoy#369

Signed-off-by: Alexey Baranov <me@kotiki.cc>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@htuch htuch merged commit 4b80746 into envoyproxy:master Jan 3, 2018
@wora
Copy link
Copy Markdown
Contributor

wora commented Jan 3, 2018

Thanks. This looks very nice.

In general, the proto spec should be self contained. It is what developers would read and write code against. We should not force developers to know things not mentioned by the proto files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants