CodePark/ questions / Orchestration & Kubernetes basics
START PRACTICINGPRACTICE
Backend question · Docker › Orchestration & Kubernetes basics

Pods behind your API come and go with new IPs. What does a Kubernetes Service provide, and what is its default type?

A stable virtual IP and DNS name that routes to Pods matching a label selector; the default type is ClusterIP

A Service gives clients a stable name and a stable IP inside the cluster. It selects Pods by their labels. Then it spreads traffic across the Pods that are ready.

ClusterIP is the default type. It is reachable only from inside the cluster.

"A public load balancer by default (
LoadBalancer)" and "A port on every node by default (NodePort)" are wrong. You must ask for these types explicitly.

"A DNS record for each Pod; the default type is
Headless" is also wrong. A headless Service is not a separate type and not the default. It is a ClusterIP Service with clusterIP: None.