☸️ CoreDNS and AWS VPC CNI in EKS: Understanding Internal and Upstream Flow

CoreDNS and AWS VPC CNI in EKS: Understanding Internal and Upstream Flow

When people start learning EKS networking, two components create the most confusion:

  • CoreDNS
  • AWS VPC CNI

At first, they can look similar because both are involved when one service talks to another. But their jobs are very different.

A simple way to understand them is this:

  • CoreDNS tells your Pod where to send the request
  • VPC CNI makes sure the request can actually travel there

And once you understand upstream flow, everything starts making more sense.

1. CoreDNS: The Name Resolver Inside the Cluster

CoreDNS is the DNS server running inside Kubernetes.

Its primary job is to resolve internal service names like this:

review-service.default.svc.cluster.local

When a Pod calls another Kubernetes Service using its name, CoreDNS translates that name into an IP address.

Internal service lookup flow

Pod
 ↓
CoreDNS
 ↓
Service IP

Diagram: Internal DNS resolution

order-service Pod
      ↓
asks for review-service.default.svc.cluster.local
      ↓
CoreDNS
      ↓
returns ClusterIP

So in simple words:

  • Pod knows the service name
  • CoreDNS returns the service IP

2. What “Upstream” Means in CoreDNS

Now let’s say the Pod is not calling an internal Kubernetes Service.

Instead, it calls something external like:

api.stripe.com

CoreDNS does not own that domain.

So what does it do?

It forwards the request to an upstream DNS resolver.

In EKS, that upstream resolver is usually the AWS VPC DNS resolver, which then resolves public internet domains.

Upstream DNS flow

Pod
 ↓
CoreDNS
 ↓
Upstream DNS resolver
 ↓
External domain IP

Diagram: Upstream DNS resolution

Pod
 ↓
CoreDNS
 ↓
AWS VPC DNS / upstream resolver
 ↓
api.stripe.com → IP address

This is the key idea:

  • For internal service names, CoreDNS resolves directly
  • For external names, CoreDNS forwards upstream

3. AWS VPC CNI: The Networking Layer

Once DNS resolution is done, the next question is:

How does the packet actually move?

That is where AWS VPC CNI comes in.

AWS VPC CNI is the networking plugin used by EKS. It gives Pods real IP addresses from the VPC subnet.

So instead of using an overlay network, Pods participate directly in AWS networking.

Pod networking flow

Pod A (10.0.1.25)
 ↓
AWS VPC network
 ↓
Pod B (10.0.2.18)

Diagram: Pod-to-Pod communication

Pod A
(IP from VPC subnet)
      ↓
VPC routing
      ↓
Pod B
(IP from VPC subnet)

This means:

  • Pod IPs come from AWS VPC
  • Traffic moves through AWS networking
  • VPC CNI handles the actual data path

4. Internal Service Communication: CoreDNS + VPC CNI Together

Now let’s combine both.

Suppose order-service wants to call review-service.

Full internal flow

Pod
 ↓
CoreDNS
 ↓
Service IP
 ↓
kube-proxy
 ↓
Target Pod
 ↓
VPC CNI network path

Diagram: Full internal service flow

order-service Pod
      ↓
CoreDNS resolves review-service.default.svc.cluster.local
      ↓
Service IP
      ↓
kube-proxy selects a target Pod
      ↓
Traffic flows through VPC networking
      ↓
review-service Pod

Here is the breakdown:

  • CoreDNS resolves the service name
  • kube-proxy handles Service-to-Pod routing
  • VPC CNI provides the actual Pod networking path

5. External API Communication: CoreDNS + Upstream + VPC CNI

Now imagine your application calls an external API.

Example:

https://api.stripe.com

Full external flow

Pod
 ↓
CoreDNS
 ↓
Upstream DNS
 ↓
External IP
 ↓
VPC CNI network
 ↓
NAT Gateway / internet path
 ↓
External API

Diagram: External service flow

Application Pod
      ↓
CoreDNS
      ↓
AWS VPC DNS resolver
      ↓
api.stripe.com → resolved IP
      ↓
VPC network
      ↓
NAT / internet
      ↓
Stripe API

This is where people often mix things up.

CoreDNS helps with the name lookup.

VPC CNI helps with the network movement.

They are both involved, but in different layers.

6. Simple Difference to Remember

Diagram: Role comparison

CoreDNS  = "What IP belongs to this name?"
VPC CNI  = "How do I send packets to that IP?"

Or even simpler:

CoreDNS = Name resolution
VPC CNI = Network delivery

7. Final Mental Model

Whenever a request happens, think in this order:

  1. Resolve the name — handled by CoreDNS
  2. Route the traffic — handled by kube-proxy if it is a Service
  3. Move the packets — handled by VPC CNI through AWS networking

Final end-to-end diagram

Pod
 ↓
CoreDNS
 ↓
Internal service IP
OR
Upstream DNS for external domain
 ↓
kube-proxy (for service traffic)
 ↓
VPC CNI networking
 ↓
Destination

Final Thought

If you are learning EKS, understanding these two components gives you a strong foundation.

  • CoreDNS helps Pods discover services and resolve names
  • AWS VPC CNI helps Pods communicate using real VPC IP addresses
  • Upstream DNS comes into the picture when the requested name is outside the cluster

Once you see them as parts of one flow, EKS networking becomes much easier to understand and debug.

Popular posts from this blog

☁️ AWS Global Accelerator (GA) + Route 53

🐳 Docker Filesystem Internals (AdvancEd)

Understanding RabbitMQ Classic Mirrored Queues and Quorum Queues

🐳 Docker Tutorial for Beginners: Step-by-Step with a Simple Example

☸️What’s Inside EKS? A Beginner’s Guide to Its Core Components

☸️ Kubernetes Taints and Tolerations(with Node Affinity)

AWS Load Balancer Controller Upgrade Guide: v2.x to v3.3

🐳 Build a Tiny Flask Web App in Docker (with Ports)

☁️ Amazon S3 Explained: More Than Just Object Storage

☸️ CoreDNS and AWS VPC CNI in EKS