Application always returning status code 200 when running on k8s Cluster

12/21/2017

Recently we've created a cluster on Kubernetes Engine (GCP) and we started to notice a strange behavior.

When a request is made to the application through the load balancer, its always receiving status code 200, even when the application returns an error code (ex: 401). Seems like some layer of the cluster is intercepting and replacing it.

enter image description here

To be sure about the theory, I've made other tests using the port-forward feature of kubectl, making requests directly to the POD. And doing this way, I've got the response codes correctly.

enter image description here

Has anyone ever been through this situation before or have any idea how can we debug it better and discover what is causing this behavior?

EDIT:

After making more few tests, I've realized another interesting thing. When the requests are made by the browser (as a simple GET), it shows status code 200.

enter image description here

But when I try the same GET requests using form the curl command, it shows the right code.

enter image description here

-- Gabriel Gomes
google-cloud-platform
google-kubernetes-engine
kubernetes

0 Answers