Rodrigo
Rodrigo

Reputation: 291

Get logs from the load balancer

I have a strange situation where sometimes a request hits an ingress and sometimes hit another ingress. I know because it comes with a different SSL certificate, and when it happens, there is no log on the ingress.

Is there some way to debug this? Get the logs from the load balancer and see what happens, and which route it takes?

Upvotes: 0

Views: 2622

Answers (2)

Blender Fox
Blender Fox

Reputation: 5625

I've seen this problem happen before and for us it happened when you have more than one ingress controller on the cluster and you don't specify (or incorrectly specify) the ingress class on the ingress.

As a consequence of this, different controllers will "fight" over control of the ingress.

An easy way to check this is simply to run watch kubectl get ingress -n {namespace} {ingress-name} and see if the external IP of the ingress changes back and forth. If it does, you have an ingress controller conflict.

To add: There were no issues with the loadbalancers in our case.

Upvotes: 0

JaysonM
JaysonM

Reputation: 636

You need to enable the Load balancing logging using this steps.

  1. Go to the Load balancing page in the Cloud Console.
  2. Click the name of your load balancer.
  3. Click Edit edit.
  4. Click Backend Configuration.
  5. Select Create a backend service.
  6. Complete the required backend service fields.
  7. Click Enable logging.
  8. Set a Sample rate fraction. You can set a rate to 0.0 through 1.0 (default).
  9. Click Update to finish editing the backend service.
  10. Click Update to finish editing the load balancer.

To view logs

  1. On Console, Go to Logs Exporer
  2. Select GCE Forwarding Rule on Log Fields
  3. Click on log time stamp to view log details.

For more and complete guide you can refer on this page.

Health Checks

Cloud Load Balancing

Upvotes: 1

Related Questions