Reputation: 1139
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
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:
URL Maps
from GCE to configure this).Target proxies
from GCE to configure this).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
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