-
Notifications
You must be signed in to change notification settings - Fork 825
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
Adding AGONES_SDK_GRPC_HOST to NewSDK #1183
Comments
Out of curiosity, what value would you put in for the server address running on docker compose? I'm assuming compose doesn't had a concept of pods to put the two containers into the same network namespace, which is why you would need to override the address. |
For example, in the following version: "3"
services:
gameserver:
...
agones-sdk-server:
... |
Could you do host networking for all your containers in compose? (Not saying that's a great idea, but it's a workaround for now) |
Can you steer containers in compose to land on the same underlying node? If not, host networking wouldn't help. |
Docker compose is single node isn't it? (I haven't used it for a while) - so essentially local development only? |
Good question. I've never used it, but based on https://docs.docker.com/compose/production/ it looks like you can run across multiple nodes using docker swarm:
|
@castaneai I assume you are using this for just local development? It sounds like you are trying to replicate a Pod system locally for development? |
Yes, I'm using docker-compose for local development (on single node). |
In that case, does @markmandel's suggestion above about using host network unblock you? |
That's true for Linux. However, host network is not supported on Mac and Windows. 😢 https://docs.docker.com/network/host/
|
Can you do a variation on https://blog.mikesir87.io/2019/03/sharing-network-namespaces-in-docker/ , but with compose? (Basically use another container's network?) |
Adding Here is my example repo. https://github.com/castaneai/agones-sdk-playground version: "3"
services:
gameserver:
build: .
sdk-server:
build: ./sdk-server
network_mode: service:gameserver |
This sounds like it could be a cool thing to add to our docs somewhere. 👍 |
I currently have a use case where it would be beneficial to be able to set the host / address (for both HTTP and GRPC) for the SDKs so that they can reach a SDK server (custom SDK server that doesn't bind to |
Can you elaborate more about why you find it useful to run a custom SDK server (and if you can say, how different is it from the canonical implementation)? If you are running a proxy sidecar anyway, I'm curious what the advantage is of running the sdkserver is a separate pod. Is it always on the same machine or can it be elsewhere in the cluster? It would be straightforward to modify the SDKs to take an environment variable for the host to connect to, but by pointing it outside of the current pod, I wonder if that ends up breaking some of the assumptions that are currently built into the different SDKs (e.g. they don't implement much retry logic since grpc requests to localhost pretty much always succeed once the sdkserver is up and running). |
I have some custom readiness logic, otherwise the implementation is the same (it's in go so there isn't really much code as I'm reusing most of the original SDK server).
Ah, good point! That is definitely a concern, and to be honest not something that I have thought much about this far. Perhaps having a proper proxy with retries and whatnot would be a more reasonable solution than changing the client SDKs. |
Came up in #2054 - but I'm wondering if a set of open source sidecars that have different types of use cases would be a good way to tackle this, rather than trying to resolve it in core? |
Yeah, I'm not sure it fits in core. I think sidecar(s) makes the most sense at this time, to test different things to see what works and what doesn't for different scenarios. |
i have windows containers, for them options like
|
|
This issue hasn't been updated since #2677 was merged so I'm going to mark it as fixed by that PR. If there is anything else to do here, please feel free to re-open it. |
In local development, I'd like to run Agones SDK server on docker-compose.
However, the current Agones SDK always connect to
localhost
.GameServer and Local SDK server cannot be run on different containers.
agones/sdks/go/sdk.go
Lines 45 to 49 in 1071930
One solution is to add
AGONES_SDK_GRPC_HOST
that can override localhost. What do you think?The text was updated successfully, but these errors were encountered: