eggsy84
eggsy84

Reputation: 1139

GCP Load Balancer or Kubernetes type = LoadBalancer

When working with Google Container Engine - would people recommend GCP's native load balancer or the Kubernetes Service type = LoadBalancer option?

Which do people recommend?

Upvotes: 2

Views: 972

Answers (2)

Tuxdude
Tuxdude

Reputation: 49473

In the service resource manifest, if you set the Type to LoadBalancer, Kubernetes on GKE (Google Container Engine) will automatically set up TCP load balancing (L4 Load balancer) using GCE. You will have to terminate connections in your pod using your own custom server or something like nginx/apache.

If your goal is to set up a L7 load balancer (HTTP/HTTPS), it will be better to make use of the Ingress resource in Kubernetes (starting with v1.1). GKE will automatically set up a GCE HTTP/HTTPS L7 load balancing for this setup. This setup has the following advantages:

  1. Specify services per URL path and port (it uses URL Maps from GCE to configure this).
  2. Set up and terminate SSL/TLS on the GCE load balancer (it uses Target proxies from GCE to configure this).
  3. GKE will automatically also configure the GCE health checks for your services.

More info available on the GKE page about setting up HTTP load balancing.

Remember that GKE will automatically use the available GCE load balancer support for both the use cases described above and you will not need to manually set up GCE load balancing.

Upvotes: 2

CJ Cullen
CJ Cullen

Reputation: 5642

Setting the Service type to LoadBalancer on Google Container Engine will configure a GCP Load Balancer for you. See Creating an External Load Balancer and Services: Type LoadBalancer.

Upvotes: 0

Related Questions