PRIYANKA VERGADIA: So far, we've talked
all things global load balancing on Google Cloud Platform.
STEPHANIE WONG: But how does this
work with Google Kubernetes clusters running as backends?
PRIYANKA VERGADIA: Well, stay tuned to find out.
[MUSIC PLAYING]
Since last time, Beyond Treats' online business
has still been booming.
And, while they upgraded to using Google's global load
balancer, they also decided to move
to a microservices environment for their web backend.
STEPHANIE WONG: But load balancers
were initially built to support resource allocation
for virtual machines, which helps
workloads be highly available.
When containers and container orchestrators
started to take off, users adapted these VM-unfocused load
balancers for their use, even though the performance
was suboptimal.
PRIYANKA VERGADIA: Traditionally, HTTPS load
balancers, targeting Kubernetes clusters,
would actually be targeting its nodes
because they didn't have a way to recognize each pod.
In the absence of a way to define a group of pods
as backends, the load balancer used instance groups
to group VMs as a backend.
Ingress support in GKE, using those instance groups,
used the HTTPS load balancer to perform load balancing
to nodes in the cluster.
STEPHANIE WONG: IP table rules programmed
on the nodes raw request to the pod
serving as backends for the load balanced application.
Load balancing to the nodes was the only option
since the load balancer didn't recognize pods or containers
as backends, resulting in imbalanced load
and a suboptimal data path with additional unnecessary hops
between nodes.
PRIYANKA VERGADIA: But then Google
came out with Network Endpoint Groups,
or NEGs, abstraction layer that enables container native load
balancing.
This means the load balancer has visibility into a Kubernetes
cluster pods because NEGs are integrated
with the Kubernetes ingress controller running on GCP.
In the case for Beyond Treat, they
have a multi-tiered e-commerce deployment
and want to expose one service to the internet using GKE.
With NEGs, they can now provision and HTTPS
load balancer, allowing them to configure
pad-based or host-based routing to their backend pods.
STEPHANIE WONG: All they have to do to get started
is to create a VPC-native GKE cluster.
By default, Kubernetes uses static routes
for pod networking, which requires a Kubernetes control
plane to maintain these routes to each node.
But this comes at a scaling cost.
In GKE, you have the option to create clusters
in VPC-native mode, which provides container
native load balancing that uses a NEG model.
VPC-native mode means you have connectivity
between all pods in your VPC without the overhead of route
scaling.
And traffic is evenly distributed
among the available healthy backends in an input group.
PRIYANKA VERGADIA: Now that Beyond Treat has implemented
a VPC-native cluster with NEGs, they've
experienced even better load balancing.
With container-native load balancing,
traffic is distributed evenly among the available healthy
backends in an endpoint group, following their defined load
balancing algorithm.
STEPHANIE WONG: They also now have native support
for health checking including TCP, HTTPS, HTTP/2 checks.
NEGs can check the pods directly rather than
the nodes forwarding health checks to a random pod.
As a result, health checks more accurately mirror
the health of the backends.
PRIYANKA VERGADIA: Beyond Treat also benefits
from graceful termination, meaning, when a pod is removed,
the load balancer automatically drains the connection
to the endpoint, serving traffic based
on the connection draining period configured for it.
STEPHANIE WONG: And, best yet, their pet lovers
will experience their traffic hitting an optimal data path.
With the ability to load balance directly to containers,
the traffic hot from the load balancer to the node
disappears since load balancing is
performed in a single step rather than two.
PRIYANKA VERGADIA: And Beyond Treat now
has increased visibility and security.
Container-native load balancing helps
them troubleshoot their services at the pod level.
It can preserve the source IP to make it easier to trace back
to the source of the traffic.
Since the container sees the packet arrive from the load
balancer rather than through a source NEG from another node,
they can now create firewall rules using node level network
policies.
STEPHANIE WONG: It looks like Beyond Treat has
gone from the popular, local bakery
to an international, online bakery phenomenon.
PRIYANKA VERGADIA: And its GCP backend
has grown along with it.
We learned about the load balancing options on GCP
and proved that global load balancing
is more performant and reliable than regional HTTPS load
balancing.
STEPHANIE WONG: And, finally, we showed you
that, even with GKE clusters, container-native load balancing
means they can target back in pods directly
for optimal traffic distribution and improvements
in scalability.
[MUSIC PLAYING]
All right, we've been talking about trees for weeks,
and Bell still hasn't gotten to try any.
PRIYANKA VERGADIA: Well, we can get her to try some.
That's all for today on Get Cooking in Cloud.
Let us know how you're liking this series in the comments
section, and hit those like and subscribe buttons
for more cool Google Cloud content.