Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 36 ยท Service Mesh Concepts

The Istio Resource Model

A map of Istio's custom resources and the Gateway API: what each of VirtualService, DestinationRule, Gateway, ServiceEntry, Sidecar and policies does.

You configure Istio by creating Kubernetes custom resources. There are about a dozen kinds you will use regularly, and they fall into four families: traffic, gateways and external services, security, and telemetry. This lesson is a map you can return to; later lessons go deep on each.

Resource families

Traffic

VirtualService How requests are routed.
DestinationRule Policy for the target.
Sidecar Limit what a proxy knows.
1 / 3

Traffic resources

  • VirtualService decides where a request goes: match on host, path, header or port, then route to a destination with weights, retries, timeouts, mirroring or fault injection.
  • DestinationRule decides how to talk to the destination once chosen: named subsets (v1, v2 by pod label), load-balancing algorithm, connection pool limits, outlier detection and the TLS mode.
  • Sidecar (the resource, not the container) limits which services a proxy loads configuration for. In big meshes it saves memory and speeds up pushes.
  • ProxyConfig and EnvoyFilter tweak the proxy itself. EnvoyFilter patches raw Envoy config and is an escape hatch to avoid when you can.

The relationship matters: a VirtualService names a destination host and optionally a subset; the DestinationRule for that host defines the subset. A VirtualService that names a subset with no matching DestinationRule gives a "no healthy upstream" style error. See Virtual Services and Destination Rules.

Edge and external resources

  • Gateway (Istio's own kind) describes ports, protocols, TLS and hosts for an ingress or egress proxy; a VirtualService bound to it routes the accepted traffic.
  • ServiceEntry adds a service the mesh does not know, such as api.payments.example.com, to its registry so policies and telemetry apply. See Service Entries and Egress Control.
  • WorkloadEntry and WorkloadGroup register virtual machines or other non-pod workloads.

Security resources

Telemetry

  • Telemetry configures metrics, access logs and tracing per mesh, namespace or workload.

Gateway API

Kubernetes has its own newer API, Gateway API (Gateway, HTTPRoute, GRPCRoute...). Istio supports it and, for new work, it is the recommended way to configure ingress and, in ambient mode, waypoints. The two models overlap: Istio's Gateway + VirtualService pair versus Gateway API's Gateway + HTTPRoute. Both still work; this track teaches the Istio resources first because they expose every feature, and points out the Gateway API equivalents where they matter.

Scope and precedence

Most resources follow a pattern of three scopes:

  1. Mesh-wide: placed in the root namespace (istio-system by default).
  2. Namespace-wide: placed in the namespace, with no workload selector.
  3. Workload-specific: with a selector matching pod labels.

The most specific wins. For example, a mesh-wide PeerAuthentication of STRICT can be relaxed to PERMISSIVE for a single workload by a selector-based policy in its namespace.

Two small tools

This stand-in checks that a VirtualService's destination subsets exist in a DestinationRule. It captures the rule above (subsets must be defined) on plain dictionaries, with no Kubernetes.

Python Stand-in: dangling subset detector

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Python Stand-in: most specific scope wins

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which resource defines named subsets such as v1 and v2?

    Subsets belong to the DestinationRule; a VirtualService refers to them by name.
  2. 2. What is a ServiceEntry for?

    ServiceEntry lets policies and telemetry apply to services outside the mesh's automatic discovery.
  3. 3. A mesh-wide STRICT policy and a workload-level PERMISSIVE policy both apply to a pod. Which wins?

    Workload scope overrides namespace scope, which overrides mesh scope.
  4. 4. Which Kubernetes-native API can Istio also use for ingress routing?

    Istio implements Gateway API alongside its own Gateway and VirtualService resources.

Summary

  • Traffic: VirtualService (where), DestinationRule (how), Sidecar (what a proxy sees).
  • Edges: Gateway, ServiceEntry, WorkloadEntry.
  • Security: PeerAuthentication, RequestAuthentication, AuthorizationPolicy.
  • Telemetry: the Telemetry resource.
  • Scope: mesh, namespace, workload; the most specific wins. Gateway API is the Kubernetes-native alternative.

Next: Virtual Services and Destination Rules