Swagger base path with a kubernetes fan out path

3/12/2018

Set up

I use kubernetes to send users to containers running stuff on certain ports.

For instance for something that I have running on a container in a pod on port 8080, the user goes to www.example.com/mt, then /mt forwards them to the container running on 8080 which is my case is a container with an application that has a swagger spec.

Question/Problem

My swagger application at www.example.com/mt/swagger-ui.html will send it's POST/GETs etc to www.example.com:443/api/... when it should be www.example.com/mt/api/...

Does anyone know how too even approach this problem. Is it in swagger or kubernetes?

Potentially helpful notes:

My .yaml file contains this that does the port forwarding

spec:
  rules:
  - http:
      paths:
      - path: /ui
        backend:
          serviceName: neo4j-service
          servicePort: 9205
      - path: /pg
        backend:
          serviceName: neo4j-service
          servicePort: 8181
      - path: /mt
        backend:
          serviceName: neo4j-service
          servicePort: 8080
-- Rorschach
kubernetes
swagger

0 Answers