ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.35k stars 1.63k forks source link

UnableToFindServiceDiscoveryProviderError for type "consul " when using type "kube" #1529

Closed arthursmuller closed 8 months ago

arthursmuller commented 2 years ago

I have already ran kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts

Can someone please tell me whats wrong with it?

When trying to run ocelot inside kubernetes cluster i get this errors

Error

warn: Ocelot.Responder.Middleware.ResponderMiddleware[0] requestId: 0HMCO5SFMMOIQ:00000002, previousRequestId: no previous request id, message: Error Code: UnableToFindServiceDiscoveryProviderError Message: Unable to find service discovery provider for type: consul errors found in ResponderMiddleware. Setting error response for request path:/externalForumService, request method: GET

{
  "Routes": [
    {
      "UpstreamPathTemplate": "/externalForumService/GetAll",
      "DownstreamPathTemplate": "/api/externalforum/v1/forum/GetAll",
      "DownstreamScheme": "http",
      "ServiceName": "externalforum-api-svc",
      "UpstreamHttpMethod": [ "Get" ]
    },
    {
      "UpstreamPathTemplate": "/externalForumService",
      "DownstreamPathTemplate": "/api/externalforum/v1/forum",
      "DownstreamScheme": "http",
      "ServiceName": "externalforum-api-svc",
      "UpstreamHttpMethod": [ "Get" ]
    }
  ],
  "GlobalConfiguration": {
    "ServiceDiscoveryProvider": {
      "Namespace": "propnull",
      "Type": "kube"
    }
  }
}

Service to map

apiVersion: v1
kind: Service
metadata:
  name: externalforum-api-svc
  namespace: propnull
spec:
  type: ClusterIP
  selector:
    app: externalforum-api
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 80

Specifications

raman-m commented 9 months ago

@ggnaegi This is strange error. What do you think?

raman-m commented 9 months ago

Duplicate of #1527