Kubernetes Ingress (GCE) keeps returning 502 error

前端 未结 8 2016
一生所求
一生所求 2020-12-14 08:24

I am trying to setup an Ingress in GCE Kubernetes. But when I visit the IP address and path combination defined in the Ingress, I keep getting the following 502 error:

相关标签:
8条回答
  • 2020-12-14 09:08

    I had the same problem, and it persisted after I enabled livenessProbe as well readinessPorbe. It turned this was to do with basic auth. I've added basic auth to livenessProbe and the readinessPorbe, but turns out the GCE HTTP(S) load balancer doesn't have a configuration option for that.

    There seem to be a few another kind of issue with too, e.g. setting container port to 8080 and service port to 80 didn't work with GKE ingress controller (yet I wouldn't clearly indicate what the problem was). And broadly, it looks to me like there is very little visibility and running your own ingress container is a better option with respect to visibility.

    I picked Traefik for my project, it worked out of the box, and I'd like to enable Let's Encrypt integration. The only change I had to make to Traefik manifests was about tweaking the service object to disabling access to the UI from outside of the cluster and expose my app with through external load balancer (GCE TCP LB). Also, Traefik is more native to Kubernetes. I tried Heptio Contour, but something didn't work out of the box (will give it a go next time when the new version comes out).

    0 讨论(0)
  • 2020-12-14 09:09

    I solved the problem by

    1. Remove the service from ingress definition
    2. Deploy ingress kubectl apply -f ingress.yaml
    3. Add the service to ingress definition
    4. Deploy ingress again

    Essentially, I followed Roy's advice and tried to turn it off and on again.

    0 讨论(0)
提交回复
热议问题