Skip to content

Support VirtualService informer filtering to improve isolation #1503

@anencore94

Description

@anencore94

Summary

When an external VirtualService with an invalid spec exists in the cluster, the net-istio-controller pod crashes with CrashLoopBackOff during informer sync. This happens because the VirtualService informer watches all VirtualServices cluster-wide, and a malformed VS can cause the informer's list/watch operation to fail during validation.

Problem

Root Cause

The VirtualService informer watches all VirtualServices in the cluster without filtering. When an invalid VS exists (e.g., created by another controller like Voyager), the informer fails to sync, causing the controller to crash.

Impact

  • net-istio-controller pod enters CrashLoopBackOff
  • Knative Service's VirtualService reconcile fails
  • InferenceService (KServe) or Knative Services fail to become ready

Example Scenario

  1. External application (e.g., Voyager forum) creates a VirtualService with invalid spec
  2. net-istio-controller starts and attempts to sync VirtualService informer
  3. Informer fails to list/watch due to invalid VS spec
  4. Controller crashes before it can reconcile any Knative-owned VS

Proposed Solution (Not Fixed, Please feedback)

Add an opt-in environment variable ENABLE_VS_INFORMER_FILTERING_BY_LABEL that enables label-based filtering for the VirtualService informer.

When enabled, only VirtualServices with the networking.knative.dev/ingress label will be watched.

Key Points

  • Opt-in approach: Default is false to maintain backward compatibility
  • Follows existing pattern: Similar to ENABLE_SECRET_INFORMER_FILTERING_BY_CERT_UID for Secret filtering
  • Label-based filtering: Uses networking.knative.dev/ingress label which is already present on Ingress-owned VirtualServices

Usage

Enable the feature by setting the environment variable:

env:
  - name: ENABLE_VS_INFORMER_FILTERING_BY_LABEL
    value: "true"

Verification

  1. Set ENABLE_VS_INFORMER_FILTERING_BY_LABEL=true
  2. Create an external VirtualService without the networking.knative.dev/ingress label
  3. Verify net-istio-controller starts without crash
  4. Deploy a Knative Service and verify VirtualService is created correctly
  5. Check controller logs show no errors related to external VirtualService

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions