Skip to content

Conversation

@domq
Copy link
Member

@domq domq commented Dec 9, 2024

Pair-programmed with @Azecko, @ponsfrilus and @obieler.

  • Elect a leader using kubernetes.leaderelection and a ConfigMap (given that we cannot yet use the proper Lease objects)
  • This effectively forces the operator into single-namespace mode, since ConfigMaps (and Leases) are namespaced objects. Ensure that the user stipulated a namespace, either through the KUBERNETES_NAMESPACE environment variable (which has priority) or through one of the --namespace=foo, -namespace foo or -n foo command-line flag combos

obieler and others added 6 commits December 9, 2024 15:22
- `onstarted_leading` ⇒ `sys.exit(kopf.cli.main()`
- `onstopped_leading` ⇒ Exit immediately
This presumably avoids a situation whence Kopf only gets to run every 5 seconds...
…econds

Subclassing is the way, since unfortunately everything the `LeaderElection` superclass logs is at `.info()` level
@ponsfrilus ponsfrilus self-requested a review December 9, 2024 15:34
Copy link
Member

@ponsfrilus ponsfrilus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@domq domq merged commit dcf1eda into main Dec 9, 2024
@domq domq deleted the feature/leaderselector branch December 9, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants