Controller Reconciliation Logic
This document describes the reconciliation patterns used by our controllers to synchronize Kubernetes Custom Resources (CRDs) with the Console API.
Reconciliation Modes
Controllers operate in one of three primary modes depending on the initial state of the resource and the configuration provided.
1. Creation Mode (Standard)
This is the standard lifecycle for a resource managed entirely by the controller.
- Trigger: A new CRD is created, and no matching resource exists in the Console API.
- Action: The controller creates the resource in the Console API using the attributes defined in the CRD
Spec. - Result: The
Status.IDis populated with the new Console ID. The controller manages updates to the resource and ensures it is deleted from the Console API when the CRD is removed (via finalizers).
2. Read-Only Mode
This mode is used when a resource already exists in the Console API, and the operator is configured to observe rather than manage it.
- Trigger: A matching resource is found in the Console API, but the controller determines it should not take ownership (e.g.,
driftDetectionis disabled). - Action: The controller reads the existing ID from the Console API and populates
Status.ID. - Result: The resource state in the Console API is not modified by the controller, even if the CRD
Specdiffers. Deleting the CRD will not delete the resource from the Console API.