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

Is there any purpose for not supporting the updating of Gameserver? #2371

Closed
scarlet25151 opened this issue Nov 12, 2021 · 4 comments
Closed
Labels
wontfix Sorry, but we're not going to do that.

Comments

@scarlet25151
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

When I apply a single gameserver something like the example below, it success create a pod and everything goes well,

apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
  generateName: "simple-game-server-"
spec:
  ports:
  - name: default
    portPolicy: Dynamic
    containerPort: 7654
  template:
    spec:
      containers:
      - name: simple-game-server
        image: simple-game-server:0.5
        resources:
          requests:
            memory: "64Mi"
            cpu: "20m"
          limits:
            memory: "64Mi"
            cpu: "20m"

But when I apply a new yaml or using kubectl edit in cli, trying to modify or update the image version to simple-game-server:1.0 the spec in gameserver is changed but the pod of the server would not be killed and restart with the new image, when I tried to edit the spec in the pod directly my behavior is forbidden, something like this:

# pods "simple-game-server" was not valid: 
# * spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`, `spec.initContainers[*].image`, `spec.activeDeadlineSeconds` or `spec.tolerations` (only additions to existing tolerations) 

Also, when I delete pod, the gameserver would not start a new one.

I've look into the GameServer Specification and notice that:

The GameServer resource does not support updates. If you need to make regular updates to the GameServer spec, consider using a Fleet.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Now in my company, we can make sure that some game will use the policy Stop the server and maintenance
so there would be no player or the connection to the server when it's updating. another thing is that since my gameserver is connecting to an datatbase so if we use fleet for rolling updating, there may be 2 server connecting to 1 database and it may create inconsistent data

Therefore we would have a pattern that delete one old pod and start a new one with new image using gameserver rather than fleet.

So I have some doubt on the design that why gameserver would not support update?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@scarlet25151 scarlet25151 added the kind/feature New features for Agones label Nov 12, 2021
@roberthbailey
Copy link
Member

Have you seen #1724 where @markmandel said:

We really don't actually support editing GameServer spec

Also see the note on https://agones.dev/site/docs/reference/gameserver/:

The GameServer resource does not support updates. If you need to make regular updates to the GameServer spec, consider using a Fleet.

@roberthbailey
Copy link
Member

@markmandel may have additional context about why Agones has this design.

@markmandel
Copy link
Member

Now in my company, we can make sure that some game will use the policy Stop the server and maintenance
so there would be no player or the connection to the server when it's updating.

Sorry, I'm very much not understanding the use case here. This seems to me like this is the sort of problem that Allocation solves? If a GameServer shouldn't be shutdown on rolling update, then it should be a in an Allocated state.

I'm not quite seeing why you seem to be rebuilding this mechanic, but I may well be missing something here.

another thing is that since my gameserver is connecting to an datatbase so if we use fleet for rolling updating, there may be 2 server connecting to 1 database and it may create inconsistent data

I also don't see how updating a single GameServer solves this problem? This sounds like an application layer consideration, not an Agones consideration.

Ultimately, there's no need for GameServers to update - run a Fleet with 1 replica, and you have exactly what you need. This is what Fleets and Allocations are for though - managing the lifecycle of GameServers. GameServers are immutable because they represent a single lifecycle of a game server process.

This is exactly the same reason why Pods are not updatable in Kubernetes. Use a Deployment or a StatefulSet.

See: https://stackoverflow.com/questions/58258849/editing-kubernetes-pod-on-the-fly

So I'm pretty strongly in the wontfix camp for this issue, but I'm happy to hear clarifying statements in case I'm missing something.

@scarlet25151
Copy link
Author

Got your point, and I've modify the usage to fleet, thank you for your kindly clarify

@markmandel markmandel added wontfix Sorry, but we're not going to do that. and removed kind/feature New features for Agones labels Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Sorry, but we're not going to do that.
Projects
None yet
Development

No branches or pull requests

3 participants