Istio (service mesh)
Basic information
Section titled “Basic information”| Item | Value |
|---|---|
| Version | 1.30.1 (pilot / proxyv2 / install-cni) |
| Official docs | Istio documentation |
| Upstream source | common/istio |
Concepts and features
Section titled “Concepts and features”Istio is a service mesh that controls network communication between workloads without changing application code. It attaches an Envoy sidecar proxy to each Pod to intercept traffic, and a central control plane (istiod) configures those proxies together. As a result, routing, encryption (mTLS), authorization, and observability are handled declaratively in the infrastructure layer outside the application.
Kubeflow uses Istio as infrastructure rather than as an optional add-on. Once a Pod joins the mesh, its traffic behavior is governed by sidecars, gateway configuration, authorization policy, and mesh-wide settings distributed by the control plane.
Architecture components
Section titled “Architecture components”The core components are split into the control plane and the data plane.
- istiod (control plane): distributes proxy configuration over xDS, acts as the mesh CA that issues workload certificates, and performs automatic sidecar injection.
- Envoy sidecar (data plane): injected into each workload Pod and actually handles inbound and outbound traffic.
- ingress-gateway: the entry proxy that brings traffic from outside the cluster into the mesh.
- istio-cni: handles traffic redirection in CNI mode, so workload Pods do not need a privileged init container (friendly to PodSecurity restricted).
Custom resources (CRD)
Section titled “Custom resources (CRD)”Behavior is declared with the main custom resources (CRDs).
- Gateway: defines which ports and hosts accept external traffic (the entrypoint).
- VirtualService: routing rules per host and path (which Service to send traffic to).
- DestinationRule: destination policy (load balancing, mTLS mode, and so on).
- AuthorizationPolicy: authorization rules for who may access what.
- PeerAuthentication: the mTLS enforcement level between workloads.
- Telemetry / EnvoyFilter: metrics, logs, and traces, and proxy extensions (for example, an external authorization filter).
Kubeflow leans especially hard on Gateway, VirtualService, and AuthorizationPolicy.
Role in Kubeflow
Section titled “Role in Kubeflow”Background
Section titled “Background”The foundation of Kubeflow is “routing a signed-in user safely to their own namespace”, and Istio lays that foundation. Every web app and controller communicates on top of this mesh, so without Istio none of login, routing, isolation, or serving works.
Kubeflow is fundamentally a multi-service web platform. Users sign in once and then navigate to Dashboard, Notebooks, Pipelines, KServe, Katib, and other tools that all live behind one shared entrypoint.
Key contributions
Section titled “Key contributions”- Single entrypoint: exposes every web app, including Dashboard, Notebooks, Pipelines UI, and KServe, behind one ingress-gateway, separated by path. There is no need to open a separate ingress for each component.
- Authorization delegation point: registers oauth2-proxy as ExtAuthZ through
extensionProvidersin meshConfig, and sends only requests without anauthorizationheader there to enforce interactive login. This is the actual enforcement point for the Dex login requirement. - Multi-tenancy isolation: controls access per namespace and user with
AuthorizationPolicy, and encrypts communication between workloads with sidecar mTLS. - Serverless serving integration: the Knative routing used by KServe also runs on top of this mesh (and the cluster-local-gateway).
- Observability foundation: with
defaultProviders.metrics: [prometheus]in meshConfig, istiod injects theistio.statstelemetry filter into sidecars to generate traffic metrics (istio_requests_totaland others). This is the source of the Kiali graph and the Prometheus data. If those defaults disappear, Kiali graphs and Prometheus-based traffic views degrade quickly.
Deployment structure
Section titled “Deployment structure”Overlay layout
Section titled “Overlay layout”- base:
overlays/dev/istio/basereferencescommon/istio/istio-crds/baseandcommon/istio/istio-namespace/base. It establishes the Istio CRDs and theistio-systemnamespace first. The control plane depends on these CRDs. - overlays/oauth2-proxy:
overlays/dev/istio/overlays/oauth2-proxyreferencescommon/istio/istio-install/overlays/oauth2-proxy. It installs istiod, istio-cni, ingress-gateway, and the meshConfig for the oauth2-proxy ExtAuthZ integration. The CRDs must be Established first. This OAuth2-aware overlay adds the gateway authorization behavior that sends browser requests through oauth2-proxy while preserving the bearer-token path.
This overlay includes two patches added by this repository.
remove-istio-ingressgateway-gateway.yaml: removes the duplicateistio-ingressgatewayGateway that conflicts with kubeflow-gateway, using$patch: delete(resolves the IST0145 Gateway conflict).restore-telemetry-defaultproviders.yaml: restoresdefaultProviders.metrics: [prometheus], which was dropped when the oauth2-proxy patch overwrote meshConfig (restores Kiali metrics).
Apply order
Section titled “Apply order”Istio enforces ordering by separating CRD and namespace establishment from control plane installation. The CRDs and namespace in base must be Established before istiod and the control plane in overlays/oauth2-proxy are applied, because the control plane cannot be created until the API types already exist.
Deployment view
Section titled “Deployment view”Resource Placement
Section titled “Resource Placement”| Namespace | Resource | Name | Purpose |
|---|---|---|---|
| (cluster) | CRD | *.istio.io (Gateway, VirtualService, AuthorizationPolicy, Telemetry …) | Mesh API |
| (cluster) | Mutating/Validating Webhook | istio-* | Sidecar injection / configuration validation |
istio-system | Deployment | istiod | Control plane (xDS · CA · injection) |
istio-system | DaemonSet | istio-cni-node | CNI-mode traffic redirection |
istio-system | Deployment + Service | istio-ingressgateway | Cluster entry gateway |
istio-system | ConfigMap | istio (meshConfig) | ExtAuthZ (oauth2-proxy) + telemetry (prometheus) settings |
istio-system (root namespace) | AuthorizationPolicy | global-deny-all | Empty spec, establishing a mesh-wide default deny |
Diagram
Section titled “Diagram”PlantUML source:
Request flow
Section titled “Request flow”Who decides authorization: AuthorizationPolicy and ExtAuthZ
Section titled “Who decides authorization: AuthorizationPolicy and ExtAuthZ”Istio authorization is expressed with AuthorizationPolicy resources, and two kinds are applied together in this deployment. Istio does not authenticate users by itself. Instead, it provides the enforcement point.
global-deny-all: a mesh-wide default-deny policy placed in the root namespace (istio-system). Whenspecis empty, it becomes “an ALLOW policy that matches no request”, so every request that is not explicitly allowed is blocked.
apiVersion: security.istio.io/v1kind: AuthorizationPolicymetadata: name: global-deny-all namespace: istio-systemspec: {}CUSTOMaction AuthorizationPolicy: for requests entering the ingress-gateway without anauthorizationheader, Istio does not decide allow or deny itself but delegates the decision to an external authorizer. That external authorizer is oauth2-proxy. This “ask an external party” approach is called ExtAuthZ (external authorization).
In other words, the AuthorizationPolicy is wiring that declares “ask oauth2-proxy whether this request may pass”, and oauth2-proxy makes the actual decision about whether the user is logged in. The AuthorizationPolicy itself does not check login.
ExtAuthZ does not apply to every request
Section titled “ExtAuthZ does not apply to every request”There is one important caveat. The CUSTOM policy does not send every request entering the gateway to oauth2-proxy. It narrows the target requests with a when condition.
action: CUSTOM provider: name: oauth2-proxy rules: - when: - key: request.headers[authorization] notValues: ["*"]notValues: ["*"] means “requests where the authorization header is absent”. An M2M request carrying Authorization: Bearer therefore does not trigger the ext_authz call at all, bypasses oauth2-proxy, and goes straight to JWT validation by RequestAuthentication.
Istio evaluates authorization in the order CUSTOM -> DENY -> ALLOW. ext_authz (CUSTOM) is evaluated first, then DENY (require-jwt), and finally ALLOW, and a rejection at any stage ends evaluation immediately.
How oauth2-proxy and Dex are connected
Section titled “How oauth2-proxy and Dex are connected”The three components have different roles.
- Istio (gateway): receives the request and asks oauth2-proxy through ExtAuthZ “may this request pass?”. If the answer is OK, it sends the request to the app; otherwise it blocks it.
- oauth2-proxy: checks whether the request has a valid session cookie. If it does, oauth2-proxy lets it through and passes user information to the app in headers such as
X-Auth-Request-Email. If not, it redirects to the Dex login page. In other words, it is the “session manager and OIDC client”. - Dex: the OIDC IdP (identity issuer) that actually authenticates the user. It verifies the user with a username and password (or an upstream connector) and issues tokens.
The connection itself consists of two settings. First, Istio meshConfig registers oauth2-proxy as an authorizer in extensionProviders, and the CUSTOM AuthorizationPolicy points to that provider, which creates the gateway -> oauth2-proxy call. Second, the oauth2-proxy configuration points to Dex as the OIDC issuer (redirecting to /dex/auth at login and exchanging tokens directly with Dex), which creates the oauth2-proxy -> Dex connection. These two pieces of wiring make the flow “a request that is not logged in is caught by oauth2-proxy at the gateway and sent to Dex, and passes once login completes” work.
Request authentication and routing
Section titled “Request authentication and routing”External requests enter through the ingress-gateway, where the path splits depending on whether an authorization header is present. Without the header, the request is checked by oauth2-proxy through ExtAuthZ, and an unauthenticated user is redirected to the Dex login. Dex redirects the browser back to /oauth2/callback with an authorization code that oauth2-proxy exchanges for a token over a back-channel call; once a session exists, oauth2-proxy allows the request and forwards the Dex id_token so a RequestAuthentication can establish a principal. With the header, the request bypasses oauth2-proxy and goes through JWT validation by RequestAuthentication. In both paths, once a principal is established, the request passes the require-jwt DENY and is routed to the target app, and the traffic that passes is protected by mTLS through the sidecars. The details of the OIDC exchange inside Dex are covered in the Dex article.
PlantUML source:
M2M authentication note (backend/API calls)
Section titled “M2M authentication note (backend/API calls)”The flow above is interactive browser-based login. When a backend service calls Kubeflow APIs (KFP, model registry, and so on) through the gateway, it cannot use browser redirects, so it uses token-based M2M (machine-to-machine) authentication. The details are covered in the oauth2-proxy and dex component articles; this section summarizes only the points from the Istio side.
- The same authentication gate at the gateway applies to API calls, but the client presents
Authorization: Bearer <token>instead of a session cookie. - This deployment adopts the
m2m-dex-and-kindoverlay, so IstioRequestAuthenticationvalidates the JWT (mainly a Kubernetes ServiceAccount projected token with the correct audience). Because theauthorizationheader is present, the request does not match thewhencondition of the CUSTOM policy, so such requests bypass oauth2-proxy and go straight to JWT validation. - The token issuer and audience must match the values RequestAuthentication trusts (a mismatch is a common cause of M2M authentication failures), and which profile namespace permissions that identity maps to matters for KFP multi-user RBAC. The verified identity is passed downstream using headers such as
kubeflow-userid. - Conversely, when an API Service is called directly inside the cluster (ClusterIP), the gateway ExtAuthZ does not apply; instead, mesh mTLS, the
global-deny-allAuthorizationPolicy, and the target API’s own identity check (for example, thekubeflow-useridheader) apply.
Istio is the place where both the browser path and the machine path are enforced.
Dependencies and interactions
Section titled “Dependencies and interactions”Prerequisites / downstream
Section titled “Prerequisites / downstream”- Prerequisites: it is natural to place Istio after
kubeflow-namespace. Istio itself does not depend on cert-manager (istiod has its own CA). - Downstream (depends on Istio):
oauth2-proxy(the ExtAuthZ target),kubeflow-istio-resources(creates the kubeflow-gateway Gateway),dex,dashboard,knative-serving,kserve, and essentially every routed app.
Runtime interactions
Section titled “Runtime interactions”Inbound requests take the ingress-gateway -> ExtAuthZ (oauth2-proxy) -> Dex login path only when there is no authorization header; with the header, they bypass oauth2-proxy and go to RequestAuthentication. istio-cni redirects sidecar traffic, and only requests evaluated in the order CUSTOM -> DENY -> ALLOW on top of the global-deny-all default deny reach the target app. Sidecars, gateway policies, and application routes combine to enforce traffic identity, routing, and tenant boundaries across the platform.
References
Section titled “References”- Because CNI mode is used, workload Pods have no privileged init container, which fits well with PodSecurity restricted.
- overlay:
overlays/dev/istio/base,overlays/dev/istio/overlays/oauth2-proxy - Related articles:
- Authentication flow
- Observability (Prometheus + Kiali) - cross-cutting article planned
Istio is the traffic spine of this Kubeflow deployment. It is where routing becomes centralized, where auth decisions are enforced, where service-to-service encryption becomes consistent, and where much of the platform’s multi-tenant isolation actually takes effect.