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

Better modeling of a "virtual host" #49

Closed
bowei opened this issue Jan 23, 2020 · 16 comments
Closed

Better modeling of a "virtual host" #49

bowei opened this issue Jan 23, 2020 · 16 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@bowei
Copy link
Contributor

bowei commented Jan 23, 2020

This has come up in discussions about the split in functionality between Gateway and the set of Routes attached to a Gateway. See the meeting notes starting here:

The purpose of the split resource is model different permissions and delegation regarding assembly of a LB vs the application author (see "resource model" here: https://kubernetes-sigs.github.io/service-apis/concepts).

As currently sketched, we have virtualhost definitions in the Route while protocol e.g. TLS termination settings are determined in the Gateway. This presents an interesting twist regarding TLS certificates: it is part of a lower-level protocol layer that ties into higher layer HTTPx protocols. Also there are use cases such as support for TLS byte streams or TLS-based opaque routing.

At the same time, we need to be careful about allowing the admin persona control over security related policies, e.g. which certificates can/cannot be attached to a given gateway.

  • If TLS settings are specified at the Gateway level and virtualhost routing at the Route level, can we reduce the verbosity associated with this setup? This is information that needs to be consistent split between two resources.
  • Should the owner of a application (e.g. Route) be able to specific their own certificates and TLS policies? If this is allowed, how will this ability be controlled in a safe and effect way? OR does this just mean we should give the application developer access to the Gateway resource, as they are going to be introducing certificates anyway.

Proposal to get clarity:

  • Sketch out permissions models regarding what each permissions we see giving the different personas in each case.
  • Sketch out model with TLS stream and HTTPS models.
@bowei bowei added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 23, 2020
@danehans
Copy link
Contributor

API implementation example for adding tls config in routes: #35

@ironcladlou
Copy link
Contributor

/cc @smarterclayton

@danehans
Copy link
Contributor

danehans commented Feb 6, 2020

Sketch out permissions models regarding what each permissions we see giving the different personas in each case.

@bowei I've started working on this. PTAL at this drawing, which models TLS Config in HTTPRoute for the "Developer" persona. Let me know if I'm heading in the right direction. If so, I will expand to cover the different scenarios.

@danehans
Copy link
Contributor

danehans commented Feb 6, 2020

OR does this just mean we should give the application developer access to the Gateway resource, as they are going to be introducing certificates anyway.

If we give the Developer persona access to a Gateway, I question whether a separate resource (i.e. HTTPRoute should still exist.

@danehans
Copy link
Contributor

xref tls termination policy: #52

@jpeach
Copy link
Contributor

jpeach commented Feb 14, 2020

I've started working on this. PTAL at this drawing, which models TLS Config in HTTPRoute for the "Developer" persona

@danehans That diagram doesn't mention TLS config, so maybe I am missing some context?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 14, 2020
@hbagdi
Copy link
Contributor

hbagdi commented May 14, 2020

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 14, 2020
@hbagdi
Copy link
Contributor

hbagdi commented May 14, 2020

#193 addresses some concerns in this issue.

@costinm
Copy link

costinm commented May 21, 2020

I think it's a great change ! AllowedHostname[] is reasonable - it allows the domain owner to create a Gateway, set the cert and restrict which namespaces can use the domain. Assuming #197 is addressed ( i.e. allow using the namespace name ) - it seems viable.

I'm not very sure the usability of having port 443 and port 80 is great - it is extremely common to have the same hostname on both http and https ( with http doing redirect usually ). In this model, user will have to type every hostname 2x - once for the port 80 and once for port 443.
Instead the list of hostnames (hostname match or allowedhostnames) could be in Gateway at the top level, and can optionally include a port.

example:

Gateway:
   allowedHostnames:
     - www.example.com
     - admin.eample.com:443
     - *.test.example.com

   listeners:
     - port: 80
     - port: 443
        tls: 
          ....

@hbagdi
Copy link
Contributor

hbagdi commented May 21, 2020

In this model, user will have to type every hostname 2x - once for the port 80 and once for port 443.

Providing hostnames at the gateway layer implies that if you are mixing L4 and L7 listeners, and if there is no way to decide filter hostnames at a per listener level, that would lead to users configuring multiple Gateways. YAML's referencing (* and &) capabilities could help somewhat to avoid the duplication?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 19, 2020
@hbagdi
Copy link
Contributor

hbagdi commented Aug 19, 2020

@bowei @jpeach @robscott It seems we have settled on this one, can we close this one?

@jpeach
Copy link
Contributor

jpeach commented Aug 20, 2020

Yup, I'm happy yo close this out.

@hbagdi
Copy link
Contributor

hbagdi commented Aug 27, 2020

Closing this since we have consensus on this. If you disagree, please feel free to re-open.
/close

@k8s-ci-robot
Copy link
Contributor

@hbagdi: Closing this issue.

In response to this:

Closing this since we have consensus on this. If you disagree, please feel free to re-open.
/close

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.

jaison-tiu pushed a commit to jaison-tiu/gateway-api that referenced this issue Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
8 participants