Skip to content

health check: add optional alternative health check port#597

Merged
mattklein123 merged 7 commits intoenvoyproxy:masterfrom
dio:alt-hc-port
Apr 3, 2018
Merged

health check: add optional alternative health check port#597
mattklein123 merged 7 commits intoenvoyproxy:masterfrom
dio:alt-hc-port

Conversation

@dio
Copy link
Member

@dio dio commented Apr 2, 2018

This provides an alternative health check port, if set it allows an
upstream host to have different health check address port.

Ref: envoyproxy/envoy#439

Signed-off-by: Dhi Aurrahman dio@rockybars.com

This provides an alternative health check port, if set it allows an
upstream host to have different health check address port.

Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
htuch
htuch previously requested changes Apr 2, 2018
// By default the health check address port of an upstream host is the same as the host's serving
// address port. This provides an alternative health check port. If set it allows an upstream host
// to have different health check address port. The health checker should honor this.
uint32 health_check_port = 2;
Copy link
Member

Choose a reason for hiding this comment

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

I think we might eventually want something closer to

oneof port_specifier {
, but for now this is OK (we can always upgrade to a oneof without breaking wire compat).

//
// By default the health check address port of an upstream host is the same as the host's serving
// address port. This provides an alternative health check port. If set it allows an upstream host
// to have different health check address port. The health checker should honor this.
Copy link
Member

Choose a reason for hiding this comment

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

You can drop the last sentence, seems superfluous.


// [#not-implemented-hide:] Optional alternative health check port.
//
// By default the health check address port of an upstream host is the same as the host's serving
Copy link
Member

Choose a reason for hiding this comment

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

Presumably we're using uint32 rather than google.protobuf.UInt32Value because we can't possibly have a valid health check port of 0, since that doesn't make sense in TCP.

// The upstream host address.
core.Address address = 1;

// [#not-implemented-hide:] Optional alternative health check port.
Copy link
Member

Choose a reason for hiding this comment

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

How general is this? I'm wondering what other parameters might be configurable at the per-endpoint level, e.g. might we want to health check using TLS and a different cert, etc? Not really advocating to make this more complicated, but would like to make sure we have covered the potential endpoint health check specializations at least at the design level.

Copy link
Member Author

@dio dio Apr 2, 2018

Choose a reason for hiding this comment

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

Probably this thread from @codesuki on #envoy-users could be related too?

Copy link
Member

Choose a reason for hiding this comment

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

+1 at least from the proto perspective. Can you maybe add a new message such as HealthCheckConfig (or something like that), and then put the port override in there? Then we can add other things in the future if needed.

From a doc perspective, we should make it clear that health checking must be configured at the cluster level for these options to take any effect, etc.

@@ -18,7 +18,15 @@ option (gogoproto.equal_all) = true;

// Upstream host identifier.
message Endpoint {
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need each endpoint to have its own alternative health check port, or can this just be specified at cluster level?

Copy link
Member Author

Choose a reason for hiding this comment

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

Some related discussions:

From above threads, I perceived that providing an alternative health check port per endpoint is preferred.

Copy link
Member

Choose a reason for hiding this comment

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

I think per-host is likely required due to potentially dynamic ports on the service side. In the cluster general situation it's more verbose, but I don't think we are optimizing for lack of verbosity here so I think it's OK?

Copy link
Member

Choose a reason for hiding this comment

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

SGTM

@dio dio changed the title Add optional alternative health check port health check: add optional alternative health check port Apr 2, 2018
dio added 4 commits April 3, 2018 10:30
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
// as the host's serving address port. This provides an alternative health
// check port. If set it allows an upstream host to have different
// health check address port.
uint32 port_value = 1;
Copy link
Member

Choose a reason for hiding this comment

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

I assume 0 means no alt port? If so can we document that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Try to address this in 75662e3. Please let me know if that one is either good enough or need improvement. Thanks.

@htuch
Copy link
Member

htuch commented Apr 3, 2018

LGTM modulo comment from @mattklein123 .

Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
Copy link
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.

Thanks

@mattklein123 mattklein123 dismissed htuch’s stale review April 3, 2018 22:43

comments addressed

@mattklein123 mattklein123 merged commit 4210445 into envoyproxy:master Apr 3, 2018
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.

3 participants