0
0
Kubernetesdevops~5 mins

Service discovery via DNS in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is service discovery in Kubernetes?
Service discovery is the process that allows applications to find and communicate with each other automatically within a Kubernetes cluster.
Click to reveal answer
beginner
How does Kubernetes use DNS for service discovery?
Kubernetes automatically creates DNS entries for services, so pods can find services by their DNS names instead of IP addresses.
Click to reveal answer
intermediate
What is the DNS name format for a Kubernetes service?
The DNS name format is .<namespace>.svc.cluster.local, where is the service's name and <namespace> is its namespace.
Click to reveal answer
intermediate
What role does CoreDNS play in Kubernetes service discovery?
CoreDNS is the DNS server inside Kubernetes that answers DNS queries for services and pods, enabling service discovery via DNS.
Click to reveal answer
beginner
Why is DNS-based service discovery preferred over hardcoding IP addresses?
Because IP addresses can change when pods restart or move, DNS names provide a stable way to find services without manual updates.
Click to reveal answer
What is the default DNS suffix for services in Kubernetes?
Aservice.local
Bcluster.svc.local
Ckube.local
Dsvc.cluster.local
Which Kubernetes component handles DNS queries for service discovery?
Akube-scheduler
BCoreDNS
Cetcd
Dkube-proxy
How can a pod find a service named 'web' in the 'default' namespace?
Aweb.svc.default.cluster.local
Bdefault.web.svc.cluster.local
Cweb.default.svc.cluster.local
Dsvc.web.default.cluster.local
Why should you avoid hardcoding service IP addresses in your application?
AIP addresses can change when pods restart or move
BIP addresses are always static in Kubernetes
CDNS is slower than IP addresses
DHardcoding IPs improves scalability
What happens if CoreDNS is not running in a Kubernetes cluster?
AService discovery via DNS will fail
BPods will still resolve services by IP
CServices will be discovered faster
DNothing changes
Explain how DNS-based service discovery works in Kubernetes.
Think about how pods find each other without knowing IP addresses.
You got /4 concepts.
    Why is using DNS for service discovery better than using fixed IP addresses in Kubernetes?
    Consider what happens when pods restart or move.
    You got /4 concepts.