-
Notifications
You must be signed in to change notification settings - Fork 591
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
Service-upstream default controlled by IngressClass parameters #1131
Comments
Note kubernetes/kubernetes#97396 - the parameters object can now be namespaced. |
I don't think this is the approach that the Ingress API intended controllers to adopt. Instead, Kong should accept a controller name via configuration, with a sensible default like you've chosen in the Helm chart, and it should only pay attention to IngressClass objects that use that same value in their "spec.controller" field. If Kong discovers an IngressClass that matches its controller name, it should honor the related parameters and serve Ingress objects using that IngressClass name, applying the related parameters when it does so. I don't get the impression that operators should start an ingress controller specifying the name of an IngressClass. What would you do if were told to watch an IngressClass named "kong" that specified something like Contour in its "spec.controller" field? |
Agreed, but that would be a breaking change. For historical reasons, KIC refers to the supported ingress class directly (by name), rather than having it linked by controller name. My intention when writing up this proposal was to leave the door open for the change you're recommending (i.e. use the controller name to link an ingress class with a controller instance), but not making it just yet. Another bit of complexity resulting from that change is that the controller name concept would naturally make the relationship between ingress classes and KIC instances a one-to-many relationship. Today KIC's implementation is limited to supporting only one ingress class at a time. Improving that is possible, but far from trivial. |
I understand the challenge, but I don't see how you can claim to support IngressClass if you treat their names specially. Object names are not supposed to matter semantically. If you require that operators specify the name of a specific IngressClass for a given Kong instance to use, then the "spec.controller" field is inconsequential. At best it happens to nominate Kong categorically, but in other cases you'd have to ignore it or fail to serve as soon as you read the offending value. On the upside, the field is immutable, so it can't change after you first read it. Given your position, it would be clearer if the Kong project just declared that it doesn't read IngressClass objects at all. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
First, some context: Feature requests such as #774 have shown that KIC needs a way to accept input parameters that will configure how KIC handles an ingress class as a whole. The
parameters
field ofIngressClass
that was added in k8s 1.18 seems like a good fit.This issue is about fixing #774 using the
IngressClass
resource by making the default value of the service-upstream annotation configurable.The scope of this issue is to:
IngressClass
resource whosename
is equal to the configured ingress class (if such resource is present in the cluster)IngressClass
's.spec.parameters
). That CRD is to be a container for ingress-class-level settings.ingress.kubernetes.io/service-upstream
annotation on referencedService
s. Before this change, the default value for this annotation isfalse
. After this change, the default value should be controlled by the setting added to the parameters CRD.Acceptance criteria:
IngressClass
resource is present, the newly added parameters field controls the default value of the service-upstream annotation forServices
referenced by that ingress classThe text was updated successfully, but these errors were encountered: