Discovery
Resolve a stable name or registry entry into candidate network endpoints.
CMPE273 · Module 6
Trace a request through service discovery, balancing, health checks, and orchestration. Explore Gateway API, modern data planes, and a recoverable agent runtime.
Resolve a stable name or registry entry into candidate network endpoints.
The connection, request, or stream selected for assignment to a backend.
An instance’s eligibility to receive normal traffic; distinct from a restart decision.
A control loop that repeatedly moves observed resources toward desired state.
A verifiable identity used to authenticate a running service, separate from its address.
Recoverable progress and operation identity shared across disposable workers.
flowchart LR A["You + kubectl"] -->|"submit YAML"| C["Kubernetes API<br/>desired state"] C --> B["Controllers + scheduler"] B --> N["Node: kubelet + runtime"] N --> P["Pod<br/>application container"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d class C control
A cluster contains a control plane and worker nodes. Control-plane components arrange the work; node software starts containers. Application requests do not pass through kubectl.
flowchart LR C["Controller<br/>desired 3, sees 2"] --> N["Create Pod"] N --> S["Scheduler<br/>selects node"] S --> K["Kubelet<br/>starts container"] K --> R["Ready<br/>join endpoints"] R -. "observed state" .-> C classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class C,S control
Reconciliation is asynchronous. A new Pod needs scheduling, image startup, and readiness before it can receive traffic. No step restores a discarded local checkout session.
flowchart LR R["Registry or DNS"] -. "endpoint updates" .-> C["Client library"] C --> A["Service replica A"] R -. "endpoint updates" .-> P["Proxy or gateway"] U["Simple client"] --> P P --> B["Service replica B"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class R,P control
The upper path puts endpoint selection in the client; the lower path delegates it to a proxy. Both must handle stale membership and failed connections.
flowchart LR C["Client"] -->|"DNS lookup"| D["Cluster DNS"] D -. "Service IP" .-> C C -->|"new connection"| V["Service virtual IP<br/>data plane"] V --> P["Ready Pod"] E["EndpointSlice<br/>addresses + conditions"] -. "updates" .-> V K["Pod labels and readiness"] -.-> E classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class D,E,K control
DNS locates the Service; it is not in the path of every request. EndpointSlice updates inform routing, while the data plane carries application traffic.
flowchart LR C["Client<br/>requests 1, 2, 3"] -->|"one TCP connection"| L["L4 balancer"] L --> A["Backend A<br/>all three requests"] D["Client<br/>requests 1, 2, 3"] -->|"one HTTP/2 connection"| P["L7 proxy"] P --> B["Backend A: 1, 3<br/>Backend B: 2"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d class L,P control
Illustrative routing, not a guaranteed distribution. The L7 proxy uses separate upstream connections; it does not split one TCP connection across servers. An active stream stays with its selected backend.
flowchart LR S["Startup passes"] --> R["Readiness fails"] S --> L["Liveness fails<br/>past threshold"] R --> N["Remove from<br/>normal routing"] L --> X["Restart<br/>container"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class N,X warning
A configured startup probe gates the other probes until success. Failing readiness does not by itself restart a container; liveness failure can.
flowchart LR S["Runtime credential<br/>restricted delivery"] --> C["Ordering"] C -->|"locate"| D["Inventory<br/>Service name"] D -->|"request"| P["Verify identity<br/>authorize operation"] P -->|"allowed"| B["Business rules"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d class S,P control
Service discovery and authorization are separate controls. Runtime credentials identify the caller; Inventory still checks permission and enforces stock invariants.
flowchart LR A["v1 serves"] --> B["v2 starts"] B --> C["v2 ready"] C --> D["Terminate v1"] D --> E["Routing updates<br/>and draining"] E --> F["v1 exits"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class D,E warning
This is a desired rollout sequence, not an atomic handoff. Existing connections and delayed routing updates require explicit shutdown behavior and testing.
flowchart LR W["Work arrives"] --> P["Ready replicas"] P --> M["Load metrics"] M --> H["Autoscaler<br/>desired count"] H --> D["Scheduling<br/>startup delay"] D --> P classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class M,H control
Metrics describe past load; useful capacity arrives later. Set bounds and stabilization, and check whether the database or provider quota is the true bottleneck.
flowchart LR R["HTTPRoute<br/>matches + weights"] -. "configures" .-> G["Gateway<br/>selected GatewayClass"] U["Client"] --> G G -->|"90 weight"| A["Stable Service"] G -->|"10 weight"| B["Canary Service"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d class R,G control
The weights illustrate a canary policy, not exact counts in a small sample. The selected controller reconciles these resources into actual routing behavior.
flowchart LR A["Ordering app"] --> P["Proxy"] --> Q["Proxy"] --> B["Inventory app"] C["Istio control plane"] -. "identity + policy" .-> P C -. "identity + policy" .-> Q classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d class C control
The proxies authenticate peers, enforce configured policy, and measure traffic. Istio’s control plane distributes configuration; business requests flow through the data plane, not through that control plane.
flowchart LR A["Sidecar mode<br/>application Pod"] --> B["Local Envoy<br/>L4 + L7"] --> D["Destination proxy + app"] E["Ambient mode<br/>application Pod"] --> C["Node ztunnel<br/>L4 secure overlay"] --> W["Waypoint when needed<br/>L7 policy"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d class C control
These are simplified placement paths. Ambient also uses destination-side ztunnel handling; a waypoint is not required for the L4-only path. Feature support and traffic enrollment must be checked for the deployed version.
flowchart LR C["Client"] --> S["Stable Service"] S --> A["Pod A<br/>ready"] S -. "routing removed" .-> B["Pod B<br/>not ready"] D["Controller"] --> R["Replacement<br/>after deletion"] R -. "when ready" .-> S classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class B warning class D control
Readiness failure changes traffic eligibility without replacing the Pod. Deletion triggers replacement. A Service name stays stable across both experiments.
flowchart LR A["Agent request<br/>model + token budget"] --> G["Compatible inference gateway"] G --> P["Endpoint picker<br/>eligible model replicas"] M["Serving metrics"] -.-> P P --> R1["Model replica A"] P --> R2["Model replica B"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class G,P,M control
The picker chooses among eligible model servers. Cache reuse may save work, but sending everything to one warm replica can worsen queueing.
flowchart LR A["Agent runtime"] --> L["Locate server"] L --> C["Inspect tools<br/>or Agent Card"] C --> P["Verify identity<br/>check permission"] P --> T["Invoke tool"] classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class C,P control
Capabilities describe available interfaces. Identity and policy determine allowed actions; untrusted descriptions or tool results cannot grant new permissions.
flowchart LR P["Disruption<br/>planner reacts"] --> V["Store proposal<br/>exact-version approval"] V --> X["Executor<br/>check constraints"] X --> T["Booking tool<br/>operation key"] T --> R["Record result<br/>or reconcile"] R -. "durable progress" .-> V classDef control fill:#fff3da,stroke:#9b6b16,color:#35260d classDef warning fill:#ffebe7,stroke:#bd5949,color:#542b24 classDef data fill:#e8eefc,stroke:#556bb4,color:#24345e class V,X control class R data
Discovery and balancing keep workers reachable. Durable state, concurrency control, approval checks, and provider repeat handling preserve the booking invariant.
Kubernetes (K8s) runs containerized applications across a cluster of machines.
Four objects make the lab readable: Namespace, Deployment, Pod, and Service.
Names outlive instances; discovery information can still become stale.
A Service gives changing Pods a stable access point.
A connection is a reusable channel; a request is one operation sent through it.
Equal request counts do not imply equal cost or equal latency.
Discuss: Replica A has one 30-second generation; B has three 10-millisecond reads. Is active-request count enough?
Each probe answers a different operational question.
Failure handling can overload the very service it is trying to recover.
A discovered address tells you where; verified identity tells you who.
A new version must become ready before an old replica disappears.
Add replicas for the bottleneck you can actually relieve.
Traffic policy is an API contract implemented by a controller and data plane.
Make service-to-service security, traffic policy, and telemetry consistent.
The mesh capabilities you need determine where proxies must run.
Predict what changes before running the failure experiment.
A model request may occupy an accelerator far longer than a normal API lookup.
Finding an endpoint and finding a useful tool are different discovery problems.
Use dynamic reasoning inside a workflow with durable, enforceable boundaries.
A good diagram explains where a request goes and what happens when that path fails.
Discuss: Which runtime control improves availability, and which application rule preserves correctness? Identify both for your failure experiment.
Canvas remains the official source for project requirements, deadlines, submissions, and grading.
Observe two replicas, readiness removal, replacement, and recovery.
Connect runtime choices to a measurable failure experiment.