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

Introduce virtual servers as a concrete type. #101

Closed
wants to merge 2 commits into from

Conversation

jpeach
Copy link
Contributor

@jpeach jpeach commented Feb 16, 2020

This is an RFC sketch for discussion, not intended to be merged. Please do not merge.

Since the HTTPRoute terminates traffic (either HTTP or TLS), it behaves
more like an endpoint than list a route. Introducinng the explicit concept
of a virtual server improves the clarity of the object model by renaming
the existing Route objects using terminology that better describes what
they do.

Now that we have virtual server terminology, attach TLS information at
the server layer. This gives an explicit association between network
applications (as represented by a virtual server) and their TLS
configuration.

Listeners are still resources that are attached to a gateway, but they not
have a type, which can be "combined" or "dedicated". Dedicated listeners
host up to 1 virtual server, where combined listeners may host many
virtual servers. Combined listeners must have a discriminator in the
server protocol stack, which the controller implementation is required
to validate.

The TLS configuration is barely a sketch, but it consists of the
configuration for the comunicating party and a conviguration for
validating its peer. It's not yet clear to me if this structure will
suffice for both initiators and receivers.

Signed-off-by: James Peach jpeach@vmware.com

xref #72
xref #94
xref #49

Since the HTTPRoute terminates traffic (either HTTP or TLS), it behaves
more like an endpoint than list a route. Introducinng the explicit concept
of a virtual server improves the clarity of the object model by renaming
the existing Route objects using terminology that better describes what
they do.

Now that we have virtual server terminology, attach TLS information at
the server layer. This gives an explicit association between network
applications (as represented by a virtual server) and their TLS
configuration.

Listeners are still resources that are attached to a gateway, but they not
have a type, which can be "combined" or "dedicated". Dedicated listeners
host up to 1 virtual server, where combined listeners may host many
virtual servers. Combined listeners must have a discriminator in the
server protocol stack, which the controller implementation is required
to validate.

The TLS configuration is barely a sketch, but it consists of the
configuration for the comunicating party and a conviguration for
validating its peer. It's not yet clear to me if this structure will
suffice for both initiators and receivers.

Signed-off-by: James Peach <jpeach@vmware.com>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 16, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @jpeach. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 16, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jpeach
To complete the pull request process, please assign thockin
You can assign the PR to them by writing /assign @thockin in a comment when ready.

The full list of commands accepted by this bot can be found 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

@jpeach
Copy link
Contributor Author

jpeach commented Feb 16, 2020

/cc @youngnick @danehans

@bowei
Copy link
Contributor

bowei commented Feb 16, 2020

This is pretty complicated for the end user. Can you add a few sketches as to what this looks on a config level to your PR description.

// - gcp: https://cloud.google.com/load-balancing/docs/use-ssl-policies#creating_an_ssl_policy_with_a_custom_profile
// - aws: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies
// - azure: https://docs.microsoft.com/en-us/azure/app-service/configure-ssl-bindings#enforce-tls-1112
type TLSConfiguration struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned in on a related issue, for the intial API, most these things will be placed in implementation-specific extensions.

We unfortunately need to consider a subset for the core and extended APIs.

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 doesn't change the items that can be configured much. The main thing here is that I break out an explicit (but currently un-specced) object for TLS peer validation. I think that's a useful approach that will help us manage the different concerns around TLS config.

Copy link
Contributor

Choose a reason for hiding this comment

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

For usability I would like to see a more simplified names, i.e. TLSConfig or TLSOptions.

const ListenerProtocolTCP ListenerProtocolType = "TCP"
const ListenerProtocolUDP ListenerProtocolType = "UDP"

type Listenertype string
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doh!

Signed-off-by: James Peach <jpeach@vmware.com>
@bowei
Copy link
Contributor

bowei commented Feb 16, 2020

For my own understanding:

  1. Push TLS configuration down to the Route level (What you've renamed "xxxServer").
  2. Added a flag for validating listener <=> server hostnames is singular.

How do we control who specifies a cert if we don't want the app dev to be able to select their own TLS configuration?
This loses some of the split of responsibility that we've had in the other separation.

@jpeach
Copy link
Contributor Author

jpeach commented Feb 17, 2020

How do we control who specifies a cert if we don't want the app dev to be able to select their own TLS configuration?

Do we need to capture a user story for this? This PR explores how to associate a TLS config with an endpoint (virtual host), but you can imagine there's more than one way to do that. We could have another object reference to the secrets in a TLS config, or we could reference TLS configurations by name.

This loses some of the split of responsibility that we've had in the other separation.

The other separation suffers from the problem that the API doesn't easily express how virtual hosts are associated with their TLS configuration. This association is a pretty fundamental property of an application, so I think that exposing it in the API is important.

We can still allow the responsibility for TLS (keys in particular) to be split, while preserving this association.

@danehans
Copy link
Contributor

/hold since the intention of this PR is for discussion only.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 17, 2020

type Listenertype string

// DedicatedListenerType describes a listener with exactly on attached server.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/on/one/

// All traffic received by this listener is terminated by this server.
const DedicatedListenerType ListenerType = "Dedicated"

// CombinedListenerType describes a listener what may have multiple attached
Copy link
Contributor

Choose a reason for hiding this comment

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

s/what/that/

// CombinedListenerType describes a listener what may have multiple attached
// servers. The protocol recognized by this listener must have a discriminator
// that can be used to select the appropriate server for the incoming request.
// In the case of a streaming data over TLS, the ALPN protocol name can sepect
Copy link
Contributor

Choose a reason for hiding this comment

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

sepect... do you mean inspect?

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 think I meant to say "the ALPN protocol name can be used to select".

// that can be used to select the appropriate server for the incoming request.
// In the case of a streaming data over TLS, the ALPN protocol name can sepect
// between different StreamServer specification. In the case of HTTP traffic,
// the HTTP Host (i.e. H2 authority) provides the discriminator.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "HTTP Host" the Host header? If so, please add the word header.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is SNI server_name considered a discriminator for 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.

Yep, this is the Host header (aka HTTP/2 authority header).

Right, SNI would be the TLS discriminator.

// The ALPNProtocols field in this TLSAcceptor must contain only valid
// HTTP protocol identifiers, i.e. "http/0.9", "http/1.0", "http/1.1",
// "h2". Implementations may accept only a subset of these values if
// the underlying proxy implementation does not implement the
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove "proxy".

// TLSInitiator describes the TLS configuration for a party that initiates TLS
// sessions.
//
// TODO(jpeach): consider merging TLSAcceptor and TLSInitiator if it turns out
Copy link
Contributor

Choose a reason for hiding this comment

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

I think removing TLSInitiator and TLSAcceptor and embedding TLSConfiguration in types will reduce complexity for users. If we find that an initiator and acceptor require different properties then let's introduce the additional complexity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeh, I ended up thinking something similar. I think that the separation between configuration and peer validation makes sense. I'm not sold that initiator vs. acceptor is needed :)

@danehans
Copy link
Contributor

How do we control who specifies a cert if we don't want the app dev to be able to select their own TLS configuration?
This loses some of the split of responsibility that we've had in the other separation.

@bowei @jpeach IMO we need to get #95 resolved to move forward with this or any of the other PR's that address TLS.

/cc @Miciah

@k8s-ci-robot
Copy link
Contributor

@danehans: GitHub didn't allow me to request PR reviews from the following users: Miciah.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

How do we control who specifies a cert if we don't want the app dev to be able to select their own TLS configuration?
This loses some of the split of responsibility that we've had in the other separation.

@bowei @jpeach IMO we need to get #95 resolved to move forward with this or any of the other PR's that address TLS.

/cc @Miciah

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@youngnick
Copy link
Contributor

Yeah, I agree that #95 is a good place to coalesce around until we get the underlying API type definitions sorted out.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 27, 2020
@k8s-ci-robot
Copy link
Contributor

@jpeach: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

This was referenced Feb 28, 2020
@bowei
Copy link
Contributor

bowei commented Mar 4, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 4, 2020
@k8s-ci-robot
Copy link
Contributor

@jpeach: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-service-apis-golint 83bcedd link /test pull-service-apis-golint
pull-service-apis-gofmt 83bcedd link /test pull-service-apis-gofmt
pull-service-apis-docs 83bcedd link /test pull-service-apis-docs
pull-service-apis-build 83bcedd link /test pull-service-apis-build
pull-service-apis-boilerplate 83bcedd link /test pull-service-apis-boilerplate

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@jpeach jpeach closed this Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants