Skip to content

Conversation

@gyfora
Copy link
Contributor

@gyfora gyfora commented Nov 9, 2022

What is the purpose of the change

Support enabling and configuring leader election for the kubernetes operator to make it possible to run standby operator instances.

Brief change log

  • Add configs to enable and configure the leader election service
  • Add tests
  • Update helm chart

Verifying this change

  1. Extended the FlinkOperatorTest to cover the leader election config.
  2. Manually tested on minikube

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): yes
  • The public API, i.e., is any changes to the CustomResourceDescriptors: no
  • Core observer or reconciler logic that is regularly executed: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? docs

@gyfora gyfora requested a review from tweise November 9, 2022 14:45
@gyfora
Copy link
Contributor Author

gyfora commented Nov 9, 2022

cc @morhidi

Copy link
Contributor

@gaborgsomogyi gaborgsomogyi left a comment

Choose a reason for hiding this comment

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

Basically looks good, only questions/nits.

int exceptionFieldLengthThreshold;
int exceptionThrowableCountThreshold;
String labelSelector;
LeaderElectionConfiguration leaderElectionConfiguration;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: any reason why these are not private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lombok @value makes them private

try {
new FlinkOperator(operatorConfig);
} catch (IllegalConfigurationException ice) {
assertTrue(ice.getMessage().startsWith("Lease name must be defined"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe we can mention either the feature (leader election) or config name. Such case one don't need to dig for conf name just copy-paste.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, now see that the feature later mentioned. Maybe adding the key would provide more convenience.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I will add this

@morhidi
Copy link
Contributor

morhidi commented Nov 10, 2022

+1 LGTM overall. Some e2e would be nice. Is this going to be the recommended prod setup or we're not sure yet?

@gyfora
Copy link
Contributor Author

gyfora commented Nov 10, 2022

+1 LGTM overall. Some e2e would be nice. Is this going to be the recommended prod setup or we're not sure yet?

I think the recommended setup is without leader election as it's a very optional feature. I think most prod settings do not require this and it only adds complication

@gyfora gyfora merged commit 8c0de99 into apache:main Nov 10, 2022
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.

3 participants