Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application Load Balancer Support for End-to-End HTTP/2 #458

Closed
wants to merge 1 commit into from

Conversation

universam1
Copy link
Contributor

ref: https://aws.amazon.com/de/blogs/aws/new-application-load-balancer-support-for-end-to-end-http-2-and-grpc/

Currently HTTP/2 is only half way implemented, that is the ALB can be configured for HTTP/2 but the TargetGroup is not configured.
This is probably due to the AWS delay of supporting that protocal version for the TargetGroup which is available in meantime.

There is however an update missing for mweagle/go-cloudformation which is deprecated, thus a fork has been made that includes this Cloudformation feature: o11n/go-cloudformation@b975e65

fixes #391

@universam1
Copy link
Contributor Author

universam1 commented Dec 9, 2021

@szuecs I assume Zalando would be more inclined to fork mweagle/go-cloudformation themselves and apply the mentioned patch there?

Comment on lines 481 to 485
if spec.http2 {
targetGroup.ProtocolVersion = cloudformation.String("HTTP2")
} else {
targetGroup.ProtocolVersion = cloudformation.String("HTTP1")
}
Copy link
Member

Choose a reason for hiding this comment

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

spec.http2 is true by default. If I get it right this change would enable HTTP/2 on the target group and according to this table https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html#target-group-protocol-version

Request protocol Protocol version Result
HTTP/1.1 HTTP/2 Error
HTTP/2 HTTP/2 Success

this change

  • is not backward-compatible as default protocol version is HTTP/1.1
  • would not work if target supports only HTTP/1.1
  • will disable HTTP/1.1 incoming requests

If that is correct then we may probably need to have a new flag and/or annotation to steer Target Group protocol version independently and backward-compatible.

Besides that HTTP/2 is only supported in conjunction with HTTPS protocol so this kind of config should be around here

} else if spec.targetHTTPS {
protocol = "HTTPS"
healthCheckProtocol = "HTTPS"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is true, the http/2 TG protocol is a breaking change for http/1.1 clients. Looking for a procedure how to deal with while supporting end-to-end, found this statement: https://stackoverflow.com/a/66800142

Probably going to open a case at AWS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

It also shows the complexity that everything is based on the client. I am thinking for a while to support h2c in skipper, but the current implementations have some critical bugs and if we would be able to serve it then I also do not know if grpc backends can listen on handlers without TLS....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AlexanderYastrebov interestingly the protocol H2 can be set via AWS console also for non-https target groups, also I found that documented in the TF provider https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_target_group#protocol_version

Nevertheless I implemented as requested

@AlexanderYastrebov
Copy link
Member

I assume Zalando would be more inclined to fork mweagle/go-cloudformation themselves and apply the mentioned patch there?

The https://github.com/mweagle/go-cloudformation#this-repo-is-no-longer-supported suggests to move to https://github.com/awslabs/goformation which is most likely will be a large undertaking

@universam1 universam1 changed the title Application Load Balancer Support for End-to-End HTTP/2 Draft: Application Load Balancer Support for End-to-End HTTP/2 Dec 9, 2021
@universam1
Copy link
Contributor Author

I assume Zalando would be more inclined to fork mweagle/go-cloudformation themselves and apply the mentioned patch there?

The https://github.com/mweagle/go-cloudformation#this-repo-is-no-longer-supported suggests to move to https://github.com/awslabs/goformation which is most likely will be a large undertaking

This PR is naive mainly to trigger a decision where to go with the stale dependency

@szuecs
Copy link
Member

szuecs commented Dec 9, 2021

In the long run we should migrate to https://github.com/awslabs/goformation. In general I don't mind to use a fork of an unmaintained library if this buys us some time to migrate to a more supported or better version.
@universam1 do you want to do ALB -> grpc-application or do you want to pass this through skipper?
For the latter I think there is some more work required for the former: why don't you use NLB instead?

@AlexanderYastrebov AlexanderYastrebov marked this pull request as draft December 9, 2021 15:51
@universam1
Copy link
Contributor Author

In the long run we should migrate to https://github.com/awslabs/goformation. In general I don't mind to use a fork of an unmaintained library if this buys us some time to migrate to a more supported or better version. @universam1 do you want to do ALB -> grpc-application or do you want to pass this through skipper? For the latter I think there is some more work required for the former: why don't you use NLB instead?

Primary goal is to support http/2 pass-thru or end-to-end. Currently that is cross converted loosing the main benefits, see https://stackoverflow.com/a/36057190

@szuecs do you suggest replacing ALBs with NLBs for that use case? Not much experience with that type of LB, sounds counter intuitive using an OSI 4 LB for OSI 7 application

@universam1 universam1 force-pushed the http2End2End branch 2 times, most recently from 6fb36ed to 8536f77 Compare December 10, 2021 10:00
@universam1 universam1 changed the title Draft: Application Load Balancer Support for End-to-End HTTP/2 Application Load Balancer Support for End-to-End HTTP/2 Dec 10, 2021
ref: https://aws.amazon.com/de/blogs/aws/new-application-load-balancer-support-for-end-to-end-http-2-and-grpc/

Currently HTTP/2 is only half way implemented, that is the ALB can be configured for HTTP/2 but the TargetGroup is not configured.
This is probably due to the AWS delay of supporting that protocal version for the TargetGroup which is available in meantime.

There is however an update missing for `mweagle/go-cloudformation` which is deprecated, thus a fork has been made that includes this Cloudformation feature: o11n/go-cloudformation@b975e65

Signed-off-by: Samuel Lang <gh@lang-sam.de>
@universam1
Copy link
Contributor Author

@AlexanderYastrebov @szuecs despite of the AWS ALB compatibility limitations this PR is tested and it does work as expected. Added a feature toggle in order not to break compatibility.
Let me know if there is anything else, thanks

@@ -614,6 +619,38 @@ func TestGenerateTemplate(t *testing.T) {
require.NotEqual(t, cloudformation.Integer(3), tg.UnhealthyThresholdCount)
},
},
{
name: "target port http2 when https listener and configured",

Choose a reason for hiding this comment

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

@universam1 should be there a test case for GRPC as well?

Copy link
Member

Choose a reason for hiding this comment

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

gRPC is using H2, so I guess this test is good enough, no?

@dhohengassner
Copy link

@universam1 thanks for implementing - good to have these additional options ready 👍

@szuecs
Copy link
Member

szuecs commented Dec 10, 2021

@universam1 I just wanted to understand if possible options were thought about (NLB vs ALB with grpc TG). In general the less the load balancer has to do the better for latency. NLB would not break grpc I think, so that's why I asked. I have nothing against the PR itself and have no suggestions besides to answer other open comments.
Maybe @AlexanderYastrebov has more input.

@universam1 universam1 closed this Dec 10, 2021
@universam1
Copy link
Contributor Author

@AlexanderYastrebov @szuecs Sorry accidentally closed this PR by force pushing the commit, reopened here #460

@szuecs
Copy link
Member

szuecs commented Dec 10, 2021

no worries

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.

HTTP/2 not enabled for target groups
4 participants