Professional Cloud Network Engineer
Traffic management in Google Cloud Load Balancing gives you fine-grained control over how incoming traffic is routed, distributed, and processed by backend services such as Google Kubernetes Engine (GKE) pods. These capabilities help meet availability and performance objectives through intelligent routing based on HTTP(S) parameters, request-based and response-based actions, and fine-tuning load balancing behavior through traffic policies.
Traffic steering directs traffic to specific service instances based on HTTP parameters such as request headers, host, path, and other request attributes. For example, if a user's device sends a request with user-agent:Mobile in the header, traffic steering can route that traffic to service instances designated to handle mobile traffic, while sending other traffic to instances that handle desktop requests. The load balancer selects a backend service based on rules defined in a URL map, which contains host rules and path matchers that evaluate incoming requests. Path rules are evaluated on a longest-path-matches-first basis, meaning more specific paths take precedence over generic ones. You can choose between simple host and path rules or advanced host, path, and route rules depending on your routing complexity needs.
Traffic actions enable you to perform request-based and response-based operations such as redirects and header transformations. Weight-based traffic splitting is particularly valuable for deploying new versions of services safely, allowing you to gradually shift traffic from an old version to a new version. For instance, you might send 95% of traffic to the previous version of your service and 5% to the new version, then gradually increase the percentage once you validate that the new version works correctly. This approach is commonly used for deploying new versions, A/B testing, service migration, and modernizing legacy services. Note that you should not configure session affinity when using weighted traffic splitting, as the weighted configuration takes precedence and could cause unexpected routing behavior.
Backend services define how traffic is distributed to your backends after a destination service is selected. A backend service can reference instance groups, managed instance groups (MIGs), or network endpoint groups (NEGs) that contain your GKE pods or Compute Engine VMs. The backend service controls traffic distribution through several mechanisms including locality load balancing policies, consistent hash load balancer settings, circuit breakers, and outlier detection. You can also configure connection tracking policies that determine how connections are tracked across the load balancer, including tracking mode and connection persistence behavior when backends become unhealthy. For GKE workloads, the built-in GKE Service controller automatically deploys Google Cloud load balancers on your behalf, managing the lifecycle of load balancing resources automatically.
Health checks determine whether backend instances are healthy and capable of serving traffic. The load balancer periodically sends probes to each backend and removes unhealthy backends from the rotation until they recover. You should configure health checks to match the type of traffic that your load balancer is distributing, whether that's TCP, SSL, HTTP, HTTPS, or HTTP/2. For external passthrough Network Load Balancers, you must create firewall rules that allow health check probes to reach your backend VMs. The health check configuration includes parameters such as check interval, timeout, healthy threshold (number of consecutive successful probes before marking a backend healthy), and unhealthy threshold (number of consecutive failed probes before marking a backend unhealthy).
Session affinity controls whether requests from the same client are directed to the same backend server. When session affinity is enabled, the load balancer attempts to route requests from the same client to the same backend, which is useful for applications that maintain client state locally. Available session affinity options include client IP-based affinity, generated cookie affinity, and HTTP cookie-based affinity. However, session affinity works differently depending on the load balancer type: proxy-based load balancers (like Application Load Balancers) terminate connections at the load balancer and may not preserve the original client IP address, while passthrough Network Load Balancers preserve client source IP addresses because they don't terminate connections. If your application relies on client IP addresses for authentication or security, you may need to use passthrough load balancers instead of proxy-based ones.
Failover configurations ensure high availability by designating backup backends that automatically receive traffic when primary backends become unhealthy. You can configure failover backends at the backend service level, and the load balancer will automatically redirect traffic when primary instances fail health checks or reach capacity. For multi-region deployments, global load balancers can route traffic to the closest healthy backend across regions, providing both low latency and redundancy. If the closest VMs are all unhealthy, or if the closest instance group is at capacity and another instance group is not, the load balancer automatically sends requests to the next closest region with available capacity. Regional load balancers distribute traffic across multiple zones within a single region, protecting against zonal failures but not regional outages.
Optimizing load balancer architecture for multi-cluster deployments requires designing network entry points that distribute traffic across distinct Google Kubernetes Engine (GKE) clusters and regions while balancing performance, cost, and security. Google Cloud achieves this by pairing proxy-based Layer 7 and Layer 4 load balancers with edge acceleration services and tiered network routing. Selecting the correct load balancer scope, integrating caching and security at the network perimeter, and choosing an appropriate network tier ensures resilient multi-region availability and predictable application latency.
A global external Application Load Balancer provides multi-cluster and multi-region HTTP(S) traffic distribution behind a single anycast IP address. Incoming client connections terminate at the nearest edge Google Front Ends (GFEs), which run Envoy proxies to inspect Layer 7 traffic. The load balancer uses a backend service referencing backends such as network endpoint groups (NEGs) or instance groups across multiple GKE clusters and regions. Traffic routing across clusters operates on client proximity, health check state, and backend capacity: traffic routes first to the GKE cluster in the region closest to the client, requests automatically overflow to the next closest healthy region when local cluster capacity thresholds are exceeded, and traffic shifts away from failing backends without dropped sessions when health checks detect pod or node outages.
For internal services spanning multiple GKE clusters, a cross-region internal Application Load Balancer provides similar multi-region distribution. This internal load balancer assigns a regional internal IP address from a local Virtual Private Cloud (VPC) subnet while allowing client systems in any Google Cloud region to send traffic to multi-cluster backends. Both global external and cross-region internal architectures rely on global URL maps to configure advanced traffic management, including path-based routing, header-based traffic steering, and weighted traffic splitting for canary deployments across clusters.
Integrating Cloud CDN with a global external Application Load Balancer accelerates content delivery across multi-cluster environments by caching web assets at Google's global edge points of presence (PoPs). When an external request arrives at an edge PoP, Google Cloud Armor security policies evaluate the request first, applying Layer 7 filtering and edge security rules to block web-based attacks and volumetric distributed denial-of-service (DDoS) traffic. If the request passes the security checks, Cloud CDN attempts to fulfill the request directly from the edge cache. A cache hit allows the edge PoP to return the requested data directly to the user, eliminating round-trip latency to the GKE clusters and reducing backend compute load. If a cache miss occurs, the request flows across Google's private network to the appropriate backend service in the nearest GKE cluster. Because Cloud CDN is supported only with global external Application Load Balancers and classic Application Load Balancers, workloads requiring global edge caching cannot use regional load balancers.
Choosing between Premium Tier and Standard Tier requires evaluating trade-offs between end-to-end network latency, service availability, and operational networking costs. Premium Tier routes client traffic onto Google's dedicated global fiber backbone at the edge PoP closest to the user, reducing Time To First Byte (TTFB) and packet transit times for globally dispersed clients accessing centralized or multi-cluster GKE workloads. Global load balancing, single anycast VIPs, and external IPv6 forwarding rules require Premium Tier. Standard Tier routes outbound traffic across the public internet until it reaches an edge PoP closest to the destination region where the target GKE cluster resides, reducing networking egress costs at the expense of higher latency and exposure to public internet transit fluctuations. Standard Tier supports only regional load balancers and classic Application Load Balancers distributing traffic to backends within a single region. Architects should select Premium Tier for latency-sensitive, multi-cluster services that require anycast routing and cross-region failover, and choose Standard Tier for cost-sensitive workloads that serve localized regional user bases and do not require global load balancing capabilities.
GKE load balancing types are the methods for distributing traffic to applications running in Google Kubernetes Engine (GKE) clusters. The choice depends on the client network (internal or external), the required protocol (HTTP/S or TCP/UDP), and the application's regionality (single or multi-cluster). GKE provides three primary controllers to automate load balancer creation: the GKE Gateway controller, the GKE Ingress controller, and the GKE Service controller for LoadBalancer Services.
GKE Ingress for external Application Load Balancers deploys a globally distributed, internet-facing Layer 7 (HTTP/S) load balancer. When you create an Ingress resource, the GKE Ingress controller automatically provisions a classic Application Load Balancer across Google's edge network. This load balancer terminates client TLS connections at Google Front End (GFE) proxies located globally to minimize latency. Traffic then flows from these GFEs directly to Pod endpoints in your cluster, typically using Network Endpoint Groups (NEGs) for container-native load balancing. Choose this option for public, internet-facing HTTP/S applications that benefit from global anycast IP addressing, edge security with Google Cloud Armor, and integration with services like Cloud CDN and Identity-Aware Proxy.
GKE Ingress for internal Application Load Balancers deploys a regional, proxy-based Layer 7 load balancer within your VPC network for private, service-to-service communication. The controller provisions an internal Application Load Balancer powered by Envoy proxies that are deployed in a regional proxy-only subnet. Traffic flows from internal clients to the load balancer's internal IP address, through these proxies, and then directly to Pod endpoints via NEGs. This load balancer requires a VPC-native cluster and a configured proxy-only subnet. Choose this option for internal HTTP/S traffic, such as between microservices, where you need features like path-based routing, session affinity, and integration with internal security policies, without exposing services to the internet.
A LoadBalancer Service in GKE deploys a Layer 4 (TCP/UDP) passthrough load balancer. When you create a Service of type LoadBalancer, the GKE Service controller automatically creates either an external passthrough Network Load Balancer (for public traffic) or an internal passthrough Network Load Balancer (for VPC traffic). These load balancers pass traffic directly to node IPs without terminating connections, preserving the original source IP and protocol. The traffic then undergoes a second hop via kube-proxy routing inside the cluster to reach the target Pods. Choose this option for non-HTTP protocols (like custom TCP or UDP), when you need direct passthrough of client IP addresses, or for scenarios where GKE Ingress's HTTP-specific features are not required.
The decision between GKE Ingress and LoadBalancer Services hinges on the protocol and required features. Use GKE Ingress for advanced HTTP/S traffic management, including host/path routing, TLS termination, and web application firewall integration. Use LoadBalancer Services for raw TCP/UDP traffic or when protocol passthrough is essential. Furthermore, you must choose between external and internal load balancers based on client origin: external for internet clients and internal for clients within your VPC or connected on-premises networks. For multi-region, high-availability deployments, Multi Cluster Ingress or multi-cluster Gateway can distribute traffic across clusters, while Cloud Service Mesh provides sophisticated service-to-service traffic management within and across clusters.
Proxy-based load balancers (like Application Load Balancers) terminate connections at the load balancer and may not preserve the original client IP address, while passthrough Network Load Balancers preserve client source IP addresses because they do not terminate connections. If your application relies on client IP addresses for authentication or security, you may need to use passthrough load balancers instead of proxy-based ones.
Choose Premium Tier for latency-sensitive, multi-cluster services that require anycast routing and cross-region failover, as it routes traffic on Google's dedicated global fiber backbone. Choose Standard Tier for cost-sensitive workloads that serve localized regional user bases and do not require global load balancing capabilities, as it routes over the public internet at lower cost.
Use GKE Ingress for advanced HTTP/S traffic management, including host/path routing, TLS termination, and web application firewall integration with Google Cloud Armor. Use LoadBalancer Services for raw TCP/UDP traffic or when protocol passthrough and preservation of the original client IP address are essential.
Prepare and test your skills
Prepare and test your skills