-
Notifications
You must be signed in to change notification settings - Fork 689
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
Decision: How do we implement *Class objects (IngressClass and GatewayClass) #2809
Comments
If you had 3 Contours, you would also currently need 3 data planes (Envoy deployments). That seems like a lot :) /cc @danehans |
Once we move to the go-control-plane xDS server, we have very easy control over which envoy gets what configuration. The architectural bit is that Contour would need to think about how to process multiple sets of xDS configuration. You'd also probably want a way to determine what ports each instance of Envoy gets configured with. I know there's some work on an operator happening, might be a nice way to program out what ip each envoy should bind to, etc. The biggest use-case of this that has come up is folks wanting an internal/external set of Contours running to handle different types of traffic. |
I think there are a number of key decisions:
To answer the first two questions, I'm leaning towards answering a more fundamental question: What's a Contour really? Is it a Contour deployment and its associated Envoys, a Contour deployment and its associated configuration and associated Envoys, or should we allow for a single Contour deployment to manage multiple sets of Envoys? If a "Contour" is a deployment and its associated Envoys, that leans us towards using the *Class configuration mechanisms to control any particular Contour's configuration. That means that a *Class is not just an identifier, but also implies a set of configuration options (which need to interact correctly with anything configured per Contour deployment, and the defaults). If we were to do this, it allows:
If a "Contour" is a deployment, its configuration, and its associated Envoys, that leans us towards not using the *Class configuration mechanism, and the *Class is a pointer to a specific Contour install only. In this case, you may have many classes pointing to a Contour as you wish, but they all will produce the same behavior.
Personally, I incline towards the latter, because it's more in keeping with Contour itself being simple. We can build additional complexity by reusing a simple building block (that is, a Contour deployment, it's associated config, and a set of Envoys), at the cost of needing to run more things. Additionally, I think in most cases that you really need different very configuration for Contour, you probably would need a separate set of Envoys for safety. The first approach would also allow this, but at the cost of a significant amount of development time and internal complexity for Contour. |
We have been assuming the latter (Contour & configuration & associated Envoys) in my team, and we are currently using ingress class name as a mechanism to choose which one to address. I think this model is easy to understand as a user, and like @youngnick mentions, it surely keeps Contour itself simpler. One question though: would moving configuration to *Class necessarily mean a change of the current model? Could there be a policy that says "all *Classes defined for single controller must refer to same parameters resource"? Maybe its a bit inconvenient and difficult to enforce, but I guess having configuration as a Kubernetes resource could have its advantages as well. |
@jpeach and I discussed this some more yesterday, here's a summary. Please correct me if I've missed anything @jpeach! We're inclining towards the latter model referenced above, more specifically:
The key thing here is that this keeps This leaves space for other components (like In addition, this model allows easy migration forward and backward between resource types - we may work on a tool similar to I'd like to hear from other interested parties. @stevesloka, @skriss, @danehans, @Miciah, @tsaarni? Anyone else interested in service-apis implementation is more than welcome to contribute here. I think the path forward is to get some consensus on if this proposed model is up to scratch, and, if it is, then we can move forward with both Ingress v1 and service-apis support. |
Can you give an example of where you'd have one Envoy deployment corresponding to >1 Gateways? I'm not quite following that. |
Gateways have listeners, and certain sets of listeners can be combined, either in the same Gateway, or in multiple gateways. This theoretically would allow us to expose multiple secure or multiple insecure ports, which people have asked for. In short, anything you can do in one Gateway by having multiple Listeners, you can do in multiple gateways of one listener each, as they may be merged. |
I'm confused by this statement. Don't the annotation and IngressClass refer to the same thing? That is, aren't Presumably IngressClass and GatewayClass are distinct namespaces though (that is, an IngressClass named "foo" and a GatewayClass named "foo" describe distinct things), which makes matters interesting for clusters where users want to use both Ingress v1 and Service APIs. @danehans, should we bring this use-case up for discussion on the next Service APIs call (or has it been addressed previously)? |
xref service api's implementation: https://github.com/GoogleCloudPlatform/gke-networking-recipes/tree/master/gateway |
I think this is changing (that is, Service APIs may change to prohibit merging): kubernetes-sigs/gateway-api#399 |
I think that the field may behave that way if you don't create an IngressClass object? I will need to go an check the API again, it's been a while. I think the key part is that in the model I'm proposing, it should be possible to have the same Contour installation deal with either Ingress objects (however their class is determined) and service-apis objects. |
Few comments/questions:
|
The maintainers discussed this in a catchup yesterday, and I believe this was the consensus we arrived at:
@jpeach, @skriss, @stevesloka, did I miss anything here? We'll leave this open to give the community a chance to comment, but I propose lazy consensus of one week, after which time, if there are no objections, we'll consider this decision resolved. |
To me this is up in the air at the moment as to if it's a new project or just part of Contour, but agree it's an implementation detail for later on. The current focus is on what Contour does today (e.g. HTTP L7).
What do you mean by this just to be clear @youngnick? |
This is a reasonable starting point. However, there's no way for several components to program the same Envoy data plane, so we may find that we need to revisit this.
I agree that a GatewayClass corresponds to a Envoy data plane deployment. I think the missing piece here is a controller to associate the data plane with the class. That is - you need to be able to deploy a data plane, then later on attach a Contour controller to the corresponding gateway class. The Envoy pods would automatically be reconfigured to connect to the Contour that is attached to the class.
Yep, I think we can make it work.
+1 |
There is a |
SGTM. Agree that we don't yet need to make a decision on where TCPRoute/UDPRoute code would live if we decide to built it. |
Okay, it's been a little more than a week, so I'm going to mark this as decided, and close it. This means that we can unblock both the service-apis work and the Ingress V1 work. |
xref: #3213 |
IngressClass (from Ingress v1) and GatewayClass (from service-apis) are both replacements-with-added-functionality for the
kubernetes.io/ingress.class
annotation. They both have fields that allow for Class-specific configuration to be applied.Currently, Contour is configured from a "file" - that is, a ConfigMap, and those config parameters can only be overridden by command-line flags (when present). We're explicitly trying to move away from command line flags for Contour, however.
This issue is to discuss and answer the question: What do we do to implementt he two types of *Class object?
Options off the top of my head to get things started:
Ideas welcomed!
The text was updated successfully, but these errors were encountered: