-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert fleet-agent to controller-runtime #1734
Comments
After chatting about this, and how we are using leader election, I was wondering if it is really necessary. I believe we can use an alternative approach based on optimistic locking, hence eliminating the restriction of having one single active instance:
This is actually not tied to the use of |
I mentioned this doc about wrangler handlers: https://github.com/rancher/rancher/wiki/Tips-for-Writing-Rancher-Handlers#why-was-my-object-enqueued |
We discussed wrangler vs controller-runtime multiple times. How feasible is it to switch frameworks?
Fleet-agent is relatively limited. When migrating to controller-runtime:
time.After
,EnqueueAfter
apply
, e.g. cleanup, updatesIf it's not possible to move the "monitor" part of the agent, because of timers and
internal/cmd/agent/trigger/watcher.go
, does it help to split the agent, so we can at least port the deployer?The fleet-agent controller was split into three processes:
Only the last part is an actual controller. Cluster status updates work on a timer and registration is done when the agent starts up. A new function
registration.Get
was added, to just return an existing registration to the other processes.The agent to a statefulset, to avoid leader election. The code of the handlers was spread between the "handler", the deploy "manager" and the helm deployer. It has been consolidated into the
deployer
package."Trigger" was renamed to
driftdetect
as it uses the helm history to detect drift for deployments. Which is similar to themonitor
, which updates the bundle deployments status.After splitting the agent, the fleet-agent controller was converted to controller-runtime:
The text was updated successfully, but these errors were encountered: