Closed ChrisSwinchatt closed 6 years ago
I'm not part of the project, but this doesn't need to be explicitly supported in Ocelot. The way we work through this is by adding the MVC middleware prior to Ocelot. Because middlewares are processed in the same order as they are added, MVC will handle it first if it is added prior to Ocelot, but will still pass the request through to Ocelot if the request isn't handled.
e.g. in your app configuration...
app.UseMvc();
app.UseOcelot().Wait();
@philproctor
Oh, that's neat. Thanks!
Hi there,
I'm not sure if Ocelot can already do this, but I have an endpoint in my API gateway which is supposed to respond 200 whenever it gets a request, proving that the service is alive. We normally configure K8S to hit that endpoint every 30 seconds, but I can't find a way to do this with Ocelot. Any endpoint that doesn't match a reroute responds 404, and if you try to reroute it to itself, it loops until the request times out.
Please can you advise if this is an existing feature (or there's a reasonable workaround), or will be supported in future.
New Feature
Provide a way to expose endpoints without rerouting so that K8S probes can get a response from a specific endpoint. For example, create a new Allow array in ocelot.json which allows requests through without rerouting them. For example, if my endpoint is /probe, ocelot.json could look like this:
Motivation for New Feature
K8S restarts pods that don't respond to probes for 90 seconds, so the probes have to be disabled which is not ideal.
Steps to Reproduce the Problem
Specifications