What is a Kubernetes Service?easy

Type
conceptual
Topic
networking
Frequency
very common
Tags
networking
Answer

A Service provides a stable DNS name and virtual IP to route traffic to a set of Pods matching a label selector, abstracting away Pod churn as Pods are created and destroyed.

Explanation

Service types: ClusterIP (internal only, default), NodePort (exposes on each node's IP), LoadBalancer (provisions a cloud load balancer), ExternalName (maps to an external DNS). For HTTP routing with path and host rules, use an Ingress on top of a Service. Services use label selectors to find target Pods - adding or removing a label from a Pod immediately adds/removes it from the Service's endpoints.

Follow-upWhat is the difference between a Service and an Ingress?