In Kubernetes, a Service is an abstraction which represents a logical set of Pods and a policy by which to access them.
Although each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service.
The point is that Pods in Kubernetes are “mortal” – every time a Pod dies for some reason, a new Pod is created in its place with a different IP address, so IP addresses of Pods cannot be called persistent and stable.
The idea of a Service is to group a set of Pod endpoints (back-end) into a single resource (front-end) with a persistent IP addresses that can be exposed in different ways depending on a ServiceType.
In this note i will show how to list Services in Kubernetes using the kubectl command and how to get detailed information about each Service in different formats. (more…)