-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Support Leader Election for argocd-application-controller #3073
Comments
Some considerations about this request:
|
+1 |
1 similar comment
+1 |
I think we should be fine with that by now :) |
+1 |
Hi. I believe this would be nice. There's a significant issue currently in maintaining a HA application set controller |
I see that the 3.0.0 advertises LEADER_ELECTION_IDENTITY environment variable. I'll look into this and see if this is a solution. If this is the case, perhaps we can close this |
@d-kuro the applicationset controller does support leader election. Are we able to close this issue? |
@rumstead Thanks! |
Summary
argocd-application-controller supports leader election.
Motivation
Running multiple Kubernetes Controllers causes a conflict.
Supporting leader election allows multiple controllers to work at the same time, which indicates that the controller will be highly available.
You can also use a rolling update for the controller's deployment strategy.
Actually controller-manager, scheduler, cluster-autoscaler, etc. support leader election.
https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/
https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-the-parameters-to-ca
Proposal
Add the following to the options of arogcd-applicaton-controller.
leader-elect
leader-elect-lease-duration
leader-elect-renew-deadline
leader-elect-retry-period
leader-elect-resource-lock
All seconds are default values.
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/tools/leaderelection/leaderelection.go#L111
Also, change the number of replicas for the argocd-application-controller in the install manifest of HA configuration to 2.
and change the Deployment strategy to a rolling update.
See below for a code sample of leader election.
https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/client-go/examples/leader-election
I can create a Pull Request for this enhancement issue.
The text was updated successfully, but these errors were encountered: