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.
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.
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
.
But when I try the same GET requests using form the curl
command, it shows the right code.