-
Notifications
You must be signed in to change notification settings - Fork 50
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
Draft - update networking between nodeagent daemonset and gameserver pods #406
Conversation
thanks @vachillo, this seems to be trickier than what I originally thought. In this case, we'd need to have a single service per Node, correct? That seems a bit hard to maintain unfortunately. Yeah, the GSDK that is running on the GameServer Pod expects to find a JSON file with the necessary configuration. If this fails it will not start. Regarding the Public IP, I was trying to find out ways on how to do that since Kubernetes does not expose the External IP in the downstream API. I've collected a simple hack here: https://playfab.github.io/thundernetes/howtos/publicipaddress.html Not sure what is the best approach for this, let's leave this open for further investigation and discussion. Thank you! |
we actually wouldn't need a different service per node, that's what the
is there a mechanism to provide your own init container to initialize that json file? I haven't tried it, but my assumption is that the default one would overwrite any changes if another one was provided in the podTemplateSpec.
however that public IP gets retrieved, maybe it can be exposed as an endpoint on that nodeagent daemonset pod? we know that the pods asking for those IPs will always be on the same node. an endpoint to periodically get metadata about the node could be useful. maybe that complicates it more than necessary, but just a thought. |
8e1690e
to
99c1782
Compare
Gotcha, wasn't aware of the
We actually append the Thundernetes initContainer to the existing ones provided by the user ->
That's a great suggestion, we could expose an extra endpoint on the NodeAgent with Node details, e.g. anything not available on the downstream API. This would solve #136 Given that this addition would need more testing, unfortunately I don't think we have time to include for 0.6. Sorry :( Additionally, YAML changes (Service etc.) would need to be included in this folder https://github.com/PlayFab/thundernetes/tree/c0107046dc63facff96c0f9e9e0ce64160ade0d9/pkg/operator/config since everything on Appreciate the discussion! |
thought a lot about #108 and this is what i have so far:
adding a network policy for the nodeagent pods allows you to control the ingress/egress traffic. there isn't a lot to it, it only lets you choose on label names for pods/namespaces/cidr blocks. the following network policy only allows traffic from any pod with the
OwningOperator: thundernetes
in any namespace, and from pods in themonitoring
namespace. this would still allow traffic from pods in other nodes, but that is addressed belowadding a
headlessservice in front of the nodeagent pods allows the gameservers to reach the heartbeat endpoint via a FQDN rather than the node ip address. the service also hasinternalTrafficPolicy: Local
, meaning gameservers will always be routed to nodeagent pods on the same node. i think this is a more decoupled strategy rather than using the node ip.edit: dont think it needs to be a headless service actually, we dont want DNS records returned for each node behind the service, we just want the service to route to the correct node. more info about that here.
nslookup
of the node name resolves to the internal IP.let me know what you think. I see that the setup for the game server pod creation is opinionated by using the init container to create a json file for the gsdk, so I wasn't sure at what point during the initialization was best to inject the service endpoint variable in the environment.