Lundin
Lundin

Reputation: 311

kubernetes gce ingress path wildcard not proxy correct uri (works inside container)

What can be the reason for not being able to curl/use a rest API with some slugs i.e example.com/application/v2/xxxx.The docker image i use is the app from http://vespa.ai/ https://github.com/vespa-engine/docker-image/blob/master/Dockerfile

I have set up nodeport correctly and an ingress

i have tried various, for example default backend on the host:

- host: example.com
http:
  paths:
  - backend:
      serviceName: myservice
      servicePort: 19071

or explicit using wildcard routing:

 - host: example.com
http:
  paths:
  - path: /*
    backend:
      serviceName: myservice
      servicePort: 19071

The strange thing is that doing curl externally (outside cluster): curl -s --head http://example.com/ApplicationStatus Does return statusCode 200 OK

Doing curl -s --head http://example.com/application/v2/tenant/ Return BAD_REQUEST from the application.

"error-code": "BAD_REQUEST", "message": "http://example.com/application/v2/tenant/"

exec into the container and doing curl -s --head http://localhost:19071/application/v2/tenant/ works..

So either the application somehow match on hostname which is not correct when coming from the ingress or there is some other issues with the full uri not being proxied.

The source code for that app it too big to understand for me at the moment but looking in the source https://github.com/vespa-engine/vespa/blob/f76406b88df47f6bdbf9d24feda4c9ff55c63e06/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostSuspensionResource.java It might explain why it returns the error message.

Everything else seems to work, configserver and application.

Is it the app itself or kubernetes that might be the problem here ?

Upvotes: 3

Views: 632

Answers (1)

Toby
Toby

Reputation: 86

HostSuspensionResource should not be involved here I think. The restapi entry point is the ApplicationHandler class for the call you are making.

What happens when you curl inside the container with the default port (i.e not the 'internal' 19071 port)?

Upvotes: 2

Related Questions