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

Sidecar to Daemonset #97

Merged
merged 12 commits into from
Dec 16, 2021
Merged

Sidecar to Daemonset #97

merged 12 commits into from
Dec 16, 2021

Conversation

dgkanatsios
Copy link
Collaborator

@dgkanatsios dgkanatsios commented Dec 4, 2021

PR to remove the sidecar in favor of a DaemonSet. Fixes #107. TODO items:

  • Protect the DaemonSet HTTP server by ListenAndServer on the Node DNS Name. We need to make sure this works with kind as well. Another option would be to somehow configure the DaemonSet Pods (either configuration or code?) to NOT accept traffic from outside the Node
  • Decide how we're gonna have a single .Update on the GameServer controller loop - we fixed this by using Patch. A subsequent PR will update the controller code with patch instead of update
  • Change the documentation and the architecture image from sidecar to DaemonSet
  • end to end tests should wait for the DaemonSet to start (kubectl wait didn't seem to work). We will not do that after all, since in production environments, DaemonSet Pods will be scheduled before GameServer Pods but they may not start before them. Worst case scenario, we might miss a couple of heartbeats, which is acceptable.
  • write unit tests for the DaemonSet
  • refactor DaemonSet code to use a struct so we can do DI on the tests
  • modify the end to end tests to check DaemonSet for the player logs instead of the sidecar
  • have the DaemonSet start before other pods in the Node start (we should check https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#effect-of-pod-priority-on-scheduling-order, thanks @khaines)
  • In case of multiple Node Pools, how can we update DaemonSet to be scheduled only on the Node Pools that have Game Servers? yup, Node Selectors https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#running-pods-on-select-nodes
  • Add healthz to the web server

Copy link
Collaborator

@khaines khaines left a comment

Choose a reason for hiding this comment

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

A few nits, but nothing blocking related to this change. Glad to see this getting merged in!

nodeagent/nodeagentmanager.go Outdated Show resolved Hide resolved
nodeagent/nodeagentmanager.go Outdated Show resolved Hide resolved
- gameserverdetails
verbs:
- get
apiVersion: rbac.authorization.k8s.io/v1
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 like the comment at the top of the old file describing what the intent is

@dgkanatsios dgkanatsios force-pushed the daemonset branch 2 times, most recently from f1e6331 to 149a186 Compare December 14, 2021 05:32
@dgkanatsios dgkanatsios force-pushed the daemonset branch 2 times, most recently from 2585a6c to 29ad20d Compare December 14, 2021 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace sidecar with DaemonSet
2 participants