how to make pod run on a specific path on EKS worker node

3/20/2020

Right now, my service is running on swagger/index.html.

I would like to make my pod run on abc/swagger/index.html.

I would like to use this path as part of my ingress like domain.com/abc/swagger/index.html. Right now, only domain.com/swagger/index.html is working.

Please advise how can I do that.

Thanks

-- gaurav sharma
amazon-eks
eks
kubernetes
kubernetes-pod

1 Answer

3/20/2020

You can either change your ingress path from

http:
  paths:
  - path: /swagger/*

to

http:
  paths:
  - path: /abc/swagger/*

OR


Add another path like in this example

Then it would work on both, /swagger and /abc/swagger

http:
  paths:
  - path: /swagger/*
    backend:
      serviceName: service
      servicePort: 8080
  - path: /abc/swagger/*
    backend:
      serviceName: service
      servicePort: 8080

More about ingress here and specificaly on eks here.

EDIT

Based on the aws documentation those paths should work

Example path patterns

/img/*

The path pattern is used to route requests but does not alter them. For example, if a rule has a path pattern of /img/*, the rule would forward a request for /img/picture.jpg to the specified target group as a request for /img/picture.jpg.

Could you try use it without*? So it would be /vendor/swagger/

-- jt97
Source: StackOverflow