liveBook · Manning

L4 load balancer

As explained in Kubernetes for Developers

A layer-4 load balancer distributes network traffic based on transport-layer information such as protocol, address, and port.

An L4 load balancer distributes traffic at the network layer using transport details such as protocol and port. In Kubernetes, a Service of type LoadBalancer provides an external IP and balances traffic across selected Pods. It supports TCP, UDP, and SCTP, but HTTP-specific routing and HTTPS handling remain your responsibility. section 7.2

Use an L4 load balancer when:

  • You need to publish a service using a chosen transport protocol and port. section 7.2
  • You want one external IP to distribute traffic across Pods selected by Service labels. section 7.2
  • You expose HTTP but can manage TLS termination yourself and do not need path- or host-based routing. section 7.2

Kubernetes Service exposure

Configure a Service with type LoadBalancer, protocol TCP, and a port. Kubernetes provisions an external IP that distributes connections to the matching Pods. Separate externally exposed Services require separate load-balancer IPs. section 7.2

How Kubernetes for Developers covers it

How deep it goes
Defines protocols, ports, external IPs, Pod selection, and HTTP limitations, but defers HTTP routing and managed TLS to L7 systems.
Examples
Uses Kubernetes Services of type LoadBalancer for TCP, UDP, or SCTP traffic and external IP distribution.
What it assumes
Assumes Kubernetes Services and Pods, while explaining transport protocols, ports, and external IP exposure through the deployment scenario.
What you can do after
Operate/configure a Kubernetes LoadBalancer Service with a selected protocol, port, and Pod selector.
How it connects
Contrasts with L7 load balancing and connects to Kubernetes Services, Pods, TLS termination, and Ingress.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.