argo-workflows
argo-workflows copied to clipboard
LEADER_ELECTION_IDENTITY is set to the name of the pod, not the real leader
Checklist
- [ ] Double-checked my configuration.
- [ *] Tested using the latest version.
- [ ] Used the Emissary executor.
Summary
What happened/what you expected to happen?
I expected the environment variable LEADER_ELECTION_IDENTITY to contain the identity of the leader. But it had the identity of the pod name only because the yaml has the following:-
- name: LEADER_ELECTION_IDENTITY valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name
What version are you running? 3.3.6
Diagnostics
Paste the smallest workflow that reproduces the bug. We must be able to run the workflow.
kubectl exec -it -n argo-workflows -c controller argo-workflows-workflow-controller-86cb4c7554-hm9vb sh
LEADER_ELECTION_IDENTITY=argo-workflows-workflow-controller-86cb4c7554-hm9vb
I think we should fix the environment variable to contain the correct leader identity and probably add a label/annotation that also shows the leader. We can then use the downward api to project the annotation /label to the environment variable as well
@krmayankk identity needs to be unique for every requester. POD name will be unique on the controller deployment to request the lease. But if you want a label you can do it with https://stackoverflow.com/questions/68517266/use-deployment-label-in-containers-env.
I don't understand this issue. What is the actual bug?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.
This issue has been closed due to inactivity. Feel free to re-open if you still encounter this issue.