Ocelot
Ocelot copied to clipboard
Errors when running Ocelot.Provider.Kubernetes in Azure K8
Expected Behavior / New Feature
Expect downstream routing to work
Actual Behavior / Motivation for New Feature
404 error
Error Code: UnableToFindServiceDiscoveryProviderError Message: Unable to find service discovery provider for type: consul errors found in ResponderMiddleware. Setting error response for request path:/products/g-ps4, request method: GET
Steps to Reproduce the Problem
-
routing file { "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": {
"Namespace": "apigateway",
"Type": "kube"
}
}
] } 2.. APIGateway pod or service configured as LoadBalancer 1.
Specifications
- Version: Ocelot 17.0.0 and Ocelot.Provider.Kubernetes 17.0.0
- Platform: Azure Kubernetes cluster
- Subsystem: .NET 5 API project
I am new to Ocelot on K8 and find the documentation confusing and not clear on proper setup.
@tomfanara nothing is wrong with your configuration, seens to be a bug on Ocelot! I got the same problem when upgrade to 18.0.0
, running local on docker works fine on Ocelot 18.0.0 but in K8S cluster none route works, returning 404
Any update? Because of this i got stuck on version 14.1.0
when all works
Hi Felipe hope all is well. I gave up on Ocelot on K8 but I still use it in dev for Docker Compose. I just use a Ingress Controller in K8 instead and load balance from their and wired in Identity with a JWT. However, I liked the simplicity of Ocelot with DI. I'll be back under the hood soon.
I am not sure they are still supporting Ocelot although Microsoft is endorsing it in their microservices book.
thanks, Tom
From: Felipe LeΓ£o @.> Sent: Thursday, July 7, 2022 9:07 AM To: ThreeMammals/Ocelot @.> Cc: tomfanara @.>; Mention @.> Subject: Re: [ThreeMammals/Ocelot] Errors when running Ocelot.Provider.Kubernetes in Azure K8 (#1527)
Any update? Because of this i got stuck on version 14.1.0 when all works
β Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FThreeMammals%2FOcelot%2Fissues%2F1527%23issuecomment-1177672750&data=05%7C01%7C%7C980a2fe169ae4948857508da6022093b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637927996582538536%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=ab8bwUyDudI%2BKK%2FrpIFw7xIGkKYsW1ENSUzb73DWv60%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAVQO4I5VDIPPDDVXLRVHLQLVS3QCHANCNFSM5GELPYIA&data=05%7C01%7C%7C980a2fe169ae4948857508da6022093b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637927996582538536%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=oNT57Hcm5tVi8xeS5Tqs7XfXN1hMG2MpK%2FWD6Z1A9g8%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>
@ggnaegi Yet another the same error. Pairing K8 vs Consul... Maybe load balancer?
@raman-m Ok, yes, the problem is here https://github.com/ThreeMammals/Ocelot/blob/bb795876c493af958f1d58c852ea56e94263906d/src/Ocelot/ServiceDiscovery/ServiceDiscoveryProviderFactory.cs#L59
The design isn't great and should be addressed in the future. Since the class used for the k8 provider is called KubernetesServiceDiscoveryProvider
It will never match kube
...
@ggnaegi π You know this logic better than me. I'm going to accept the bug...
The design isn't great and should be addressed in the future. Since the class used for the k8 provider is called
KubernetesServiceDiscoveryProvider
. It will never matchkube
...
Oh, oh! Ups!... Yeap, design is not great. But K8 SD feature works in general, right?
But isn't ServiceDiscoveryFinderDelegate
responsible for getting correct provider instance?
Maybe the author forgot to follow instructions in Kubernetes doc, and adding reference to Ocelot.Provider.Kubernetes
package and calling AddKubernetes
method? π
@tomfanara Did you follow the instructions in Kubernetes doc? π
I am not sure they are still supporting Ocelot although Microsoft is endorsing it in their microservices book.
Seems not endorsing nowadays anymore... π’ Microsoft has employed a lot of bad boys who like to buy & kill open-source projects which are not under control by Microsoft managers. Ocelot is removed from Microservices Arch book. Microsoft respects its own product. You know the name.