Lesson 1.2

Services and cluster networking

Pod ip addresses change on every restart, so nothing should ever be configured with one.

24mIntermediate11.6k students

Overview

Pods come and go, services do not

Pod ip addresses change on every restart, so nothing should ever be configured with one. A service provides a stable name and address, and load balances across whichever pods currently match its selector.

The types stack: a cluster-internal service is the default, a node port exposes it on every node, and a load balancer asks the cloud provider for an external one. Most application services should stay internal, with an ingress in front.

The selector is the whole binding mechanism. A label typo produces a service with no endpoints, which fails as a connection timeout rather than an obvious error.

In this lesson you will:

  • Give a set of pods a stable address
  • Compare the service types
  • Understand how selectors bind a service to pods

Resources

Previous Lesson
Next Lesson
Services and cluster networking — Kubernetes for Application Developers — Vertex