istio pilot discovery server
The main code that setup istio pilot discovery server are located here in istio/pilot/pkg/bootstrap/server.go where you will get to see al the magic happens.
Istio Pilot (also known as the Discovery Server or istiod in newer versions) is the control plane component in Istio responsible for service discovery, configuration management, and traffic routing. It's the central brain that coordinates all the Envoy proxies (sidecars and gateways) in your service mesh. Most importantly it converts high-level Istio API resources (VirtualService, DestinationRule, Gateway, etc.) into Envoy-specific configuration.
It also expos the xDS API (x Discovery Service) protocols to push config to proxies such as
Purpose: Defines how Envoy accepts connections
What it configures: Listeners (ports/endpoints Envoy listens on)
Key Details:
- Each listener defines:
- IP address and port (e.g.,
0.0.0.0:15001,0.0.0.0:15006) - Protocol type (HTTP, TCP, gRPC, etc.)
- Filter chains (network filters, HTTP filters)
- Socket options
- IP address and port (e.g.,
- In Istio, common listeners:
15001: Inbound listener for sidecar traffic15006: Outbound listener for application traffic15021: Health check port
Example LDS Config Snippet:
Purpose: Defines where to route traffic for HTTP listeners
What it configures: Routes (HTTP path/headers -> backend clusters)
Key Details:
- Only applies to HTTP listeners (not TCP)
- Defines routing rules based on:
- HTTP paths (
/api/v1/*) - Headers (
user-agent: Chrome) - Methods (
GET,POST) - Query parameters
- HTTP paths (
- Routes traffic to clusters (defined in CDS)
Example RDS Config Snippet:
What it configures: Clusters (groups of upstream hosts/ports)
Key Details:
- Defines backend service endpoints:
- Service name (e.g.,
reviews.default.svc.cluster.local:9080) - Load balancing policy (round_robin, least_conn)
- Health checks
- Circuit breakers
- TLS settings
- Service name (e.g.,
- Each cluster points to endpoints (EDS)
Example CDS Config Snippet:
- LDS tells Envoy: "Listen on port 15006"
- RDS tells Envoy: "When you get HTTP requests on port 15006, route
/apito cluster X" - CDS tells Envoy: "Cluster X is
reviews.default.svc.cluster.local:9080" - EDS (Endpoint Discovery Service) tells Envoy: "The actual pods for
reviewsare at[10.244.1.5:9080, 10.244.2.7:9080]"
Comments