Add nodes-min and nodes-max flags in ng scale#2022
Merged
cPu1 merged 3 commits intoeksctl-io:masterfrom May 14, 2020
Merged
Conversation
ff1afdf to
28710c1
Compare
04647b2 to
36105a3
Compare
Contributor
Author
|
@martina-if @cPu1 for your input and review, happy to address any comment you have 👍 |
7f4500f to
e4d57a3
Compare
cPu1
suggested changes
May 11, 2020
Contributor
cPu1
left a comment
There was a problem hiding this comment.
I have left some comments, but otherwise LGTM. ✨
Thanks for the great test coverage for your changes.
Comment on lines
+192
to
+197
| changed := ng.DesiredCapacity != nil && int64(*ng.DesiredCapacity) != currentCapacity.Int() | ||
| changed = changed || (ng.MinSize != nil && (int64(*ng.MinSize) != currentMinSize.Int())) | ||
| changed = changed || (ng.MaxSize != nil && (int64(*ng.MaxSize) != currentMaxSize.Int())) | ||
| if !changed { |
Contributor
There was a problem hiding this comment.
Alternatively:
hasChanged := func(desiredVal *int, currentVal gjson.Result) bool {
return desiredVal != nil && int64(*desiredVal) != currentVal.Int()
}
changed := hasChanged(ng.DesiredCapacity, currentCapacity) || hasChanged(ng.MaxSize, currentMaxSize) || hasChanged(ng.MinSize, currentMinSize)
Contributor
Author
There was a problem hiding this comment.
oh good one, I like this inline function style 💯
Contributor
Author
martina-if
reviewed
May 13, 2020
Assumption: - nodes flag is mandatory - perform any validation asap and fail fast instead of relying on CF - cluster config file support will not be out of scope for this PR
+ Use inline function to detect changes + Use inline function to update CF stack
michi-covalent
added a commit
to cilium/cilium
that referenced
this pull request
May 26, 2020
Now `--nodes-max` gets set to the same value as `--nodes` by default. Ref: eksctl-io/eksctl#2022 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
5 tasks
michi-covalent
added a commit
to cilium/cilium
that referenced
this pull request
Jun 3, 2020
- Create a cluster with `--without-nodegroup` option and create a node group after deploying Cilium. - Change the cluster name to `test-cluster` in the ENI getting started so it can use the same "Create a nodegroup" section as the EKS guide. Ref: eksctl-io/eksctl#2022 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
aanm
pushed a commit
to cilium/cilium
that referenced
this pull request
Jun 4, 2020
- Create a cluster with `--without-nodegroup` option and create a node group after deploying Cilium. - Change the cluster name to `test-cluster` in the ENI getting started so it can use the same "Create a nodegroup" section as the EKS guide. Ref: eksctl-io/eksctl#2022 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
tklauser
pushed a commit
to cilium/cilium
that referenced
this pull request
Jun 4, 2020
[ upstream commit 5f1bec8 ] - Create a cluster with `--without-nodegroup` option and create a node group after deploying Cilium. - Change the cluster name to `test-cluster` in the ENI getting started so it can use the same "Create a nodegroup" section as the EKS guide. Ref: eksctl-io/eksctl#2022 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
borkmann
pushed a commit
to cilium/cilium
that referenced
this pull request
Jun 5, 2020
[ upstream commit 5f1bec8 ] - Create a cluster with `--without-nodegroup` option and create a node group after deploying Cilium. - Change the cluster name to `test-cluster` in the ENI getting started so it can use the same "Create a nodegroup" section as the EKS guide. Ref: eksctl-io/eksctl#2022 Signed-off-by: Michi Mutsuzaki <michi@isovalent.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1893
Fixes #809
Approach
I am having below assumptions/scopes while implementing this feature.
--nodesflag is mandatory flagfail fastapproach i.e. if there is anything wrong with input, just throw error instead of waiting for error from CF.Testing
invalid flag values
no change in current value
some changes with desired node, min or max
desired node is not within current range from CF
Checklist
README.md, or thesite/contentdirectory)area/nodegroup), target version (e.g.version/0.12.0) and kind (e.g.kind/improvement)