Azure Api managament and kubernetes

6/19/2018

I have a rest api in kubernetes exposed as NodePort but when i trying to add the api in api managament trought OpenApiSpecification with the next url http://10.35.748.671:31285/swagger/v1/swagger.json It's show me an error:

Unable to download specified file. Please ensure the URL is valid and the file is publicly accessible.

This is my service description

kubectl describe svc kservice

Name:                     kservice

Namespace:                default

Labels:                   app=apis

Annotations:              <none>

Selector:                 app=apikb

Type:                     NodePort

IP:                       10.0.0.123

Port:                     <unset>  80/TCP

TargetPort:               80/TCP

**NodePort:                 <unset>  31285/TCP**

Endpoints:                10.35.748.671:80,10.35.748.697:80

Session Affinity:         None

External Traffic Policy:  Cluster

Events:                   <none>

¿How can I connect api managament with services in kubertes?

-- Felix David Hernandez Aldana
api
asp.net-core
azure-api-management
kubernetes

3 Answers

7/10/2018

API management is a facade/Gateway. First check, are you able to access your API endpoints directly? If No you need to fix this first.

Swagger file required for your API documentation, I'm assuming you must have created. If No, create and access that file from endpoint?

One more suggestion, you need to take static IP, otherwise whenever your VM would get restart your IP will change and your API would throw 502 error.

-- Pankaj Rawat
Source: StackOverflow

6/20/2018

The address seem to be internal address. Importing API through Azure Portal may not work if URL where open API spec file is hosted is not publicly available. IF that is so - download swagger.json to your machine and import this API by uploading that file.

-- Vitaliy Kurokhtin
Source: StackOverflow

8/1/2018

We weren't able to access the Kubernetes service from API management because:

  1. Both needed to be on the same subnet.
  2. We have to upgrade kubernetes version to 1.10.3 to see Services deployed with NodePort.
-- Felix David Hernandez Aldana
Source: StackOverflow