'unable to infer base url' Swagger-ui : Kubernets using Traefik Ingress Controller

9/25/2019

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.

-- Sadique
kubernetes
spring-boot
traefik-ingress

1 Answer

9/26/2019

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
Source: StackOverflow