Kubernetes
Hard
Networking
What does a DNS lookup of a headless Service (clusterIP: None) with a selector return?
Select your answer:
Show answer and explanation
Answer: The IP addresses of the ready pods behind the Service
Explanation
A headless Service gets no cluster IP, so kube-proxy doesn't handle it. CoreDNS answers with an A or AAAA record for each ready endpoint, and the client chooses which pod to connect to. StatefulSets rely on this to give each pod a stable DNS name such as web-0.web.default.svc.cluster.local.
More hard Kubernetes questions
- What does externalTrafficPolicy: Local do on a NodePort or LoadBalancer Service?
- In a NetworkPolicy ingress rule, what is the difference between putting namespaceSelector and podSelector in the same 'from' entry and putting them in two separate entries?
- Two controllers read the same Deployment and both send an update based on what they read. How does the API server stop the second update from silently overwriting the first?
- A namespace has been stuck in Terminating for hours. What is the most likely cause?
- What does podManagementPolicy: Parallel change in a StatefulSet?
- What does volumeBindingMode: WaitForFirstConsumer on a StorageClass do?