Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jpeach
Copy link
Contributor

@jpeach jpeach commented Jun 23, 2020

Add Contour config file for defaulting the HTTP protocol version
accepted by the proxy listener. This principally applies to HTTPS
listeners, where HTTP/1.1 and HTTP/2 can be accepted on the same
listener.

If no configuration is specified, all HTTP protocol versions are
automatically detected and supported. Otherwise, HTTP/1.1 and HTTP/2
can be individually toggled. There is no support for per-resource
configuration in this change, but it can easily be supported if
necessary.

The config file syntax looks like this:

default-http-versions:
- http/1.1
- http/2

This updates #2619.

Signed-off-by: James Peach [email protected]

@jpeach
Copy link
Contributor Author

jpeach commented Jun 23, 2020

Marked as draft. @youngnick LMK what you think of this approach.

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #2622 into master will increase coverage by 0.14%.
The diff coverage is 73.68%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2622      +/-   ##
==========================================
+ Coverage   76.78%   76.92%   +0.14%     
==========================================
  Files          71       71              
  Lines        5540     5591      +51     
==========================================
+ Hits         4254     4301      +47     
- Misses       1199     1203       +4     
  Partials       87       87              
Impacted Files Coverage Δ
cmd/contour/serve.go 0.00% <0.00%> (ø)
internal/dag/dag.go 93.82% <ø> (ø)
cmd/contour/servecontext.go 93.27% <100.00%> (+0.89%) ⬆️
internal/annotation/annotations.go 100.00% <100.00%> (ø)
internal/contour/listener.go 93.54% <100.00%> (+0.07%) ⬆️
internal/dag/builder.go 92.06% <100.00%> (ø)
internal/envoy/listener.go 97.58% <100.00%> (+0.34%) ⬆️

Copy link
Member

@youngnick youngnick left a comment

Choose a reason for hiding this comment

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

LGTM, nice work.

@jpeach jpeach force-pushed the default-http-versions branch 2 times, most recently from 844059c to c3d8821 Compare June 24, 2020 04:52
@jpeach jpeach marked this pull request as ready for review June 24, 2020 04:52
@jpeach
Copy link
Contributor Author

jpeach commented Jun 24, 2020

@youngnick added docs to configuration file page and fax

Copy link
Member

@youngnick youngnick left a comment

Choose a reason for hiding this comment

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

LGTM, nice FAQ.

@jpeach jpeach force-pushed the default-http-versions branch from c3d8821 to 08b73b2 Compare June 24, 2020 07:20
// "HTTP/1.1" and "HTTP/2".
//
// If this field not specified, all supported versions are accepted.
DefaultHTTPVersions []string `yaml:"default-http-versions"`
Copy link
Member

Choose a reason for hiding this comment

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

"Default" seems like the wrong term here, it's more like "Enabled" since this is overriding the "supported" versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The intention is to set the default HTTP versions for all the proxy objects. Later we can add per-proxy versions to the VirtualHost spec to override these defaults. This also gives us the space to add something like "enabled versions", which would restrict what can become the defaults.

// DefaultHTTPVersions defines the default set of HTTPS
// versions the proxy should accept. HTTP versions are
// strings of the form "HTTP/xx". Supported versions are
// "HTTP/1.1" and "HTTP/2".
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 need to include HTTP in the value? The parameter name specifies it can only be HTTP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not strictly necessary, but IMHO it reads better and makes the config more obvious :)

More importantly, the HTTPProxy CRD is designed with inclusion in mind, a feature that enables administrators to configure top-level ingress settings (for example, which virtual hosts are available to each team), while delegating the lower-level configuration (for example, the mapping between paths and backend services) to each development team.
More information about the HTTPProxy API can be found [in the HTTPProxy documentation][1].

# Q: When I load my site in Safari, it shows me an empty page. Developer tools show that the HTTP response was 421. Why does this happen?
Copy link
Member

Choose a reason for hiding this comment

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

Should we add the version tested of Safari? Presuming eventually in the future the issue gets resolved?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't be sure about the versions, so I'd prefer to update this if we ever find out there is a version that fixes the problem.

@jpeach jpeach added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 24, 2020
@jpeach jpeach force-pushed the default-http-versions branch from 08b73b2 to 290d068 Compare June 24, 2020 23:21
Add Contour config file for defaulting the HTTP protocol version
accepted by the proxy listener. This principally applies to HTTPS
listeners, where HTTP/1.1 and HTTP/2 can be accepted on the same
listener.

If no configuration is specified, all HTTP protocol versions are
automatically detected and supported. Otherwise, HTTP/1.1 and HTTP/2
can be individually toggled. There is no support for per-resource
configuration in this change, but it can easily be supported if
necessary.

The config file syntax looks like this:

```
default-http-versions:
- http/1.1
- http/2
```

This updates projectcontour#2619.

Signed-off-by: James Peach <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants