-
Notifications
You must be signed in to change notification settings - Fork 681
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 Inclusion documentation for HTTPProxy #1573
Add Inclusion documentation for HTTPProxy #1573
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this. Just a bunch of nit picking comments but I think this is good to go on the next round.
Ok, my mistake.
… On 25 Sep 2019, at 16:10, Nick Young ***@***.***> wrote:
@youngnick commented on this pull request.
In docs/httpproxy.md:
> +Because the path is not necessarily used as the only key, the route space can be multi-dimensional.
+
+### Conditions and Inclusion
+
+Inclusions may be specified with conditions.
+These conditions are added to any conditions in the included HTTPProxy.
+This process repeated for any further inclusions as well.
+
+All [Conditions](#conditions) are supported for use with inclusion.
+The `prefix` condition is slightly special in that, when used for inclusion, any routes will have the value of `prefix` prepended to *their* prefix value.
+Header conditions are added to the conditions array.
+
+### Configuring inclusion
+
+Inclusion is a top-level part of the HTTPProxy `spec` element.
+It requires two fields, `name` and `namespace`, with the option of including a `conditions` block.
It's definitely required at the moment. I don't think it should be, but wanted to document current state.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
591137a
to
ff528cc
Compare
docs/httpproxy.md
Outdated
To resolve this Contour applies the following logic. | ||
|
||
- `prefix:` conditions are concatenated together in the order they were applied from the root object. For example the conditions, `prefix: /api`, `prefix: /v1` becomes a single `prefix: /api/v1` conditions. | ||
- Repeated identical `header:` conditions (the same `name`, match type, and `invert` values) are deduplicated to a single `header:` condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The invert
language is abstracted away from users. They only see exact
or notexact
(or contains
, notcontains
) to set that flag.
Headers aren't merged either. We should discuss what should happen in this case. Should there be some sort of merge? Throw an error back to the user? Or just let them all stack ending up in a potential situation where requests won't match since the route is too specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, I think they need to just be there, and we say that tautological conditions are an error.
Identical headers will end up deduplicated though, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change the invert part, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, master the headers are all just smashed together, so if someone duplicates headers, the route must match all the defined headers to route properly.
There's an issue open (#1559), which I thought we would define an error if headers were duplicated. Thoughts on that approach? I'm not sure if use-cases exist where a route should match multiple headers of the same key with different values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that they are deduplicated at the end when applied to Envoy - since setting a correctly-formed header is idempotent on a route (I assume). I think that contradictory headers should be an error, but exact matches (where the header name, value, and operator are the same)? That doesn't feel like an error to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, #1559 is probably the place for this discussion. Can we accept that this is the case for now, and get this one in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to merge, just want to be careful that we don't explain functionality that doesn't exist or could change and we confuse folks right at the beginning.
docs/httpproxy.md
Outdated
HTTPProxies can include other HTTPProxy objects in the namespace by specifying the name of the object and its namespace in the top-level `includes` block. | ||
Note that `includes` is a list, and so it must use the YAML list construct. | ||
|
||
In this example, the HTTPProxy `delegation-root` has included the configuration for paths matching `/service2` from the HTTPPRoxy named `service2` in the same namespace as `delegation-root` (the `default` namespace). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still use "delegation" in speaking about "include", but should we try and stray away? I'm not sure if it's confusing to users who know IngressRoute or not. In a sense, we're performing the same operation but in a different way. This is just me thinking out loud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should change the names, so that it's consistent, at least. Thanks.
I think that they're functionally the same, and it's probably okay in conversation, but I was trying to avoid being confusing in this reference documentation.
Note that `includes` is a list, and so it must use the YAML list construct. | ||
|
||
In this example, the HTTPProxy `delegation-root` has included the configuration for paths matching `/service2` from the HTTPPRoxy named `service2` in the same namespace as `delegation-root` (the `default` namespace). | ||
It's important to note that `service2` HTTPProxy has not defined a `virtualhost` property as it is NOT a root HTTPProxy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/service2/www/g ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, too much copypasta.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
#### Virtualhost aliases | ||
|
||
To present the same set of routes under multiple dns entries, for example www.example.com and example.com, including a service with a `prefix` condition of `/` can be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to do this so that you don't have to repeat the includes
section twice is to have each root include to a single Proxy, then that one includes a child proxy. You end up with an additional Proxy object, but changes to the includes that are passed down are in a single place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your example is 100% correct, again just me typing out loud.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay to be a bit more verbose in this, since it's a reference guide.
ff528cc
to
3d5063d
Compare
4836a4b
to
6dcee5b
Compare
Fixes projectcontour#1462 Update upgrading.md with HTTProxy docs, fixes projectcontour#1476 Signed-off-by: Nick Young <[email protected]>
6dcee5b
to
b4e862b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you. I'll merge this now.
Fixes #1462
Add link to HTTPProxy documentation to
upgrading.md
, fixes #1476Signed-off-by: Nick Young [email protected]