0

I am facing this error message when i am try to access my swagger url after it is deployed on kubernetes environment.

When i run my spring boot application on localhost then i am able to see the swagger without any error.

I am using Traefik as my ingress controller.

Tibebes. M
  • 6,940
  • 5
  • 15
  • 36
Sadique
  • 140
  • 8
  • Possible duplicate of [Why does springfox-swagger2 UI tell me "Unable to infer base url."](https://stackoverflow.com/questions/47425048/why-does-springfox-swagger2-ui-tell-me-unable-to-infer-base-url) – Crou Sep 26 '19 at 09:54

1 Answers1

1

Spring boot application ,you have to add Server context path in application.yml/perporties file.

Example:

server: servlet: context-path: /

After adding context-path you can able to see the swagger-ui url: localhost:8080/api/swagger-ui.html

Note: Root path name as a "api", you have been configured in Ingress.yml file.

spec: rules: - host: http: paths: - path: /api backend: serviceName:

chandra kumar
  • 39
  • 1
  • 4