6

I have recently started to learn about Kubernetes and i'm trying understand why my ingress controller is giving a 502 error.

i'm working with google cloud platform. i can see my service of type: LoadBalancer is working if i connect using its static IP address, but it seems i may not have configured my ingress controller correctly because it gives a 502 error.

but it doesn't display any error when i deploy and i cant find any logs for the Ingress so i cant see why a 502 is being displayed.

  • Are you using Google Container Engine (GKE) or Google Compute Engine (GCE)? – ConnorJC Aug 19 '17 at 3:38
  • I'm using GKE, but if logs are available for GCE, I'd still like to know in case it is ever useful. – X0r0N Aug 19 '17 at 7:17
6

On GKE, Ingress logs are in the web console under Stackdriver Logging, under "Cloud HTTP Load Balancer":

enter image description here

  • I don't see "Cloud HTTP Load Balancer" in the dropdown list anymore. I'm having a weird random 502 error and need to check load balancer log, please help. – TrungDQ Aug 17 '19 at 10:54
1

You should be able to view them the same as any other pod (kubectl logs -n namespace-name pod-name). The name and namespace will change depending on which ingress controller you're using.

Be aware that ingress controllers are often setup in a different namespace, so you may need to look for the pod in those. For example, the default configuration of the nginx ingress uses the namespace 'nginx-ingress'.

  • This is returns an error because it thinks it's looking for a pod rather than an ingress – Sinaesthetic Mar 13 '18 at 3:31
  • The ingress controller is a pod in almost all cases. – ConnorJC Mar 13 '18 at 3:40
  • 2
    The GKE Ingress controller runs on a managed master node by GCP, not as a regular pod, so you are not able to view its logs or runa ny kubectl operations on it. – Tony Jun 27 '18 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.