Repository navigation
Description
In what area(s)?
/area API
/area autoscale
/area build
/area monitoring
/area networking
/area test-and-release
What version of Knative?
0.2.x
0.3.x
Output of git describe --dirty
0.7
Expected Behavior
From Kubernetes Guidance,
If the primary resource your controller is reconciling supports ObservedGeneration in its status, make sure you correctly set it to metadata.Generation whenever the values between the two fields mismatches.
This lets clients know that the controller has processed a resource. Make sure that your controller is the main controller that is responsible for that resource, otherwise if you need to communicate observation via your own controller, you will need to create a different kind of ObservedGeneration in the Status of the resource.
I expect observedGeneration to always be bumped when a controller picks up a new spec to reconcile regardless of what happens later in the reconcile loop.
Actual Behavior
Many of our controllers wait until the end before bumping observedGeneration or bump it only in certain situations. This can lead to:
- Our status changes, but our observedGeneration does not increment
- Our status doesn't change due to an error processing and our observedGeneration doesn't increment
In the first case the client will believe that we are still reflecting the status of the previous spec which is false. While in the second case the client will sit there waiting (potentially forever) depending on the type of error ( #4561 fixed one particular example of this case )
Given the coupling between client's (including the Service controller) use of observedGeneration and Conditions, this may likely require changes to either how we report reconcile errors (some of them are not reported in sub-conditions) or how we consume observedGeneration.
Steps to Reproduce the Problem
An example of this:
- Put in a bad
domainTemplatein the ConfigMapupdateRouteStatusURLshould fail https://github.com/knative/serving/blob/master/pkg/reconciler/route/route.go#L194- This failure does not update Conditions so the
statuswill not change - This failure occurs before
observedGenerationis updated so even with a new specobservedGenerationwill never change
- Update the Route with a new
spec- As
observedGenerationis not updating it looks like the controller is not running, but really it is spinning attempting to retry
- As
We have similar areas in Configuration reconciler where an err can occur before ObservedGeneration is updated resulting in spinning without update.
Activity
dgerd commentedon Jul 25, 2019
/assign
dgerd commentedon Oct 23, 2019
@dgerd to scope this down further this release. Most likely work will and in 0.11.
[WIP] Bump observedGeneration first
33 remaining items
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources
Add ObservedGeneration to the sub Resources