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

internal/dag: create separate roots for port 80 and port 443 vhosts #431

Merged
merged 5 commits into from
Jun 11, 2018

Conversation

davecheney
Copy link
Contributor

@davecheney davecheney commented Jun 8, 2018

Updates #429

This PR alters the DAG generation to create unique roots for each host/port combination. This embeds more information into the dag, for example, the port number of a vhost is no longer determined by the presence of a child secret object. Now the port a vhost listens on and if it uses TLS is independent -- although a vhost must have a child secret to be TLS enabled.

With this in place we can now start to generate different route graphs for the port 80 and port 443 listeners. This PR includes an example of this by adding support for the kubernetes.io/ingress.allow-http: "false" annotation.

It should be noted that TLS objects will never be attached to virtualhosts that do not have hostnames. See #410 for details.

graph

Updates projectcontour#429

Each VirtualHost now has a Port field; VirtualHosts are unequal unless
both their host name and port match.

Signed-off-by: Dave Cheney <dave@cheney.net>
Signed-off-by: Dave Cheney <dave@cheney.net>
Avoid declaring nodes and edges more than once. For nodes this is fine
because dot edit overwrites the declaration, or places them on top of
one another. For edges this causes duplicate arrows when the dag
converges.

Signed-off-by: Dave Cheney <dave@cheney.net>
For TLS enabled sites, generate a second vhost entry to hold the
certificate.

Also bring in internal/contour's annotations package.

TODO(move annotation processing to its own package)

Signed-off-by: Dave Cheney <dave@cheney.net>
@davecheney davecheney added this to the 0.6.0-beta.1 milestone Jun 8, 2018
@jbeda
Copy link
Contributor

jbeda commented Jun 8, 2018

This looks like a good approach to me. This allows us to have more flexibility in the future and perhaps (if we can figure out the config story) having a contour instance listening on multiple ports for both HTTP and HTTPs.

I could also see us expanding this (eventually, over time, with a lot of thinking) to represent TCP/UDP. The idea being that there is a "vhost" of *:123 where anything other than a prefix of / is unsupported and it forwards to a service.

The kubernetes.io/ingress.allow-http: false annotation prevent the
creation of any port 80 listeners for ingresses carrying this
annotation.

Signed-off-by: Dave Cheney <dave@cheney.net>
@davecheney davecheney merged commit 196dc62 into projectcontour:master Jun 11, 2018
@davecheney davecheney deleted the issue/429 branch June 11, 2018 15:28
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.

2 participants