Cross-namespace Service DNS resolution
WHAT IT TESTS: Knowledge of cluster DNS naming. OUTLINE: CoreDNS gives each Service a name; cross-namespace you must qualify it as my-service.B.svc.cluster.local (or my-service.B).
WHAT IT TESTS: Whether you know the DNS naming scheme and namespace scoping. ANSWER OUTLINE: CoreDNS creates an A record for each Service following the pattern service.namespace.svc.cluster.local. Within the same namespace a short name resolves, but a Pod in namespace A reaching a Service in namespace B must qualify it: my-service.B, or fully my-service.B.svc.cluster.local. The short name my-service alone would resolve to A's namespace and fail.
Read the original → interview
- #kubernetes
- #dns
- #service-discovery
- #coredns
- #namespaces
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.