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

Add http/2 support for haproxy router. #19968

Merged
merged 1 commit into from Jul 10, 2018

Conversation

@ramr
Contributor

ramr commented Jun 11, 2018

Adds http2 support for haproxy.
Ref: https://trello.com/c/qzvlzuyx/27-3-implement-router-http-2-support-terminating-at-the-router-router

To run:

$ oc adm router --latest-images=true
$ oc set env dc/router ROUTER_ENABLE_HTTP2=true
$ #  add edge secured and/or reencrypt routes:
$ #  Example: use routes from https://github.com/ramr/nodejs-header-echo

Test:

$ curl -k --http2 -vvv --resolve edge.header.test:443:127.0.0.1 https://edge.header.test/
$ curl -k --http2  -vvv --resolve reencrypt.header.test:443:127.0.0.1 https://reencrypt.header.test/

You should see that the protocol negotiation (between haproxy and the client) uses HTTP2 and there's a new header sent to the backend x-forwarded-proto-version: h2.

@ironcladlou @knobunc PTAL thx

@knobunc

This comment has been minimized.

Show comment
Hide comment
@knobunc

knobunc Jun 12, 2018

Contributor

/hold
This is a 3.11 feature.

Contributor

knobunc commented Jun 12, 2018

/hold
This is a 3.11 feature.

@knobunc

/lgtm
Can you add a docs PR for the environment variable please?

@openshift-ci-robot

This comment has been minimized.

Show comment
Hide comment
@openshift-ci-robot

openshift-ci-robot Jun 12, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knobunc, ramr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

openshift-ci-robot commented Jun 12, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: knobunc, ramr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr Jun 12, 2018

Contributor

@knobunc ack on submitting a docs PR.

Contributor

ramr commented Jun 12, 2018

@knobunc ack on submitting a docs PR.

@pravisankar

Minor comment otherwise LGTM

@@ -219,6 +219,7 @@ frontend fe_sni
{{- if isTrue (env "ROUTER_STRICT_SNI") }} strict-sni {{ end }}
{{- ""}} crt {{firstMatch ".+" .DefaultCertificate "/var/lib/haproxy/conf/default_pub_keys.pem"}}
{{- ""}} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy
{{- if isTrue (env "ROUTER_ENABLE_HTTP2") }} alpn h2,http/1.1{{ end }}

This comment has been minimized.

@pravisankar

pravisankar Jun 12, 2018

Contributor

Do we really need ROUTER_ENABLE_HTTP2 env when we know that protocol downgrade happen automatically based on the client?

@pravisankar

pravisankar Jun 12, 2018

Contributor

Do we really need ROUTER_ENABLE_HTTP2 env when we know that protocol downgrade happen automatically based on the client?

This comment has been minimized.

@ramr

ramr Jun 12, 2018

Contributor

It is intentionally disabled by default as per the requirements in the trello card: https://trello.com/c/qzvlzuyx/27-3-implement-router-http-2-support-terminating-at-the-router-router (Acceptance criteria bullet 1)

Edited trello link pointer

@ramr

ramr Jun 12, 2018

Contributor

It is intentionally disabled by default as per the requirements in the trello card: https://trello.com/c/qzvlzuyx/27-3-implement-router-http-2-support-terminating-at-the-router-router (Acceptance criteria bullet 1)

Edited trello link pointer

This comment has been minimized.

@ironcladlou

ironcladlou Jun 13, 2018

Member

What is the underlying justification of the cited requirement for a new piece of config? What are the specific risks of always enabling http2? When would a user want to disable it?

@ironcladlou

ironcladlou Jun 13, 2018

Member

What is the underlying justification of the cited requirement for a new piece of config? What are the specific risks of always enabling http2? When would a user want to disable it?

This comment has been minimized.

@ramr

ramr Jun 13, 2018

Contributor

So as re: your questions:
3. The flag is flipped ... in that it is disabled by default and has to be explicitly enabled by the user/admin.
2. I don't see risks to always enable http2 as we do downgrade the connections to http/1.x if http/2 is not supported but that said one reason I can see is this is a new feature (and so interactions with different/older clients are something to also consider) - making it more prudent to have a flag that enables it as needed.

  1. @knobunc can probably more on the cited requirement. Suspect it might be 2 but ...
@ramr

ramr Jun 13, 2018

Contributor

So as re: your questions:
3. The flag is flipped ... in that it is disabled by default and has to be explicitly enabled by the user/admin.
2. I don't see risks to always enable http2 as we do downgrade the connections to http/1.x if http/2 is not supported but that said one reason I can see is this is a new feature (and so interactions with different/older clients are something to also consider) - making it more prudent to have a flag that enables it as needed.

  1. @knobunc can probably more on the cited requirement. Suspect it might be 2 but ...

This comment has been minimized.

@knobunc

knobunc Jun 14, 2018

Contributor

Yeah, it's new in haproxy and there have already been security vulnerabilities around it. I want to let it soak for a while before turning it on all the time.

@knobunc

knobunc Jun 14, 2018

Contributor

Yeah, it's new in haproxy and there have already been security vulnerabilities around it. I want to let it soak for a while before turning it on all the time.

@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr Jun 12, 2018

Contributor

@pravisankar as re: your question on the call, to test protocol downgrade to as example http/1.0, use -0 with curl.
E.g. curl -0 -k -vvv --resolve reencrypt.header.test:443:127.0.0.1 https://reencrypt.header.test/

Contributor

ramr commented Jun 12, 2018

@pravisankar as re: your question on the call, to test protocol downgrade to as example http/1.0, use -0 with curl.
E.g. curl -0 -k -vvv --resolve reencrypt.header.test:443:127.0.0.1 https://reencrypt.header.test/

@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr Jun 12, 2018

Contributor

Associated docs PR: openshift/openshift-docs#10057

Contributor

ramr commented Jun 12, 2018

Associated docs PR: openshift/openshift-docs#10057

@smarterclayton

This comment has been minimized.

Show comment
Hide comment
@smarterclayton

smarterclayton Jun 12, 2018

Member

When would we enable this by default? How do we get enough soak testing on this to enable by default?

Member

smarterclayton commented Jun 12, 2018

When would we enable this by default? How do we get enough soak testing on this to enable by default?

@knobunc

This comment has been minimized.

Show comment
Hide comment
@knobunc

knobunc Jun 12, 2018

Contributor

@smarterclayton I'd enable it on int then starter in 3.11 and if all is well, enable by default in 3.12.

Contributor

knobunc commented Jun 12, 2018

@smarterclayton I'd enable it on int then starter in 3.11 and if all is well, enable by default in 3.12.

@knobunc

This comment has been minimized.

Show comment
Hide comment
@knobunc

knobunc Jun 27, 2018

Contributor

/hold cancel

Contributor

knobunc commented Jun 27, 2018

/hold cancel

@knobunc

This comment has been minimized.

Show comment
Hide comment
@knobunc

knobunc Jun 27, 2018

Contributor

/retest

Contributor

knobunc commented Jun 27, 2018

/retest

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

openshift-bot commented Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

openshift-bot commented Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

openshift-bot commented Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot

This comment has been minimized.

Show comment
Hide comment
@openshift-bot

openshift-bot Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

openshift-bot commented Jun 28, 2018

/retest

Please review the full test history for this PR and help us cut down flakes.

@ironcladlou

This comment has been minimized.

Show comment
Hide comment
@ironcladlou

ironcladlou Jul 6, 2018

Member

/retest

Member

ironcladlou commented Jul 6, 2018

/retest

1 similar comment
@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr Jul 9, 2018

Contributor

/retest

Contributor

ramr commented Jul 9, 2018

/retest

@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr Jul 10, 2018

Contributor

/test gcp

Contributor

ramr commented Jul 10, 2018

/test gcp

@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr Jul 10, 2018

Contributor

flake #19679

Contributor

ramr commented Jul 10, 2018

flake #19679

@ramr

This comment has been minimized.

Show comment
Hide comment
@ramr

ramr Jul 10, 2018

Contributor

/test gcp

Contributor

ramr commented Jul 10, 2018

/test gcp

@knobunc

This comment has been minimized.

Show comment
Hide comment
@knobunc

knobunc Jul 10, 2018

Contributor

/retest

Contributor

knobunc commented Jul 10, 2018

/retest

@openshift-merge-robot openshift-merge-robot merged commit d5b44a0 into openshift:master Jul 10, 2018

13 of 21 checks passed

ci/openshift-jenkins/cmd Jenkins job running.
Details
ci/openshift-jenkins/end_to_end Jenkins job running.
Details
ci/openshift-jenkins/extended_clusterup Jenkins job running.
Details
ci/openshift-jenkins/extended_conformance_install Jenkins job running.
Details
ci/prow/gcp Job triggered.
Details
ci/prow/integration Job triggered.
Details
ci/prow/unit Job triggered.
Details
ci/prow/verify Job triggered.
Details
ci/openshift-jenkins/cross Skipped
ci/openshift-jenkins/extended_builds Skipped
ci/openshift-jenkins/extended_image_ecosystem Skipped
ci/openshift-jenkins/extended_image_registry Skipped
ci/openshift-jenkins/gcp Skipped
ci/openshift-jenkins/integration Jenkins job succeeded.
Details
ci/openshift-jenkins/service-catalog Skipped
ci/openshift-jenkins/unit Skipped
ci/openshift-jenkins/verify Jenkins job succeeded.
Details
ci/prow/cross Skipped
ci/prow/launch-gcp Job succeeded.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
tide In merge pool.
Details

@ramr ramr deleted the ramr:haproxy-http2 branch Jul 11, 2018

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