-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add scale instancegroup command #2765
Conversation
Hi @gianrubio. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
2ca448a
to
679ade2
Compare
@k8s-bot ok to test |
You need to run |
pkg/instancegroups/instancegroups.go
Outdated
return fmt.Errorf("error scaling autoscaling group %q: %v", asgName, err) | ||
} | ||
|
||
// TODO it's important to wait to this command apply or just print a message to the user is enough? |
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.
I think printing a message is a great idea, rather than waiting.
So I think this looks really good - can you |
679ade2
to
b7852f7
Compare
I add more validations also reviewed the docs. Thats the output:
|
b7852f7
to
813bf6d
Compare
813bf6d
to
f522dd7
Compare
@gianrubio PR needs rebase |
defReplicas = -1 | ||
) | ||
|
||
// TODO add ability to add-nodes rather than scale |
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.
Would this be like kops scale ig nodes +2
? That would indeed be cool (but let's get this PR merged!)
Run: func(cmd *cobra.Command, args []string) { | ||
|
||
if len(args) == 0 { | ||
exitWithError(fmt.Errorf("Specify name of instance group to edit")) |
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.
Nit: probably should scale "to scale"
return fmt.Errorf("name is required") | ||
} | ||
|
||
if c.Replicas == defReplicas { |
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.
Nit: It's probably better to use the Changed field on the flag (doing this in the cobra.Command Run function instead) (spf13/cobra#23). The reason being that then the -1 default value won't appear in the help!
|
||
scale_instancegroup_example = templates.Examples(i18n.T(` | ||
# Scale a ig fixing it to 2 replicas | ||
kops scale ig --name cluster.kops.ddy.systems nodes --replicas=2 |
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.
Either $NAME or cluster.example.com
@@ -17,14 +17,15 @@ limitations under the License. | |||
package simple | |||
|
|||
import ( | |||
"net/url" | |||
"strings" |
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.
This is what triggered the rebase requirement!
glog.Infof("Scaling InstanceGroup %q instances size to: %v", group.ObjectMeta.Name, c.DesiredReplicas) | ||
|
||
// decrease max cluster size | ||
if c.DesiredReplicas < *cig.asg.MinSize { |
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.
Ah - tricky! I'm thinking we should just set min and max both to the desired size. If you disagree, can you add a comment (here or in the code) to explain?
|
||
func (g *CloudInstanceGroup) Scale(cloud fi.Cloud) error { | ||
|
||
c := cloud.(awsup.AWSCloud) |
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.
I worry we might have broken this with some of the refactorings of this interface that have gone in recently... it should be easier now, but let me know if you need some pointers figuring out where things have moved to!
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/lifecycle frozen |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gianrubio Assign the PR to them by writing 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 |
any updates on this? |
@gianrubio: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
I'm going to go ahead and close this PR. If you do want to revive it @gianrubio it would be a great addition :-) /close |
@justinsb: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I did this PR to make easy to scale nodes as suggested on #1892.
It introduce the
scale
command, so the user will be able to runscale ig --name cluster.kops.ddy.systems nodes --replicas=4
to increase the instance size.It run faster than the rolling update because it just change the max/desired size of instance.
I'm open for discussions about!!
This change is