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?
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.
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.
We weren't able to access the Kubernetes service from API management because: