Kubernetes Service Concepts

From NovaOrdis Knowledge Base
Revision as of 20:40, 19 September 2020 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

External

Internal

Playground

https://github.com/ovidiuf/playground/tree/master/kubernetes/httpd-pod-and-service

Overview

A service is a Kubernetes resource that provides stable network access to a set of ephemeral pods. The need for such a resource is explained in the Need for Services section.

Need for Services

The pods come and go - if a pod fails, it is not resurrected, but its failure is detected by the lack of response from the liveness probe embedded within it and another pod is usually scheduled as replacement. In consequence, the IP address of an individual pod cannot be relied on.

First off, the IP address is dynamically allocated at the time of pod initialization, and secondly, it becomes obsolete the moment the pod disappears. As such, it is practically very difficult, if not impossible for application's clients running outside the Kubernetes cluster to keep track of ephemeral pod IP addresses.

The solution maintain an instance of a specialized resource, the service, for each of such group of pods. The service instance exposes a stable IP address and set of ports for the life of the service instance.

Service

Is is ClusterIP by default?

Associating Pods with their Service

Kubernetes Service Concepts TODEPLETE