Implementation:Kserve Kserve IngressReconciler
| Knowledge Sources | |
|---|---|
| Domains | Networking, Kubernetes, Service_Mesh |
| Last Updated | 2026-02-13 00:00 GMT |
Overview
Concrete Go reconciler that creates VirtualService or HTTPRoute resources to expose InferenceService prediction endpoints externally.
Description
The IngressReconciler creates and manages Kubernetes networking resources that route external traffic to InferenceService components. It supports Istio VirtualService, Gateway API HTTPRoute, and Knative-managed networking. The reconciler derives the service host from component URLs, builds the full external URL using the domain template from ConfigMap, and sets status.url and status.address.
Usage
This reconciler is called as part of the InferenceService reconciliation loop (after component reconciliation). It is not invoked directly by users.
Code Reference
Source Location
- Repository: kserve
- File: pkg/controller/v1beta1/inferenceservice/reconcilers/ingress/ingress_reconciler.go, Lines 77-724
Signature
// IngressReconciler reconciles ingress resources for InferenceService
type IngressReconciler struct {
client client.Client
scheme *runtime.Scheme
ingressConfig *v1beta1.IngressConfig
}
// Reconcile creates or updates ingress resources
func (r *IngressReconciler) Reconcile(ctx context.Context,
isvc *v1beta1.InferenceService) (ctrl.Result, error)
// getServiceHost derives host from component URL
func getServiceHost(isvc *v1beta1.InferenceService) string
// getServiceUrl builds full URL using domain template
func getServiceUrl(isvc *v1beta1.InferenceService,
config *v1beta1.IngressConfig) string
Import
import "github.com/kserve/kserve/pkg/controller/v1beta1/inferenceservice/reconcilers/ingress"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| isvc | *v1beta1.InferenceService | Yes | InferenceService with reconciled components |
| ingressConfig | *IngressConfig | Yes | Ingress configuration from ConfigMap (domain template, ingress class) |
Outputs
| Name | Type | Description |
|---|---|---|
| status.url | *apis.URL | External URL: http://<name>-<namespace>.<ingressDomain> |
| status.address | *duckv1.Addressable | Internal: http://<name>.<namespace>.svc.cluster.local |
| VirtualService | networking.istio.io/v1beta1 | Istio routing resource (if Istio mode) |
| HTTPRoute | gateway.networking.k8s.io/v1 | Gateway API routing resource (if Gateway mode) |
Usage Examples
Domain Template Configuration
# In config/configmap/inferenceservice.yaml
ingress: |-
ingressDomain: example.com
domainTemplate: "{{ .Name }}-{{ .Namespace }}.{{ .IngressDomain }}"
ingressClassName: istio
Resulting URL
# For InferenceService "flower-sample" in namespace "default"
# External URL: http://flower-sample-default.example.com
# Internal URL: http://flower-sample.default.svc.cluster.local
kubectl get inferenceservice flower-sample -o jsonpath='{.status.url}'
# Output: http://flower-sample-default.example.com