Skip to Content
Kubernetes: Up and Running, 3rd Edition
book

Kubernetes: Up and Running, 3rd Edition

by Brendan Burns, Joe Beda, Kelsey Hightower, Lachlan Evenson
August 2022
Intermediate to advanced
328 pages
8h 22m
English
O'Reilly Media, Inc.
Book available
Content preview from Kubernetes: Up and Running, 3rd Edition

Chapter 8. HTTP Load Balancing with Ingress

A critical part of any application is getting network traffic to and from that application. As described in Chapter 7, Kubernetes has a set of capabilities to enable services to be exposed outside of the cluster. For many users and simple use cases, these capabilities are sufficient.

But the Service object operates at Layer 4 (according to the OSI model).1 This means that it only forwards TCP and UDP connections and doesn’t look inside of those connections. Because of this, hosting many applications on a cluster uses many different exposed services. In the case where these services are type: NodePort, you’ll have to have clients connect to a unique port per service. In the case where these services are type: LoadBalancer, you’ll be allocating (often expensive or scarce) cloud resources for each service. But for HTTP (Layer 7)-based services, we can do better.

When solving a similar problem in non-Kubernetes situations, users often turn to the idea of “virtual hosting.” This is a mechanism to host many HTTP sites on a single IP address. Typically, the user uses a load balancer or reverse proxy to accept incoming connections on HTTP (80) and HTTPS (443) ports. That program then parses the HTTP connection and, based on the Host header and the URL path that is requested, proxies the HTTP call to some other program. In this way, that load balancer or reverse proxy directs traffic for decoding and directing incoming connections to the right ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Terraform: Up and Running, 3rd Edition

Terraform: Up and Running, 3rd Edition

Yevgeniy Brikman
Docker: Up & Running, 3rd Edition

Docker: Up & Running, 3rd Edition

Sean P. Kane, Karl Matthias
Ansible: Up and Running, 3rd Edition

Ansible: Up and Running, 3rd Edition

Bas Meijer, Lorin Hochstein, René Moser

Publisher Resources

ISBN: 9781098110192Errata PageSupplemental Content