Skip to content

Commit

Permalink
Update docs/book/src/Good Practices
Browse files Browse the repository at this point in the history
Co-authored-by: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com>
  • Loading branch information
Sajiyah-Salat and camilamacedo86 committed May 7, 2023
1 parent 71e3a71 commit 039dad0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/book/src/Good Practices
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The reconciliation is a continuos loop that performs necessary actions on the current state to ensure that the Custom Resource reaches the desired state as specified by the user.

## Why should reconciliations be idempotent?

When developing operators, the controller’s reconciliation loop needs to be idempotent. By following the [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) we create [controllers](https://kubernetes.io/docs/concepts/architecture/controller/) that provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster. Developing idempotent solutions will allow the reconciler to correctly respond to generic or unexpected events, easily deal with application startup or upgrade. More explanation on this is available [here](https://github.com/kubernetes-sigs/controller-runtime/blob/main/FAQ.md#q-how-do-i-have-different-logic-in-my-reconciler-for-different-types-of-events-eg-create-update-delete).

Writing reconciliation logic according to specific events, breaks the recommendation of operator pattern and goes against the design principles of [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime). This may lead to unforeseen consequences, such as resources becoming stuck and requiring manual intervention.
Expand Down

0 comments on commit 039dad0

Please sign in to comment.