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 clusterIP for agones-allocator in helm chart #3526

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

govargo
Copy link
Contributor

@govargo govargo commented Dec 1, 2023

What type of PR is this?

/kind feature

What this PR does / Why we need it:

I'd like to use agones-allocator with MultiClusterService(MCS) in multiple Kubernetes clusters.

In order to allocate with multiple clusters environment, currently there are some ways.

  1. External Multi Cluster Gateway API, however, Internal Multi Cluster Gateway API(gke-l7-rilb-mc) doesn't support cross region
  2. Standalone Internal Application LoadBalancer (Internal Application loadbalancer support cross region) outside of GKE
  3. Anthos Service Mesh or other L7 layer proxy. e.g. global-multiplayer-demo uses ASM

I'd like to add another solution, 4. MultiClusterService + client-side load balancing.
This diagram is what I'd like to deploy.

image

In Kubernetes env, L7 proxy or client-side loadbalancing is needed for gRPC's load balancing.
MultiClusterService is the L4 layer service, so we need client-side loadbalancing, if we'd like to load balancing agones-allocator's gRPC.

e.g.  client-side loadbalancing by golang

conn, err := grpc.DialContext(ctx, allocatorEndpoint, grpc.WithDefaultServiceConfig(`{"loadBalancingConfig": [{"round_robin":{}}]}`)

To communite by client-side loadbalancing, DNS name resolusion for each agones-allocator pod is needed.
DNS name resolusion for each pod can be done by Headless Service in Kubernetes.
However, current helm chart for agones-allocator doesn't support Headless Service.
So this is why I sent this PR.

Thank you.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: govargo
Once this PR has been reviewed and has the lgtm label, please assign roberthbailey 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

@github-actions github-actions bot added the kind/feature New features for Agones label Dec 1, 2023
@govargo govargo changed the title Add Headless Service for agones-allocator Add Headless Service for agones-allocator in MultiClusterService Dec 1, 2023
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 87e279b9-d9f9-43a7-9281-45d182463b23

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/3526/head:pr_3526 && git checkout pr_3526
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.37.0-dev-0e2ea03-amd64

@@ -72,6 +72,9 @@ spec:
protocol: TCP
{{- end }}
type: {{ .Values.agones.allocator.service.serviceType }}
{{- if and (eq .Values.agones.allocator.service.serviceType "ClusterIP") (.Values.agones.allocator.service.headless) }}
Copy link
Member

Choose a reason for hiding this comment

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

Rather than a special case for "headless", any reason not to do a agones.allocator.service.clusterIP - which can be set to whatever you want, and provides greater flexibility?

Copy link
Contributor Author

@govargo govargo Dec 5, 2023

Choose a reason for hiding this comment

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

Thank you for your comment!
Surely. The clusterIP field which users can set any value has greater flexibility and can also be used in cases other than headless.

I changed my commit while referring to loadBalanceIP.
{{- $useLoadBalancerIP := and (ne .Values.agones.allocator.service.loadBalancerIP "") (eq .Values.agones.allocator.service.serviceType "LoadBalancer") }}

@zmerlynn
Copy link
Collaborator

zmerlynn commented Dec 4, 2023

@gongmax FYI

@govargo govargo force-pushed the allcator-headless-svc branch from 0e2ea03 to 9f989a9 Compare December 5, 2023 07:49
@govargo govargo changed the title Add Headless Service for agones-allocator in MultiClusterService Add clusterIP for agones-allocator in helm chart Dec 5, 2023
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 34f90e29-add9-4129-9b79-18b31daaaf13

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/3526/head:pr_3526 && git checkout pr_3526
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.37.0-dev-9f989a9-amd64

@@ -72,6 +73,9 @@ spec:
protocol: TCP
{{- end }}
type: {{ .Values.agones.allocator.service.serviceType }}
{{- if $clusterIP }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{{- if $clusterIP }}
{{- if (ne .Values.agones.allocator.service.clusterIP "") }}

I write this because this change sent me lookinga thte K8s reference docs, and looking at Service.spec.clusterIP, and I saw it say:

Only applies to types ClusterIP, NodePort, and LoadBalancer

So it's not just the ClusterIP value for Service.spec.type -- so I'd recommend leaving it open, and let the end user decide when it's appropriate to set the value, rather than constrain them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your suggestion!
It would be better and I updated allocation.yaml and helm.md.

@govargo govargo force-pushed the allcator-headless-svc branch from 9f989a9 to 22ea10b Compare December 6, 2023 08:51
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 1445300c-6ead-4022-9c13-73aacee583c9

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

@govargo
Copy link
Contributor Author

govargo commented Dec 6, 2023

Step#20 tests passed but make-docker container exited with some reason. I think this is due to flaky.

Step #20 - "tests": ✔✔✔ passed in 664.984153ms
Step #20 - "tests": tested 187 documents
Step #20 - "tests": make[1]: Leaving directory '/workspace/build'
Finished Step #20 - "tests"
ERROR
ERROR: build step 20 "make-docker" failed: step exited with non-zero status: 2
Finished Step #16 - "build-images"

I'll re-test with some update.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: b054e955-f946-445c-a8ef-4d1d80464ad7

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/3526/head:pr_3526 && git checkout pr_3526
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.37.0-dev-5c06109-amd64

@govargo
Copy link
Contributor Author

govargo commented Dec 6, 2023

Retest with minor documentation clean-up 5c06109 and passed CI

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Looks good!

@markmandel markmandel enabled auto-merge (squash) December 7, 2023 23:57
@github-actions github-actions bot added the size/S label Dec 7, 2023
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: bf642237-c600-4333-99ce-8e97a081fe39

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/3526/head:pr_3526 && git checkout pr_3526
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.37.0-dev-deaf4b1-amd64

@markmandel markmandel merged commit ee6cd66 into googleforgames:main Dec 8, 2023
4 checks passed
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/S size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants