Skip to content

Commit 0fbcbc7

Browse files
authored
docs: Describe how reconcile status is computed for Config Connector resources (#2739)
1 parent 9d2d9ce commit 0fbcbc7

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

scripts/generate_site_sidebar/sidebar_template.md.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- [FunctionResultList](reference/schema/function-result-list/)
3131
- [ResourceList](reference/schema/resource-list/)
3232
- [CRD Status Convention](reference/schema/crd-status-convention/)
33+
- [Config Connector Status Convention](reference/schema/config-connector-status-convention/)
3334
- [Functions Catalog](https://catalog.kpt.dev/ ":target=_self")
3435
- [Curated](https://catalog.kpt.dev/ ":target=_self")
3536
- [Contrib](https://catalog.kpt.dev/contrib/ ":target=_self")

site/book/06-deploying-packages/00.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@ number of pods have been created and become available.
5656
For core kubernetes types, reconcile status is computed using hardcoded rules.
5757
For CRDs, the status computation is based on recommended [convention for status
5858
fields] that needs to be followed by custom resource publishers. If CRDs follow
59-
these conventions, `live apply` will be able to correctly compute status.
59+
these conventions, `live apply` will be able to correctly compute status. `kpt` also
60+
has special rules for computing status for [Config Connector resources].
6061

61-
Once you know the reconcile status of a single resource, then you really want to
62-
answer the following question:
63-
64-
- Did all the resources in the local package reconcile successfully?
65-
66-
This is referred to as _aggregated status_.
62+
Usually multiple resources are being applied together, and we want to know
63+
when all of those resources have been successfully reconciled. `live apply` computes
64+
the aggregate status and will wait until either they are all reconciled, the timeout
65+
expires, or all the remaining unreconciled resources have reached a state where they
66+
are unlikely to successfully reconcile. An example of the latter for `Deployment`
67+
resources is when the progress deadline is exceeded.
6768

6869
## Dependency ordering
6970

@@ -76,3 +77,4 @@ any resources that depend on it are applied.
7677

7778

7879
[convention for status fields]: /reference/schema/crd-status-convention/
80+
[Config Connector resources]: /reference/schema/config-connector-status-convention/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Config Connector Status Convention
2+
3+
`kpt` includes custom rules for [Config Connector] resources to make them easier to work
4+
with. This document describes how kpt uses fields and conditions on Config Connector
5+
resources to compute [reconcile status].
6+
7+
Config Connector resources expose the `observedGeneration` field in the status
8+
object, and `kpt` will always report a resource as being `InProgress` if the
9+
`observedGeneration` doesn't match the value of `metadata.generation`.
10+
11+
If the `Ready` condition is `True`, a Config Connector resource will be reported
12+
as `Current`, i.e it has been successfully reconciled.
13+
14+
If the `Ready` condition is `False`, `kpt` will look at the `Reason` field on the
15+
condition object to determine whether the resource is making progress towards
16+
reconciliation. The possible values mirrors those used by [Config Connector events].
17+
If the value is one of the following, the resource is considered to have failed
18+
reconciliation:
19+
- `ManagementConflict`
20+
- `UpdateFailed`
21+
- `DeleteFailed`
22+
- `DependencyInvalid`
23+
24+
Note that this doesn't necessarily mean it could never successfully reconcile.
25+
The Config Connector controller will keep retrying. But it does mean that the
26+
resource is in a state where an external change is most likely needed to resolve
27+
the issue. Typical examples would be missing permissions or an API that has not
28+
been enabled.
29+
30+
Similar to all other resources, a Config Connector resource will be in the `Terminating`
31+
state if the `metadata.deletionTimestamp` is set, and considered fully deleted when
32+
the resource no longer exists in the cluster.
33+
34+
[reconcile status]: /book/06-deploying-packages/?id=reconcile-status
35+
[Config Connector]: https://cloud.google.com/config-connector/docs/overview
36+
[Config Connector events]: https://cloud.google.com/config-connector/docs/how-to/monitoring-your-resources

site/sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
- [FunctionResultList](reference/schema/function-result-list/)
6464
- [ResourceList](reference/schema/resource-list/)
6565
- [CRD Status Convention](reference/schema/crd-status-convention/)
66+
- [Config Connector Status Convention](reference/schema/config-connector-status-convention/)
6667
- [Functions Catalog](https://catalog.kpt.dev/ ":target=_self")
6768
- [Curated](https://catalog.kpt.dev/ ":target=_self")
6869
- [Contrib](https://catalog.kpt.dev/contrib/ ":target=_self")

0 commit comments

Comments
 (0)