-
Notifications
You must be signed in to change notification settings - Fork 811
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
Do not remove replica field if set to zero #1305
Conversation
Starting from Agones v1.2 the replica field was made optional. The API is also tagged with omitempty, meaning for JSON serialization the field is omitted if set to zero. omitempty tag makes the API backward incompatible with Agones v1.1.
If we make this change, how do we update Replicas, without changing the replica count? This is particularly important for Fleets that are controlled by Autoscalers. |
Build Failed 😱 Build Id: 2d58b30d-5ff5-4312-84a8-c19e0a388b72 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Oh, thanks for reminding me. I forgot the use-case. I'll close the PR then. |
I'd like to reopen this for discussion, because I was thinking about this more, and I think adding omitemtpy might have been a mistake:
So I'm going to reopen this, mainly as well to see if all the e2e tests pass, and to hear if anyone has additional thoughts and opinions. Sorry it took me so long to come around on this. Sometimes it takes me a while. 😞 |
It might be worth noting that there is a UpdateScale interface as well for Fleets, so you could use that to scale to 0. @aLekSer do you have thoughts on this? |
I will test this steps again on this PR changes RollingUpdate shuts down all servers at once |
Build Succeeded 👏 Build Id: d93a9a6c-364b-425c-9d69-e52966914a00 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Thanks! Looks like e2e tests have passed. This shouldn't affect the kubectl test you did previously, as it doesn't route through our go code - it talks directly to the Kubernetes API. That being said, let's still double check to make sure. If the kubectl test passes for you @aLekSer , I recommend we merge this PR. |
RollingUpdate should be working, I will follow the docs tomorrow to see that there are now regressions, there are couple of options how to change a Fleet.
If I change the label and do |
@aLekSer gentle bump - have you had a chance to test this out yet? |
Hello, partly yes, will update ASAP. |
Regarding the docs, I have tested with this PR
And the opposite if we have replicas and other field change than RollingUpdate is still working. However when I use fleet with fleetautoscaler than we break the doc statement:
https://gist.github.com/aLekSer/f0da2fb8a5a43d170d0dd711bfbd6f33
|
Tested this on version 1.3.0 - same issue applies to it, so docs was inaccurate.
As well as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this on version 1.3.0 - same issue applies to it, so docs was inaccurate.
https://gist.github.com/aLekSer/f0da2fb8a5a43d170d0dd711bfbd6f33
Overall I can approve this PR as we don't have regressions.
Just as a side note. Replicaset
does contain omitempty however it is using pointer:
// ReplicaSetSpec is the specification of a ReplicaSet.
type ReplicaSetSpec struct {
// Replicas is the number of desired replicas.
// This is a pointer to distinguish between explicit zero and unspecified.
// Defaults to 1.
// More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller
// +optional
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
As well as DeploymentSpec
https://github.com/kubernetes/kubernetes/blob/7e8f31b31318104f0288350652eaca0b1c84d4fc/staging/src/k8s.io/api/apps/v1/types.go#L274
Mark @markmandel do we need to change Replicas
to pointer at some point?
Sounds like we should create a bug to track this separately.
Using a pointer seems like an elegant solution, in that while it does change the API, it won't actually break functionality (wherein the previous fix did break functionality, because you couldn't scale to 0). That being said, we need to work out what the root cause of the issue is here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move forward with this, and track the other issue separately 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aLekSer, markmandel, pooneh-m The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
Build Succeeded 👏 Build Id: 29078eed-6068-4332-82ca-8ad11d7a2fb5 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Starting from Agones v1.2 the replica field was made optional. The API is also tagged with omitempty, meaning for JSON serialization the field is omitted if set to zero. omitempty tag makes the API backward incompatible with Agones v1.1. Co-authored-by: Mark Mandel <mark.mandel@gmail.com>
Starting from Agones v1.2 the replica field was made optional. The API is also tagged with omitempty, meaning for JSON serialization the field is omitted if set to zero. omitempty tag makes the API backward incompatible with Agones v1.1.