Pod-to-service communications

Kubernetes is dynamic. Pods are created and deleted all the time. The Kubernetes service is an abstraction to define a set of pods by label selectors. We normally use the service to access pods instead of specifying a pod explicitly. When we create a service, an endpoint object will be created, which describes a set of pod IPs that the label selector in that service has selected.

In some cases, endpoint object will not be created with service creation. For example, services without selectors will not create a corresponding endpoint object. For more information, refer to the service without selectors section in Chapter 3, Getting Started with Kubernetes.

Then, how does traffic get from pod to the pod behind service? ...

Get DevOps with Kubernetes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.