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

Feature/add maintenance poller #8

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

trocadilho
Copy link

Experimental hackathon project representing a Thundernetes extension that when a maintenance event comes, it will:

  1. Make the node Unschedulable (so no more GameServers are scheduled).
  2. Delete any non-Active GameServers in that node so they are not allocated. An equal number of GameServers will be recreated in nodes which are not in maintenance.

Azure documentation on how to handle scheduled events

// standBy = append(standBy, gs)

// kubectl delete gameserver x -n default
err = n.clientset.RESTClient().Delete().AbsPath(apiGroup).Resource("gameservers").Namespace("default").Name(gs.Name).Do(ctx).Error()
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if the GameServers are on a different namespace?

}

var gameServers mpsv1alpha1.GameServerList
err = n.clientset.RESTClient().Get().AbsPath(apiGroup).Resource("gameservers").Namespace("default").Do(ctx).Into(&gameServers)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, I know we talked about it but now that I see it, any chance we can replace the REST client with the generated libraries? You can see some of the code on the Thundernetes end to end tests on how to do that https://github.com/PlayFab/thundernetes/tree/main/cmd/e2e

This will allow for more consistency throughout the project.
Appreciated and apologies for the inconvenience!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Plus, you will be able to access GameServer CRs in any namespace (related to another comment). Thank you!

@@ -0,0 +1,36 @@
apiVersion: v1
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should run as a DaemonSet so it runs on every Node

@@ -0,0 +1,13 @@
# build stage
Copy link
Collaborator

Choose a reason for hiding this comment

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

this Dockerfile format will work only on the main Thundernetes repo (where we set revisions etc.), not here unfortunately.

@trocadilho trocadilho force-pushed the feature/add-maintenance-poller branch from df78ffb to 34ead6e Compare September 21, 2022 19:33
@dgkanatsios
Copy link
Collaborator

hey @trocadilho, let us know if you want any help working with this PR!

@trocadilho
Copy link
Author

Also tagging @allantargino

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants