9

When setting up a Kubernetes ingress on Google Container Engine, you can choose the ingress class (gce or nginx). I realize that the GCE class provisions a load balancer on Google's Cloud Platform, which costs about $20/mo each.

After some research, I couldn't find any prevailing reason why Google's load balancer is any better than using the NGINX ingress class—at least not before hitting a very large scale.

In fact, it appears that the GCE class does not support:

  • External authentication with ingress.kubernetes.io/auth-url
  • Basic authentication
  • A few other small features built into the NGINX ingress

Are there any benefits I'm not aware of for using the GCE class vs. the NGINX class for ingresses?

Wes Cossick
  • 333
  • 2
  • 12

1 Answers1

11

After some further reading and testing, I did find a few benefits. I also realized that using the NGINX controller would still provision a load balancer... thereby not avoiding the ~$20/mo cost.

Differences

  • The GCE controller causes an HTTP(S) load balancer to be provisioned
  • The NGINX controller requires a service to be designated as type: LoadBalancer
    • Doing this causes a network load balancer to be provisioned

HTTP(S) load balancer

Network load balancer

Benefits:

  • As shown in the diagrams above, the HTTP(S) load balancer can load balance across regions, whereas the network load balancer can only load balance across zones in the same region
  • The GCE controller is built specifically for Google's Cloud Platform, so I assume it works more reliably
  • The default GCE controller requires no extra effort compared to maintaining and specifying the YAML files required for the NGINX controller to function
Wes Cossick
  • 333
  • 2
  • 12
  • Thanks for this helpful answer. I'd be curious to see if the GCE controller supports session persistence features found in Nginx controller. For example, annotations like this 'nginx.ingress.kubernetes.io/affinity: "cookie"     nginx.ingress.kubernetes.io/session-cookie-name: "route"     nginx.ingress.kubernetes.io/session-cookie-hash: "sha1" ' – ice.nicer Jun 21 '18 at 18:25