operator-framework / operator-sdk

SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.
https://sdk.operatorframework.io
Apache License 2.0
7.1k stars 1.73k forks source link

Update golang Operator docs for "Advanced Topics - Leader Election - Leader-with-lease" #6700

Open saylerb opened 4 months ago

saylerb commented 4 months ago

The docs for building golang operators have a section describing how to configure leader election. Under the default leader-with-lease option, the docs mention:

When the operator is not running in a cluster, the Manager will return an error on starting since it can’t detect the operator’s namespace in order to create the configmap for leader election

But rather than using ConfigMap as a lock, the current version of the SDK seems to be using Kubernetes leases. I can update the docs to mentioned that, if I'm understanding things correctly.

I looked through the other issues related to Leader Election briefly, and it seemed like they were all about changing behavior or updating the Docs for Leader-for-life.