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

Use environment variables to dynamically set the grpc port in the golang sdk. #1086

Merged

Conversation

roberthbailey
Copy link
Member

I wrote some code to show what option 1 from #851 (comment) would look like, since it seemed like the best option to me.

I'll add tests and do some more checking if we decide to go this route, but I've already verified:

  1. The sdk / sdkserver can be set to different ports and the gameserver becomes ready
  2. If you specify the env vars they get overridden
  3. If you specify the env vars in a configmap using EnvFromSource they get overridden

so it seems pretty robust.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 7edbe592-fb1d-48ef-ab27-7542d2f7f964

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/GoogleCloudPlatform/agones.git pull/1086/head:pr_1086 && git checkout pr_1086
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-9fea6df

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.

👍 I'm in 100% agreement on approach here, it's the most robust and flexible. Just think we should remove the fiter on only the gameserver and apply to all.

We should also include some docs on these environment variables - some people have written their own REST API clients, so will want to be able to know what the ports are going forward.

pkg/gameservers/controller.go Outdated Show resolved Hide resolved
pkg/gameservers/controller.go Outdated Show resolved Hide resolved
@roberthbailey
Copy link
Member Author

We should also include some docs on these environment variables

I was waiting for a +1 on the approach before finishing the PR. I've added unit tests and documentation.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 73fe4792-e376-43ce-83c7-dfe618b80e7b

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/GoogleCloudPlatform/agones.git pull/1086/head:pr_1086 && git checkout pr_1086
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-2842cc0

@roberthbailey roberthbailey changed the title Prototype of using env variables to dynamically set the grpc port in the golang sdk. Use environment variables to dynamically set the grpc port in the golang sdk. Sep 30, 2019
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: dc087191-257a-46c8-9a2d-07d90df864f6

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/GoogleCloudPlatform/agones.git pull/1086/head:pr_1086 && git checkout pr_1086
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-2dd4893

@markmandel markmandel added kind/feature New features for Agones area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc labels Sep 30, 2019
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.

Couple of small things, but otherwise, this looks great 👍

pkg/gameservers/controller.go Outdated Show resolved Hide resolved
sdks/go/sdk.go Show resolved Hide resolved
sdks/go/sdk.go Show resolved Hide resolved
@roberthbailey roberthbailey force-pushed the go-sdk-dynamic-port branch 2 times, most recently from b93b806 to 009ec47 Compare October 1, 2019 07:32
@roberthbailey
Copy link
Member Author

I found a few more places on the website to update with the new environment variable.

I also noticed that https://agones.dev/site/docs/guides/client-sdks/unreal/#settings is rendering the list content incorrectly. It looks correct in my markdown preview window, so I'm not sure what docsy/hugo is doing to it.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3e14458e-ff94-4d8d-944f-e7f2902b846e

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/GoogleCloudPlatform/agones.git pull/1086/head:pr_1086 && git checkout pr_1086
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-009ec47

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0c0d2661-3e1c-413b-a667-296ad37a5c0a

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/GoogleCloudPlatform/agones.git pull/1086/head:pr_1086 && git checkout pr_1086
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-bb3c0fb

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.

LGTM!

Also https://bb3c0fb-dot-preview-dot-agones-images.appspot.com/site/docs/guides/client-sdks/unreal/ looks correct - maybe the updated hugo version fixed it?

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: markmandel, roberthbailey
To complete the pull request process, please assign
You can assign the PR to them by writing /assign in a comment when ready.

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

@markmandel markmandel merged commit c64de9f into googleforgames:master Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones lgtm size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants