You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using `float` or `double` types in CEL expressions (particularly in `readyWhen` or `includeWhen` conditions), be aware of floating point precision issues that could cause unexpected behavior. Avoid comparing floating point values for equality in conditional logic. Prefer using `string`, `integer`, or `boolean` types whenever possible to avoid precision-related oscillations in resource state.
273
+
:::
274
+
271
275
## Status Fields
272
276
273
277
Status fields use CEL expressions to reference values from resources. kro
274
278
automatically:
275
279
276
280
- Infers the correct types from the expressions
277
-
- Validates that referenced resources exist
281
+
- Validates that referenced resources exist at ResourceGraphDefinition creation time
278
282
- Updates values when the underlying resources change
283
+
- Validates type compatibility using CEL's native type system
- `Ready`: Top-level condition indicating the instance is fully operational
357
+
- `InstanceManaged`: Instance finalizers and labels are properly set
358
+
- `GraphResolved`: Runtime graph has been created and resources resolved
359
+
- `ResourcesReady`: All resources in the graph are created and ready
306
360
307
-
- `Ready`: Instance is fully reconciled
308
-
- `Progressing`: Working towards desired state
309
-
- `Degraded`: Operational but not optimal
310
-
- `Error`: Reconciliation error occurred
361
+
The `Ready` condition aggregates the state of all sub-conditions and only becomes `True` when all sub-conditions are `True`. Each condition includes an `observedGeneration` field that tracks which generation of the instance the condition reflects.
@@ -52,6 +52,24 @@ state, providing features like:
52
52
- Consistent state management
53
53
- Status tracking
54
54
55
+
### Reactive Reconciliation
56
+
57
+
kro automatically watches all resources managed by an instance and triggers
58
+
reconciliation when any of them change. This means:
59
+
60
+
- **Child Resource Changes**: When a managed resource (like a Deployment or Service) is
61
+
modified, kro detects the change and reconciles the instance to ensure it matches
62
+
the desired state defined in your ResourceGraphDefinition.
63
+
64
+
- **Drift Detection**: If a resource is manually modified or deleted, kro will detect
65
+
the drift and automatically restore it to the desired state.
66
+
67
+
- **Dependency Updates**: Changes to resources propagate through the dependency graph,
68
+
ensuring all dependent resources are updated accordingly.
69
+
70
+
This reactive behavior ensures your instances maintain consistency without requiring
71
+
manual intervention or periodic full reconciliations.
72
+
55
73
## Monitoring Your Instances
56
74
57
75
KRO provides rich status information for every instance:
@@ -69,11 +87,30 @@ status:
69
87
state: ACTIVE # High-level instance state
70
88
availableReplicas: 3# Status from Deployment
71
89
conditions: # Detailed status conditions
72
-
- type: Ready
90
+
- lastTransitionTime: "2025-08-08T00:03:46Z"
91
+
message: instance is properly managed with finalizers and labels
92
+
observedGeneration: 1
93
+
reason: Managed
73
94
status: "True"
74
-
lastTransitionTime: "2024-07-23T01:01:59Z"
75
-
reason: ResourcesAvailable
76
-
message: "All resources are available and configured correctly"
95
+
type: InstanceManaged
96
+
- lastTransitionTime: "2025-08-08T00:03:46Z"
97
+
message: runtime graph created and all resources resolved
98
+
observedGeneration: 1
99
+
reason: Resolved
100
+
status: "True"
101
+
type: GraphResolved
102
+
- lastTransitionTime: "2025-08-08T00:03:46Z"
103
+
message: all resources are created and ready
104
+
observedGeneration: 1
105
+
reason: AllResourcesReady
106
+
status: "True"
107
+
type: ResourcesReady
108
+
- lastTransitionTime: "2025-08-08T00:03:46Z"
109
+
message: ""
110
+
observedGeneration: 1
111
+
reason: Ready
112
+
status: "True"
113
+
type: Ready
77
114
```
78
115
79
116
### Understanding Status
@@ -88,17 +125,64 @@ Every instance includes:
88
125
- `DELETING`: Indicates that the instance is in the process of being deleted.
89
126
- `ERROR`: Indicates that an error occurred during instance processing.
90
127
91
-
2. **Conditions**: Detailed status information
128
+
2. **Conditions**: Detailed status information structured hierarchically
129
+
130
+
kro provides a top-level `Ready` condition that reflects the overall instance health. This condition is supported by three sub-conditions that track different phases of the reconciliation process:
131
+
132
+
- `InstanceManaged`: Instance finalizers and labels are properly set
133
+
- Ensures the instance is under kro's management
134
+
- Tracks whether cleanup handlers (finalizers) are configured
135
+
- Confirms instance is labeled with ownership and version information
136
+
137
+
- `GraphResolved`: Runtime graph has been created and resources resolved
138
+
- Validates that the resource graph has been successfully parsed
139
+
- Confirms all resource templates have been resolved
140
+
- Ensures dependencies between resources are properly understood
92
141
93
-
- `Ready`: Instance is fully operational
94
-
- `Progressing`: Changes are being applied
95
-
- `Degraded`: Operating but not optimal
96
-
- `Error`: Problems detected
142
+
- `ResourcesReady`: All resources in the graph are created and ready
143
+
- Tracks the creation and readiness of all managed resources
144
+
- Monitors the health of resources in topological order
145
+
- Reports when all resources have reached their ready state
146
+
147
+
- `Ready`: Instance is fully operational (top-level condition)
148
+
- Aggregates the state of all sub-conditions
149
+
- Only becomes True when all sub-conditions are True
150
+
- The primary condition to monitor for instance health
151
+
152
+
Each condition includes:
153
+
- `observedGeneration`: Tracks which generation of the instance this condition reflects
154
+
- `lastTransitionTime`: When the condition last changed state
155
+
- `reason`: A programmatic identifier for the condition state
156
+
- `message`: A human-readable description of the current state
97
157
98
158
3. **Resource Status**: Status from your resources
99
159
- Values you defined in your ResourceGraphDefinition's status section
100
160
- Automatically updated as resources change
101
161
162
+
## Debugging Instance Issues
163
+
164
+
When an instance is not in the expected state, the condition hierarchy helps you quickly identify where the problem occurred:
165
+
166
+
1. **Check the Ready condition first**
167
+
```bash
168
+
kubectl get <your-kind> <instance-name> -o jsonpath='{.status.conditions[?(@.type=="Ready")]}'
169
+
```
170
+
171
+
2. **If Ready is False, check the sub-conditions** to identify which phase failed:
172
+
173
+
- If `InstanceManaged` is False: Check if there are issues with finalizers or instance labels
174
+
- If `GraphResolved` is False: The resource graph could not be created - check the ResourceGraphDefinition for syntax errors or invalid CEL expressions
175
+
- If `ResourcesReady` is False: One or more managed resources failed to become ready - check the error message for which resource failed
176
+
177
+
3. **Use kubectl describe** to see all conditions and recent events:
178
+
```bash
179
+
kubectl describe <your-kind> <instance-name>
180
+
```
181
+
182
+
4. **Check the observedGeneration** field in conditions:
183
+
- If `observedGeneration` is less than `metadata.generation`, the controller hasn't processed the latest changes yet
184
+
- If they match, the conditions reflect the current state of your instance
185
+
102
186
## Best Practices
103
187
104
188
- **Version Control**: Keep your instance definitions in version control
@@ -111,7 +195,17 @@ Every instance includes:
111
195
112
196
- **Active Monitoring**: Regularly check instance status beyond just "Running".
113
197
Watch conditions, resource status, and events to catch potential issues early
114
-
and understand your application's health.
198
+
and understand your application's health. Focus on the `Ready` condition and
199
+
its sub-conditions to understand the reconciliation state.
200
+
201
+
- **Monitor observedGeneration**: When making changes to an instance, verify that
202
+
`observedGeneration`in the conditions matches `metadata.generation` to ensure
203
+
kro has processed your changes.
204
+
205
+
- **Leverage Reactive Reconciliation**: kro automatically detects and corrects drift
206
+
in managed resources. If you need to make manual changes to resources, update the
207
+
instance specification instead to ensure changes persist and align with your
208
+
desired state.
115
209
116
210
- **Regular Reviews**: Periodically review your instance configurations to
117
211
ensure they reflect current requirements and best practices. Update resource
0 commit comments