Course contentsShow
← Cloud and Infrastructure
Lesson 1582 of 2,98932. Service Mesh FoundationsFree lesson

DestinationRule Basics

Understand how DestinationRule configures load balancing, connection pools, and subsets.

DestinationRule Basics

What you'll learn: How DestinationRule configures traffic policies for services after routing decisions are made.

What Is a DestinationRule?

While VirtualService determines where traffic goes, DestinationRule defines how it behaves when it gets there. Think of VirtualService as the GPS navigator routing you to a restaurant, and DestinationRule as the house rules once you arrive—how many guests per table, which entrance to use, what dress code applies.

A DestinationRule applies traffic policies to a service's endpoints after Istio's routing decision is complete. It operates at the destination, configuring how Envoy proxies communicate with the actual service instances.

Core Capabilities

Load Balancing

DestinationRule lets you specify load balancing algorithms beyond Kubernetes defaults—round-robin, random, least-request, or consistent hashing based on headers or source IP.

Connection Pooling

You control connection limits, timeouts, and TCP settings to prevent overwhelming backend services. This includes max connections, concurrent requests, and connection timeouts—protecting services from overload.

Subsets

DestinationRule defines subsets—named groups of service endpoints based on labels (like version or environment). A subset might be "v1" or "v2" of your service. VirtualService can then route traffic to these specific subsets, enabling canary deployments or A/B testing.

How It Works Together

VirtualService routes requests to a destination and optionally specifies a subset. DestinationRule configures that destination's behavior, including defining what those subsets mean and how traffic to them should be handled.

Key Takeaway: DestinationRule configures post-routing traffic policies—load balancing algorithms, connection pool limits, and labeled subsets—determining how clients communicate with service instances after VirtualService decides where traffic should go.