Got error when using k8s service discovery #1948
Replies: 4 comments 3 replies
-
Hi,
"GlobalConfiguration": {
"ServiceDiscoveryProvider": {
//Specify the host of Service Discovery
"Host": "172.20.40.141",
//Specify the port of Service Discovery
"Port": 6443,
"Token": "MyToken",
"Type": "kube",
"Namespace": "admin-auth-server"
////1. Consul, means that Ocelot will get service information from consul per request
////2. PollConsul, means that Ocelot will poll Consul for latest service information
Type: "KubernetesServiceDiscoveryProvider",
////Tells Ocelot how often to call Consul for changes in the service configuration
//"PollingInterval": 60000
},
Service Discovery {
"DownstreamPathTemplate": "/api/posts/{postId}",
"DownstreamScheme": "https",
"UpstreamPathTemplate": "/posts/{postId}",
"UpstreamHttpMethod": [ "Put" ],
"ServiceName": "product",
"LoadBalancerOptions": {
"Type": "LeastConnection"
},
} When this is set up Ocelot will lookup the downstream host and port from the service discover provider and load balance requests across any available services. If you add and remove services from the service discovery provider (consul) then Ocelot should respect this and stop calling services that have been removed and start calling services that have been added. |
Beta Was this translation helpful? Give feedback.
-
@nhanh9d Hi An, have you ever successfully solved the issue? I am dealing with the same issue and also tried doing @yoramda 's suggestion but no luck. |
Beta Was this translation helpful? Give feedback.
-
Hello did anybody have any luck at this? I have tried reading the docs over and over and cannot get it to work. It works in Docker. I am having the same issue. Here is my routing file. Also do I need RBAC setup? {
"Routes": [
{
"DownstreamPathTemplate": "/home",
"DownstreamScheme": "http",
"UpstreamPathTemplate": "/test",
"ServiceName": "productshttpaggegator",
"UpstreamHttpMethod": [ "Get" ]
},
{
"DownstreamPathTemplate": "/api/products/{postId}",
"DownstreamScheme": "http",
"UpstreamPathTemplate": "/products/{postId}",
"ServiceName": "productshttpaggegator",
"UpstreamHttpMethod": [ "Get" ]
}
],
"GlobalConfiguration": {
"ServiceDiscoveryProvider": {
"Type": "KubernetesServiceDiscoveryProvider"
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Hello everyone! The issue #977 has been reopened today due to a critical inconsistency found in testing projects. It has been acknowledged following similar reports in issue #2178 (comment). |
Beta Was this translation helpful? Give feedback.
-
Actual Behavior
Steps to Reproduce the Problem
Specifications
Beta Was this translation helpful? Give feedback.
All reactions