TIBCOSoftware / apiscout

TIBCO API Scout, Finding your APIs in Kubernetes so you know what you deployed last summer!
BSD 3-Clause "New" or "Revised" License
18 stars 4 forks source link

Swagger Endpoint in discovered services #15

Open mshahat opened 5 years ago

mshahat commented 5 years ago

Hi,

Swagger presented by APIScout has the private K8S svc IP. Accordingly, Swagger is not usable.

Thanks,

nareshkumarthota commented 5 years ago

I believe you followed below like steps:

1) Get the latest API-Scout app and build docker image. 2) Update image name & EXTERNAL-IP(minikube or cluster ip) values in apiscout.yml file. 3) Build your microservice along with /swaggerspec handler. 4) Update the annotations in your microservice yml file. 5) Deploy the application & check the status once it is deployed open minikube service apiscout-svc --url in browser. 6) Use 'try it out' under API paths to verify the swagger.

Let me know if you tried something else along with exact configuration to re produce the issue.

mshahat commented 5 years ago

Thanks, @nareshkumarthota this is running in a production like up, with a full functioning Kubernetes cluster, not minikube. In production like environments, we're not using EXTERNAL IPs but Ingress routes. in our case we're using nginx ingress routes on kubernetes.

please let me know if you need more understanding to the issue.

Thanks,

nareshkumarthota commented 5 years ago

I need some details like:

  1. YML file of deployed API-Scout application.
  2. API-Scout api accessing url to check generated swaggers.
  3. URL of any one of your microservices.
rishikeshpalve commented 5 years ago

@mshahat can you please provide more details?

  1. Is this a BWCE app deployed on K8s?
  2. "APIScout has the private K8s IP" - Can you please elaborate? I've set up a sample BWCE app on K8s along with APIScout. In my case, when I hit 'Try it out' on Swagger UI generated by APIScout, the request goes to ClusterIP of apiscout service instead of BWCE service ClusterIP. Are you facing the same issue?
  3. What's the expected behavior?
mshahat commented 5 years ago

Hi,

  1. Yes, the BWCE app is deployed to K8S.
  2. We're not using EXTERNAL K8S Services, we're using INTERNAL ones. Access to endpoints is achieved using Ingress routes. APIScout discovers the Service, as the service doesn't have an external IP and only has an internal one ( within the cluster ), that's what is presented through API Scout.

The expected behaviour is may be 1) ability to annotate ingresses as well, and via both the Service and the Ingress, the right endpoints could be served

2) a tactical solution could be, annotating the service with another attribute e.g. apiscout/swaggerPublicEndpoint where we could capture the ingress endpoint url, or may be Mashery public endpoint

HTH,

screenshot 2018-12-13 at 18 32 11
nareshkumarthota commented 5 years ago

@mshahat

Annotation support for ingress end url is added. Code changes pushed to branch 'feature-issue-15', give a try now.

check annotation name in readme page under #requirements-for-kubernetes

mshahat commented 5 years ago

Thanks, @nareshkumarthota, will test ...

jpark800 commented 5 years ago

@mshahat Any update with the testing on your end?

mshahat commented 5 years ago

Hi Jon, apologies, will test in a week time and let you know.

Cheers,