Fix issue #936: Kubernetes service discovery provider doesn't allow cross-namespace discovery (#938)

* Allow default k8s namespace to be overridden

* Add ServiceNamespace to ReRoute configuration

* Remove debug comments

* Update unit tests

* Unit tests (Eureka)

* Update docs

* Re-run build
This commit is contained in:
Jason Morton
2019-06-25 04:08:18 +01:00
committed by Thiago Loureiro
parent 959a92ec6a
commit e1d7f28951
13 changed files with 65 additions and 20 deletions

View File

@ -75,3 +75,21 @@ The polling interval is in milliseconds and tells Ocelot how often to call kuber
Please note there are tradeoffs here. If you poll kubernetes it is possible Ocelot will not know if a service is down depending on your polling interval and you might get more errors than if you get the latest services per request. This really depends on how volatile your services are. I doubt it will matter for most people and polling may give a tiny performance improvement over calling kubernetes per request.
There is no way for Ocelot to work these out for you.
If your downstream service resides in a different namespace you can override the global setting at the ReRoute level by specifying a ServiceNamespace
.. code-block:: json
{
"ReRoutes": [
{
"DownstreamPathTemplate": "/api/values",
"DownstreamScheme": "http",
"UpstreamPathTemplate": "/values",
"ServiceName": "downstreamservice",
"ServiceNamespace": "downstream-namespace",
"UpstreamHttpMethod": [ "Get" ]
}
]
}