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

Add helm setting for leader election #3051

Merged
merged 4 commits into from Apr 5, 2023

Conversation

chiayi
Copy link
Collaborator

@chiayi chiayi commented Mar 29, 2023

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation

/kind feature

/kind hotfix

What this PR does / Why we need it:
This PR adds helm config for controller leader election

Which issue(s) this PR fixes:
Work on #2797

Special notes for your reviewer:

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: aca33ce0-c17a-4671-a2d4-5f5585500dc0

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

Derives the replica number for agones-controller based on current helm and feature flag settings.
*/}}
{{- define "agones.controller.replica" -}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I forgot this was landing all in controller.yaml, any reason we can't just inline the logic rather than adding the helper? I think if you inline it at e.g. line 16 in controller.yaml, you don't even need a define, it just becomes a matter of setting $controllerReplicas.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved it to inline, please take a look.

@@ -13,6 +13,7 @@
# limitations under the License.

{{- $featureGates := include "agones.featureGates" . | fromYaml }}
{{- $controllerReplica := include "agones.controller.replica" . }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I would call this controllerReplicas (plural), or just replicas. You're in controller.yaml, the controller prefix is kind of redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, changed to just replicas

install/helm/agones/templates/controller.yaml Outdated Show resolved Hide resolved
install/helm/agones/templates/_helpers.tpl Outdated Show resolved Hide resolved
install/helm/agones/values.yaml Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 30d8ce46-ff70-492d-927f-28500727646d

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

Copy link
Collaborator

@zmerlynn zmerlynn left a comment

Choose a reason for hiding this comment

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

Really close!

install/helm/agones/templates/_helpers.tpl Outdated Show resolved Hide resolved
@@ -13,6 +13,10 @@
# limitations under the License.

{{- $featureGates := include "agones.featureGates" . | fromYaml }}
{{- $replicas := .Values.agones.controller.replicas }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we talked offline about just passing this through, but since you rely on this being an int (which I wasn't thinking about during standup), you probably need to cast it here - and maybe validate it's > 0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we have to ensure that replicas is an int here? It would fail the gt checks if it isn't an int.
But I guess that would mean relying on the helm check to give an typing error instead of us stating the error earlier. This also applies to validating if replicas is greater than 0, it will also give an typing error when comparing with a 0.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like the build break you just had was because it wasn't cast to an int already - that's why I was suggesting it here (it probably comes in as string?) Maybe I'm wrong. Whichever way works - happy if helm validates it and we can skip code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I see I see. You are correct, there is a need to cast to int. This also means that we would need to check if values is 0 once it's casted. What is the behavior we want when the value is set to 0? Do we want it to default to 1?

site/content/en/docs/Installation/Install Agones/helm.md Outdated Show resolved Hide resolved
site/content/en/docs/Installation/Install Agones/helm.md Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: de679343-bf8f-4bf5-8930-e74f304c30fe

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@chiayi chiayi force-pushed the agoneshabranch branch 2 times, most recently from 2b07577 to b0a5e7d Compare March 29, 2023 23:50
Copy link
Collaborator

@zmerlynn zmerlynn left a comment

Choose a reason for hiding this comment

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

LGTM. Fix some nits, take off the WIP and I'll get it merged.

install/helm/agones/templates/controller.yaml Outdated Show resolved Hide resolved
install/helm/agones/templates/controller.yaml Outdated Show resolved Hide resolved
install/helm/agones/templates/controller.yaml Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: a82c6dc9-21ed-4e47-9af3-cdb38f9c4956

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 98393d84-ebed-4e59-be6e-54c75d552448

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@zmerlynn
Copy link
Collaborator

Your code LGTM, now just get it past the @agones-bot guantlet.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 01e92e44-3ca1-4f84-9c59-a35173b13ad2

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 531063f6-822d-41d7-8883-a21c9a5a9576

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: cf376173-59b9-4d00-a477-7a4e71158fd0

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@chiayi
Copy link
Collaborator Author

chiayi commented Mar 30, 2023

Build failed due to a different error than prev build:

Step #24 - "submit-e2e-test-cloud-build": generic-1.25: Step #1 - "e2e-feature-gates": FAIL	agones.dev/agones/test/e2e	1800.722s

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 9684ff40-2fed-4068-a28f-7bbbcb920136

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@chiayi
Copy link
Collaborator Author

chiayi commented Apr 3, 2023

Removed --debug from install

@google-oss-prow google-oss-prow bot added the lgtm label Apr 3, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chiayi, zmerlynn
Once this PR has been reviewed and has the lgtm label, please assign cyriltovena for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@zmerlynn zmerlynn enabled auto-merge (squash) April 3, 2023 20:28
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 778e84ad-d139-4e49-8290-271d56aee164

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

auto-merge was automatically disabled April 4, 2023 00:36

Head branch was pushed to by a user without write access

@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot removed the lgtm label Apr 4, 2023
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 6126f0bc-347c-41b3-adbf-9136006a4c56

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 4a14afa0-98aa-4588-9d3e-d077b5929dc8

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 0292aa4b-1c27-45c6-a056-726772cea240

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: eb3493d2-5274-4654-bbf1-8b3ab53e550e

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0d17de03-dac8-4156-a3bb-0890a0339f5e

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3051/head:pr_3051 && git checkout pr_3051
  • helm install agones ./install/helm/agones --namespace agones-system --agones.image.release=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.31.0-fd5c754-amd64

@zmerlynn zmerlynn enabled auto-merge (squash) April 5, 2023 15:34
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: aeadbc83-eced-40cf-bb03-ec454a39a3d6

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3051/head:pr_3051 && git checkout pr_3051
  • helm install agones ./install/helm/agones --namespace agones-system --agones.image.release=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.31.0-5fcc70b-amd64

@zmerlynn zmerlynn merged commit 9eb58c1 into googleforgames:main Apr 5, 2023
2 checks passed
@Kalaiselvi84 Kalaiselvi84 added the kind/feature New features for Agones label Apr 10, 2023
@Kalaiselvi84 Kalaiselvi84 added this to the 1.31.0 milestone Apr 10, 2023
Kalaiselvi84 pushed a commit to Kalaiselvi84/agones that referenced this pull request Apr 11, 2023
* Adds `replicas` and `pdb` settings to `agones.controller` - both are only relevant when `SplitControllerAndExtensions` is enabled.
* Derives `--leader-election` and PDB presence from the `replicas` setting: Leader election can be disabled by setting `replicas: 1`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants