Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replicas using values.yaml + enable leader election #501

Merged
merged 4 commits into from
Mar 22, 2025

Conversation

rajatvig
Copy link
Contributor

@rajatvig rajatvig commented Mar 16, 2025

Commit Message

Set deployment replicas based off the values.yaml and enable leader election for the controller.

Signed-off-by: Rajat Vig [email protected]

@rajatvig rajatvig requested a review from a team as a code owner March 16, 2025 20:19
@rajatvig rajatvig changed the title Set deployments using values on the deployment and enable leader election chore: set deployments using values on the deployment and enable leader election Mar 16, 2025
@rajatvig rajatvig changed the title chore: set deployments using values on the deployment and enable leader election chore: set replicas using values.yaml and enable leader election Mar 16, 2025
@rajatvig rajatvig changed the title chore: set replicas using values.yaml and enable leader election chore: replicas using values.yaml + enable leader election Mar 16, 2025
@@ -42,6 +43,7 @@ spec:
- -logLevel={{ .Values.controller.logLevel }}
- --extProcImage={{ .Values.extProc.repository }}:{{ .Values.extProc.tag | default .Chart.AppVersion }}
- --extProcLogLevel={{ .Values.extProc.logLevel }}
- --enableLeaderElection=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make it configurable ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is possible though with > 1 replica, having leader election is required. Do you think it would be better to have that as a conditional here, i.e., always turn it on if there is > 1 replica but not add it if there is only 1?

Copy link
Member

Choose a reason for hiding this comment

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

I think it won't hurt to enable this by default ?

Copy link

Choose a reason for hiding this comment

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

is this for the ai-controller ? then you'd have to do extra work in code, to detect the leader election and based on that, only allow the leader to generate the Gateway API resources

Copy link
Member

@mathetake mathetake Mar 18, 2025

Choose a reason for hiding this comment

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

yeah controller and i believe it's already handled assuming leader election = true (i don't remember precisely;)), and the current default is true:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would I be correct in assuming then that the change is safe to do and this pull request looks fine?

Copy link
Member

Choose a reason for hiding this comment

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

yeah I think so, but deferring to @yuzisun for the final approval

Copy link
Contributor

Choose a reason for hiding this comment

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

@rajatvig You can set the default to true in values.yaml, otherwise there is no way to disable it if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have changed the code per suggestion.

@mathetake mathetake requested a review from yuzisun March 20, 2025 16:29
@mathetake mathetake enabled auto-merge (squash) March 22, 2025 16:04
@mathetake mathetake merged commit 88f0a14 into envoyproxy:main Mar 22, 2025
15 checks passed
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