argo-workflows icon indicating copy to clipboard operation
argo-workflows copied to clipboard

LEADER_ELECTION_IDENTITY is set to the name of the pod, not the real leader

Open krmayankk opened this issue 1 year ago • 2 comments

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 avatar Sep 02 '22 05:09 krmayankk

@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.

sarabala1979 avatar Sep 02 '22 16:09 sarabala1979

I don't understand this issue. What is the actual bug?

alexec avatar Sep 05 '22 20:09 alexec

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.

stale[bot] avatar Oct 01 '22 06:10 stale[bot]

This issue has been closed due to inactivity. Feel free to re-open if you still encounter this issue.

stale[bot] avatar Oct 16 '22 00:10 stale[bot]