Replies: 2 comments
-
A similar conflict arises for the question "when has a controller successfully reconciled an object"? If returning |
Beta Was this translation helpful? Give feedback.
-
I think this is an important consideration (how likely are the requeues to succeed). In many cases though it is hard to know, for example k8s API failures could be due to e.g. rare intermittent etcd timeouts, OR could mean the entire cluster is down. Another consideration is how expensive/risky is it to run the extra requeues, taking into account the exponential backoff which helps limit the amount of requeues. In the case of the helm-controller, helm rapid install/upgrade/uninstall/rollback actions can be expensive and/or risky which is why we default to 0 retries, and require the user to opt in to additional ones. We could probably change it such that after retries are exhausted, exponential backoff no longer happens, since it will likely just result in "retries still exhausted" in this case. I assume in all cases we'd want to honor the |
Beta Was this translation helpful? Give feedback.
-
When using controller-runtime, if you return an error from a
Reconcile
method, the error stack trace will be logged, and the request will be requeued with a backoff.source-controller
will return an error fromReconcile
in circumstances like failing to create credentials from a secret (https://github.com/fluxcd/source-controller/blob/master/controllers/helmrepository_controller.go#L199). This is an error, but it's an error on the part of the user, or a temporary situation, rather than an exceptional problem.I think it is worth distinguishing between exceptional problems (e.g., the controller can't reach the API server), and a failure to make progress for the moment (e.g., the authentication secret doesn't have the right fields), for these reasons:
ctrl.Result{Requeue: true}, nil
, which apparently will also do backoff for you)(The controller-runtime/kubebuilder community don't appear to have a settled idea of how this is supposed to work -- see the comments in kubernetes-sigs/controller-runtime#617 for example, especially kubernetes-sigs/controller-runtime#617 (comment))
Beta Was this translation helpful? Give feedback.
All reactions