-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate the 'Synced' status condition #198
Comments
crossplane/crossplane-runtime#198 See the above issue for context. Signed-off-by: Nic Cope <[email protected]>
crossplane/crossplane-runtime#198 See the above issue for context. Signed-off-by: Nic Cope <[email protected]>
I believe conditions are most useful in machine to machine communication, which is not really what events/logs are for. However, |
Hmm, actually UI systems are usually built using YAML output of the resources, which do not have the events. So that's a machine usage of the conditions:
- lastProbeTime: null
lastTransitionTime: "2020-09-03T15:12:15Z"
status: "True"
type: Initialized
- lastProbeTime: null
lastTransitionTime: "2020-09-10T07:54:42Z"
status: "True"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2020-09-10T07:54:42Z"
status: "True"
type: ContainersReady
- lastProbeTime: null
lastTransitionTime: "2020-09-03T15:12:15Z"
status: "True"
type: PodScheduled From what I can tell, there is an abundance of conditions which also have corresponding events published. So, it comes down to whether we'd like the YAML, i.e. etcd record of the resource, to fully represent everything we know about it at the time of printing or not. I generally lean towards abundance of information as long as it's easy to keep it all in sync. Maybe merge errors that we report under |
This sounds like how Crossplane originally used conditions, which we found to be overloaded and confusing. A controller encountering an error during reconciliation doesn't necessarily mean that the external resource is not ready; they're two different things.
I believe machine to machine communication is in scope for events. They're actually a resource like any other, e.g.: # $ kubectl get event -o yaml compositepostgresqlinstances.database.example.org.16338ed5a523dfe0
apiVersion: v1
count: 2487
eventTime: null
firstTimestamp: "2020-09-10T23:09:00Z"
involvedObject:
apiVersion: apiextensions.crossplane.io/v1alpha1
kind: CompositeResourceDefinition
name: compositepostgresqlinstances.database.example.org
resourceVersion: "3241413"
uid: e29f6357-fe42-4a4b-9f9b-781e0efc1d96
kind: Event
lastTimestamp: "2020-09-11T01:14:02Z"
message: Rendered composite resource claim CustomResourceDefinition
metadata:
creationTimestamp: "2020-09-10T23:09:00Z"
name: compositepostgresqlinstances.database.example.org.16338ed5a523dfe0
namespace: default
resourceVersion: "3371564"
selfLink: /api/v1/namespaces/default/events/compositepostgresqlinstances.database.example.org.16338ed5a523dfe0
uid: 2f76e628-d381-41a3-a0e8-9132504fd16b
reason: RenderCRD
reportingComponent: ""
reportingInstance: ""
source:
component: offered/compositeresourcedefinition.apiextensions.crossplane.io
type: Normal The events API supports filtering using field selectors on the |
From @hasheddan on crossplane/crossplane#1721:
I think it's appropriate to remove Synced everywhere; even for external resources. I think they're still redundant as long as we emit an event whenever we would have set the Synced condition. |
* Bump crossplane-runtime dependency This should switch us to CamelCase status condition reasons. Signed-off-by: Nic Cope <[email protected]> * Remove 'Synced' status condition from XRD controllers crossplane/crossplane-runtime#198 See the above issue for context. Signed-off-by: Nic Cope <[email protected]> * Remove 'Synced' Condition from XR and XRC controllers crossplane/crossplane-runtime#198 See the above issue for context. Signed-off-by: Nic Cope <[email protected]> * Use briefer, more user-focused event reasons in XRD controllers These hopefully mean a little more than 'apply XRD' and 'delete XRD', which was used by both the claim and the composite XRD controllers. Signed-off-by: Nic Cope <[email protected]> * Reintroduce conditions to indicate that XRDs are being deleted Signed-off-by: Nic Cope <[email protected]>
I'm curious where this stands. I was spelunking relevant Crossplane issues and found this issue (198) and a 2019 comment crossplane/crossplane#495 (comment) where Synced was first proposed and defended.
Does the 2019 comment in support of Synced offer any other guidance (if only for reasons in support of removal)? |
@displague I'd still like to deprecate it but I haven't yet had time to find out whether folks are onboard - I could imagine it might be a bit controversial. In my mind |
I think those conditions are quite useful. Especially in combination with If setting these conditions does not cause any issues I would prefer to keep them. In addition to that I would propose to add the synced condition/column to XRCs and XRs as well: crossplane/crossplane#2850 |
https://kpt.dev/reference/schema/crd-status-convention/ More prior art - looks like the kpt folks recommend something similar. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
My .02 - I like having |
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
What problem are you facing?
Most Crossplane resources (managed, claims, composites, etc) typically expose two types of status condition:
Ready
indicates whether the thing being reconciled (e.g. the external resource) is expected to be functional.Synced
indicates whether the most recent reconcile attempt succeeded or failed, including any error.Sometimes
Ready
goes by different names - e.g.Established
for XRDs.Originally Crossplane only had a
Ready
condition, but it was conceptually conflated with "synced" and attempted to reflect both whether the underlying resource was ready and whether Crossplane was successfully able to reconcile the underlying resource. TheSynced
condition has served us well for some time, but I think it should be removed because:SetConditions
calls.The apiextensions 'definition' and 'offered' controllers are examples of the latter issue. Both controllers collaborate to reconcile a
CompositeResourceDefinition
. Thedefinition
controller manages the lifecycle of the defined composite resource and its controller, while theoffered
controller manages the lifecycle of the offered resource claim (if any) and its controller. Currently both reconcilers attempt to set theSynced
condition of the XRD; if one controller was reconciling successfully and the other was encountering an error they would get stuck in a tight reconcile loop.How could Crossplane help solve your problem?
I suggest we deprecate and stop using the
Synced
condition in any reconciler that has been updated to emit events and logs.The text was updated successfully, but these errors were encountered: