Knative Serving
Basic information
Section titled “Basic information”| Item | Value |
|---|---|
| Version | Knative 1.22.0 |
| Official docs | Knative Serving |
| Upstream source | common/knative/knative-serving, common/istio/cluster-local-gateway |
Concepts and characteristics
Section titled “Concepts and characteristics”Knative provides a serverless workload model on top of Kubernetes. In Kubeflow, Knative Serving is used mainly so that KServe can run InferenceService resources in serverless form and delegate routing, revisions, scale-to-zero, and activator-based request handling to it. This document focuses on Knative Serving as the foundation of KServe serving.

In this repository it is not treated as a stand-alone end-user product. It is mainly the substrate that lets KServe run InferenceService predictors in serverless mode.
What the component establishes
Section titled “What the component establishes”- Knative Serving control plane: installs
activator,autoscaler,controller,webhook,net-istio-controller, andnet-istio-webhook. - Serving CRDs: provides the APIs that the KServe serverless runtime depends on, such as
services.serving.knative.dev,revisions.serving.knative.dev,routes.serving.knative.dev, andconfigurations.serving.knative.dev. - Kubeflow gateway integration: removes the default
knative-ingress-gatewayand patchesconfig-istioso that it useskubeflow/kubeflow-gatewayandistio-ingressgateway. - cluster-local-gateway integration: keeps the Service/Gateway name
knative-local-gateway, but points its selector at thecluster-local-gatewayworkload so that it handles the internal KServe serving hop. - Serving M2M 2-hop JWT validation: adds the legacy ServiceAccount token issuer to the
cluster-local-gateway-jwtRequestAuthentication so that the second gateway hop of external serving calls also passes.
Kubeflow-specific changes
Section titled “Kubeflow-specific changes”Upstream Knative can create its own ingress gateway, but this deployment manages Kubeflow web app traffic and serving traffic inside the Istio and Kubeflow gateway topology. For that reason the Knative Serving base removes knative-ingress-gateway and adds gateway.kubeflow.kubeflow-gateway: istio-ingressgateway.istio-system.svc.cluster.local to config-istio.
progressDeadline in config-deployment is raised to 600s, because large model image pulls and container startup can take longer than the default.
Role in Kubeflow
Section titled “Role in Kubeflow”Background
Section titled “Background”KServe does not treat a model serving workload as a plain Deployment. An InferenceService creates predictor revisions, the activator and autoscaler get involved depending on request volume, and external and internal endpoints are built from route and domain settings. Without this serverless layer, the KServe serverless serving path, scale-to-zero, and revision-based rollout do not work.
Without Knative Serving:
- revision-based rollout would disappear,
- scale-to-zero would disappear,
- the activator and autoscaler path would disappear,
- and the KServe serverless execution path described by this repository would not exist.
Key contributions
Section titled “Key contributions”- KServe serverless substrate: provides the APIs and controllers that let the KServe controller materialize an
InferenceServiceas a Knative Service, Revision, and Route. - Istio routing integration: makes the Routes and VirtualServices created by Knative use the Kubeflow gateway and local gateway setup.
- Internal serving hop security: puts JWT validation and an AuthorizationPolicy on cluster-local-gateway as well, so the second hop of KServe serving is not left open to anonymous traffic.
- Kubeflow RBAC extension: adds aggregation labels to the Knative namespaced admin/edit/view ClusterRoles so that their permissions are merged into
kubeflow-admin,kubeflow-edit, andkubeflow-view.
Deployment structure
Section titled “Deployment structure”Overlay layout
Section titled “Overlay layout”The dev overlay in this repository is a thin wrapper around the upstream common overlay. Serving applies the main body and the cluster-local-gateway M2M auth separately.
overlays/dev/knative-serving/overlays/gateways -> common/knative/knative-serving/overlays/gateways -> common/knative/knative-serving/base
overlays/dev/knative-serving/overlays/cluster-local-gateway -> common/istio/cluster-local-gateway/overlays/m2m-auth -> common/istio/cluster-local-gateway/base -> dev patch: legacy issuer kubernetes/serviceaccountApplied units
Section titled “Applied units”| Applied unit | Main content | Reason |
|---|---|---|
knative-serving/overlays/gateways | Serving core, net-istio, Kubeflow gateway patch, Knative local gateway selector patch | control plane and routing basis for KServe serverless serving |
knative-serving/overlays/cluster-local-gateway | cluster-local-gateway workload, Gateway, RequestAuthentication, AuthorizationPolicy | internal KServe serving hop and 2-hop JWT validation |
Critical wiring
Section titled “Critical wiring”| Item | Value / behavior | Meaning |
|---|---|---|
config-istio | gateway.kubeflow.kubeflow-gateway -> istio-ingressgateway.istio-system.svc.cluster.local | connects the Knative external gateway to the Kubeflow gateway |
knative-ingress-gateway | removed | no separate Knative ingress gateway is created |
knative-local-gateway Service | selector app: cluster-local-gateway, istio: cluster-local-gateway | keeps the name Knative and KServe expect, while the actual Pods are cluster-local-gateway |
knative-local-gateway Gateway | selector app: cluster-local-gateway, istio: cluster-local-gateway | delivers local gateway traffic to the cluster-local-gateway workload |
cluster-local-gateway-jwt | two bound token issuers + legacy issuer kubernetes/serviceaccount | KServe serving 2-hop JWT validation |
config-domain | example.com: "" | Knative default domain placeholder |
Deployment view
Section titled “Deployment view”Resource Placement
Section titled “Resource Placement”| Namespace | Resource | Name | Role |
|---|---|---|---|
knative-serving | Deployment | activator | receives requests in front of scaled-to-zero revisions and triggers Pod activation |
knative-serving | Deployment | autoscaler | scales revisions based on request metrics |
knative-serving | Deployment | controller | reconciles Knative Service, Route, Revision, and Configuration |
knative-serving | Deployment | webhook | validation and defaulting for Serving resources |
knative-serving | Deployment | net-istio-controller, net-istio-webhook | connects Knative Routes to Istio VirtualServices and Gateways |
knative-serving | ConfigMap | config-istio, config-domain, config-deployment | gateway, domain, and deployment deadline settings |
knative-serving | Gateway | knative-local-gateway | the Istio Gateway name referenced by local serving routes |
istio-system | Service | knative-local-gateway | its selector actually points at cluster-local-gateway Pods |
istio-system | Deployment + Service | cluster-local-gateway | second gateway hop for internal KServe serving routes |
istio-system | RequestAuthentication | cluster-local-gateway-jwt | Bearer token validation at cluster-local-gateway |
istio-system | AuthorizationPolicy | cluster-local-gateway, cluster-local-gateway-require-jwt | allows only requests with a JWT principal and rejects anonymous requests |
| (cluster) | CRD | *.serving.knative.dev and others | Knative Serving API |
| (cluster) | ClusterRole | knative-serving-namespaced-* | user-facing permissions merged into Kubeflow aggregated RBAC |
Diagram
Section titled “Diagram”PlantUML source:
Dependencies and interactions
Section titled “Dependencies and interactions”Prerequisites / downstream
Section titled “Prerequisites / downstream”- Prerequisites: Istio control plane,
istio-ingressgateway,kubeflow-gateway, the cluster JWKS proxy, and the baseline roles for Kubeflow aggregated RBAC. - Downstream: the KServe controller and the KServe
InferenceServiceruntime, plus Profile-namespace serving workloads that rely on Knative revisions, routes, and autoscaling. - Documents to read together: serving external host and Dashboard host separation is covered in Kubeflow Istio Resources, M2M 2-hop authentication in Authentication flow, and user-namespace permissions and the serving predictor ALLOW policy in Multi-tenancy and User Profile.
Runtime interactions
Section titled “Runtime interactions”When KServe reconciles an InferenceService, a Service, Revision, and Route are created through the Knative Serving API, and the Serving controller and net-istio-controller materialize them as Pods, Services, and Istio VirtualServices. In the scaled-to-zero state, the activator receives the request and triggers revision Pod activation, and the autoscaler adjusts the replica count according to request metrics.
In order, the runtime path is:
- KServe creates Knative Serving resources.
- Knative
controllerandnet-istio-controllerreconcile them. - Knative creates the revision Deployment/ReplicaSet/Pods and routing resources.
- If there is no ready Pod,
activatorhandles the initial request path. autoscaleradjusts replica counts based on traffic.- External traffic enters through
istio-ingressgatewayusing the Kubeflow gateway mapping. - Internal serving traffic traverses the
cluster-local-gatewayhop through the preservedknative-local-gatewaynaming contract.
External serving requests arrive on the kserve.10.x.x.x.nip.io host and get the first JWT validation at istio-ingressgateway. When the KServe/Knative route forwards them to the internal predictor host, they pass through cluster-local-gateway as the second hop. At that point cluster-local-gateway-jwt must also contain the legacy issuer kubernetes/serviceaccount, so that legacy ServiceAccount tokens such as platform-api-token pass. If only the first hop validates JWTs, the second hop can still reject the request. This matters especially for machine-to-machine callers that use ServiceAccount-derived tokens rather than browser-driven auth flows. Changes to RequestAuthentication and AuthorizationPolicy are pushed through xDS, so they take effect without restarting Pods.
Knative is a prerequisite layer. If it is unhealthy, KServe failures can appear higher in the stack even though the root cause is here.
Key resources
Section titled “Key resources”config-istio: sets the Kubeflow gateway as the external gateway Knative uses.knative-local-gatewayService/Gateway: the name is the local gateway Knative and KServe expect, but the actual workload iscluster-local-gateway.cluster-local-gateway-jwt: the JWT validation point for the serving second hop. It trusts both the bound token issuers and the legacy issuer.cluster-local-gateway-require-jwt: rejects requests without a JWT principal, except on health/metrics paths.activator,autoscaler,controller,webhook: the core control plane for the Knative Serving runtime and API lifecycle.- Knative namespaced ClusterRole: merged into Kubeflow aggregated RBAC so that Profile-namespace users can manage Knative and KServe related resources.
Knative Serving is the serverless execution substrate underneath KServe in this repository. Its real value is not a user-facing UI but a reliable contract for revisions, autoscaling, activator behavior, and request routing that fits the Kubeflow gateway topology. The repository-specific patches mostly exist to make that substrate work with the shared ingress design and the two-hop JWT security model.
References
Section titled “References”- overlay:
overlays/dev/knative-serving/overlays/gateways - overlay:
overlays/dev/knative-serving/overlays/cluster-local-gateway - upstream:
common/knative/knative-serving,common/istio/cluster-local-gateway - Related documents:
Additional applied adjustments
Section titled “Additional applied adjustments”The following table summarizes the additional adjustments applied to the deployment.
| Adjustment | Target | Why it exists |
|---|---|---|
Remove knative-ingress-gateway | Knative gateway resources | avoid creating a second, separate ingress gateway stack |
Patch config-istio | Knative config | map gateway.kubeflow.kubeflow-gateway to istio-ingressgateway.istio-system.svc.cluster.local |
Keep knative-local-gateway names | Service and Gateway | preserve the names Knative and KServe expect |
Redirect selectors to cluster-local-gateway | Service and Gateway selectors | make the actual traffic land on the repository’s shared local-gateway workload |
Add legacy issuer support to cluster-local-gateway-jwt | RequestAuthentication | allow the second hop to accept legacy ServiceAccount tokens such as platform-api-token |
Extend progressDeadline to 600s | config-deployment | large model images can need longer pulls and slower startup |