-
Notifications
You must be signed in to change notification settings - Fork 690
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
IngressRoute does not honor kubernetes.io/ingress.class #720
Comments
I can confirm this issue. I was able to replicate it. |
Thanks for raising this issue.
Ingressroute crds aren’t subject to the ingress class annotation; they aren’t ingress objects.
Rather than slap on support for an ingressroute version of ingress class, could you please explain the problem you wanted to solve by reaching for ingress class? That helps me understand the underlying requirement.
… On 4 Oct 2018, at 07:38, Amos Kyler ***@***.***> wrote:
I can confirm this issue. I was able to replicate it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ah, the distinction between ingressroute and ingress annotations did not occur to me - makes sense. My use case: I currently solve for this using the Ingress resource with the ingress-class annotation. Ideally only routes which are assigned an ingress class will only be included in the DAG of that specific controller, and ignored by all others. |
My usecase, which works with Ingress but not with IngressRoute:
It is useful for our dev and staging and canary/prod environments to have their own ingress, so we have three classes:
Specifically in the dev environment, new mappings/routes/virtualhosts are created, and the stack breaks while folks work out a golden configuration that is promoted to staging. Specific to the staging environment, which does a loadtest, and a fuzz test, we should not interfere with production traffic. Operator access to the prod environment is restricted to release engineering / SRE. Using multiple ingress controllers, we can select IP addresses which are internal for dev/staging, and external for prod. We accomplish this with 3 ingress controllers today. In moving to Contour/Envoy, I'd like to be able to carry this model forward, but I'm open to other ways in which I can have traffic isolation between stacks, and expose subsets of our services per ingress controller. |
@pimvanpelt so you're using the same cluster for all environments? One way you could solve this without needing 3 controllers running is to utilize delegation. Configure Contour to only allow Root ingress routes in a specific namespace (this piece is optional but safer since it has more restrictions on who can create For example:
By doing this, any IngressRoute created within each environment can only utilize paths off of the Vhost that is delegated to them. The only downside which may be a deal breaker for you would be that you would mix the traffic for all the environments by implementing this way. |
@stevesloka Yes, we are using the same cluster. The traffic isolation is a mild concern, which we don't have today because we're using three Ingress pools. I haven't really gotten enough experience with IngressRoute, so I'll play around with your proposal. Envoy is not the performance bottleneck for us, so my concern on traffic isolation is a nice-to-have. It seems, that network restriction is not addressed by what you suggested, as my one envoy pool will have a public IP address, which is exposed to folks who have no business on dev/staging, unless contour can configure the envoy to accept traffic to a vhost only from a CIDR range? |
I would still like to push for full ingress-class separation. I do not do namespace based traffic separation. It is common for there to be some services which serve internal traffic and some which serve external traffic, even within the same namespace. This is accomplished by running two services with unique upstream load balancers & unique ingress controllers. This all occurs within the same environment. The lack of this feature blocks my ability to roll IngressRoutes out to my infrastructure. Are there any specific reasons to avoid supporting this feature? Perhaps there is another way to implement this paradigm using existing features? |
Here are a few thing that I think are possible for 0.7 which don't paint us into a corner in the future.
Here is what I propose a. We add a new annotation |
Could we have a label selector on namespaces, so each instance of contour would only select resources in namespaces that match a label selector? |
That's a good idea, but I'm concerned with the interaction between namespaces and labels. If we say "this contour looks for label |
Yup would work like services do, labels on a namespace to determine the ingress class. contour then just looks at labels when a resource is discovered. New namespaces will be added to the ingress class automatically. This then keeps the Ingressroute objects generic and non environment specific. Just thinking out loud looking for a way to not require all the annotations. |
Another use case related to #410 When we have "default tls" wired in it would be helpful to consider it's usage in this case as well. I know of a few folks that use a wildcard pattern and delegate the host side of the fqdn to teams. For example: Attract Then inform the team that when creating a new ingress resource they can follow that fqdn pattern.
This enables tls for the ingress resource and since the secret is not defined the controller uses the "default" cert for this and secures it with *.app.com I may want to service other domains this way as well. I like @stevesloka idea about label match on namespaces but this pattern would break that. As in most cases I would want to "call out" which ingress controller is wired right to satisfy this request. I can't wait to see what schemes we can cook up to solve this with ingressroute/contour :) |
Closed in #739 |
What steps did you take and what happened:
Running two contour pools, one called
contour-prod
and the othercontour-staging
(each setting the appropriate flag in--ingress-class-name
Two problems that signal that the annotation is not honored:
Problem 1
Setting
annotations.kubernetes.io/ingress.class: contour-staging
on an IngressRoute applies this to all running contour instances, not the specific one selected.This IngressRoute is as expected, created on nginx-staging:
This IngressRoute is NOT expected, it is not annotated to be created on nginx-prod:
Problem 2
Creating two IngressRoutes, one with contour-staging and one with contour-prod annotated, yields a conflict because both picked them up.
What did you expect to happen:
I expect in problem 1, that the curl on the contour-prod service fails.
I expect in problem 2, that:
Anything else you would like to add:
This problem is specific to the IngressRoute CRD. Normal Ingress objects do honor the annotation as per documentation, and I can successfully tie the nginx-prod -> contour-prod and nginx-staging -> contour-staging as per my expectations.
Environment:
Contour version:
docker-pullable://gcr.io/heptio-images/contour@sha256:8ef6d4f97ad678fab75fde095ee924b83881ade5acef37c80e485a02f12e9a37
Kubernetes version: (use
kubectl version
):Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T17:05:32Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T16:55:41Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
Kubernetes installer & version:
N/A.
Cloud provider or hardware configuration:
Baremetal; MetalLB loadbalancer.
OS (e.g. from
/etc/os-release
):Ubuntu Bionic LTS.
The text was updated successfully, but these errors were encountered: