-
Notifications
You must be signed in to change notification settings - Fork 146
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
Adding config variables to leader_election provider #3625
Conversation
This pull request does not have a backport label. Could you fix it @gizas? 🙏
NOTE: |
🌐 Coverage report
|
Sample manifest used: data:
agent.yml: |-
providers.kubernetes_leaderelection:
enabled: true
leader_lease: agent-k8s-leader-lock3
leader_retryperiod: 15
leader_leaseduration: 20
leader_renewdeadline: 19 Verification: kubectl describe leases -n kube-system agent-k8s-leader-lock3
Name: agent-k8s-leader-lock3
Namespace: kube-system
Labels: <none>
Annotations: <none>
API Version: coordination.k8s.io/v1
Kind: Lease
Metadata:
Creation Timestamp: 2023-10-30T14:42:38Z
Managed Fields:
API Version: coordination.k8s.io/v1
Fields Type: FieldsV1
fieldsV1:
f:spec:
f:acquireTime:
f:holderIdentity:
f:leaseDurationSeconds:
f:leaseTransitions:
f:renewTime:
Manager: elastic-agent
Operation: Update
Time: 2023-10-30T14:42:38Z
Resource Version: 70559
UID: a024c0c4-8d90-4776-81a2-a37b1c768b7a
Spec:
Acquire Time: 2023-10-30T14:42:38.346903Z
Holder Identity: elastic-agent-leader-elastic-agent-7nh9q
Lease Duration Seconds: 20
Lease Transitions: 0
Renew Time: 2023-10-30T14:42:38.372912Z
Events: <none> |
@elastic/elastic-agent-control-plane team can I have a review here please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gizas I think you need to add changelog record for this changes - https://github.com/elastic/elastic-agent#changelog?
Thanks added one Tania (had the impression that we add it only for customer phasing issues, bugs or features. Does not harm to have it :)) |
SonarQube Quality Gate |
* Adding config variables to leader election process * Adding Debug message info * Adding Changelog fragment (cherry picked from commit bb5de53)
* Adding config variables to leader election process * Adding Debug message info * Adding Changelog fragment (cherry picked from commit bb5de53)
* Adding config variables to leader election process * Adding Debug message info * Adding Changelog fragment (cherry picked from commit bb5de53) Co-authored-by: Andrew Gizas <[email protected]>
What does this PR do?
WHAT: Adding config options for the kubernetes provider leader_election
WHY: We need to make the values configurable in order to adjust the number of API calls we need for the Leader Election process
Why is it important?
In big Kubernetes cluster, the number of API calls is proportional to number of agents that take part in the leader election. We have seen that this number of API calls towards kubernetes control API can be significant. With this effort we can offer to our users the ability to increase the period of leader election requests
Checklist
./changelog/fragments
using the changelog toolHow to test this PR locally
Related issues
Screenshot
With retry period every 15 sec
The kube-state-metrics processing every 10 sec works as expected:
Logs