knative / serving

Kubernetes-based, scale-to-zero, request-driven compute
https://knative.dev/docs/serving/
Apache License 2.0
5.46k stars 1.14k forks source link

The Condition of SKS with type name "ActivatorEndpointsPopulated" is not marked accurate, ignoring the scenario of no activator endpoints #15278

Open yenniechen opened 1 month ago

yenniechen commented 1 month ago

In what area(s)?

Remove the '> ' to select

/area autoscale

Other classifications:

/kind good-first-issue

What version of Knative?

main

Expected Behavior

While reconciling SKS, the reconciler will reconcile Public Endpoints and mark Activator Endpoints Populated into Condition at last. If no backends or if we're in the proxy mode, the activator will be considered to backs this revision. But in fact, if no activator mark Activator Endpoints Populated found, the mode will be forced into "Serve", and not be put in path. Would it be better to exclude this scenario when marking “ActivatorEndpointsPopulated” Condition?

Actual Behavior

Marking Activator Endpoints Populated while reconciling SKS, ignoring the scenario of no activator endpoints

Steps to Reproduce the Problem

Mainly because the code logic is not rigorous. Maybe we can reproduce problem by steps as follows:

  1. Scale the activator deployment replicas to Zero, and no activator endpoint
  2. The serving service has endpoints, but not inactive, no traffic.
  3. The Public Service endpoints is the same with private Service endpoints (Serve Mode). But the ServerlessService cr is marked Condition "ActivatorEndpointsPopulated"
yenniechen commented 1 month ago

/assign

dprotaso commented 1 month ago

Curious besides the condition being incorrect do you see any other issues?