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

Setting CSI AWS topology label on machine deployment creation to allow scale-up #365

Merged
merged 7 commits into from
Jun 28, 2021

Conversation

himanshu-kun
Copy link
Contributor

@himanshu-kun himanshu-kun commented Jun 21, 2021

How to categorize this PR?

/area auto-scaling
/kind enhancement
/platform aws

What this PR does / why we need it:
adds driver specific CSI label topology.ebs.csi.aws.com/zone during machineDeployment creation
Which issue(s) this PR fixes:
Fixes #364

Special notes for your reviewer:
also made changes to unit test written for machineDeployment generation by adding relevant variables
Release note:

AWS CSI driver specific topology label  "topology.ebs.csi.aws.com/zone" is set as a label on machine deployments to allow the proper working of cluster-autoscaler during scale-up. 

@himanshu-kun himanshu-kun requested review from a team as code owners June 21, 2021 17:41
@gardener-robot gardener-robot added area/auto-scaling Auto-scaling (CA/HPA/VPA/HVPA, predominantly control plane, but also otherwise) related kind/enhancement Enhancement, improvement, extension platform/aws Amazon web services platform/infrastructure needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Jun 21, 2021
@gardener-robot-ci-3
Copy link
Contributor

Thank you @himanshu-kun for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below.

@himanshu-kun himanshu-kun changed the title added csi driver label if not present and tests added csi driver label to machineDeployment, if not present and added tests Jun 21, 2021
@himanshu-kun himanshu-kun reopened this Jun 21, 2021
@gardener-robot gardener-robot added the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Jun 21, 2021
@ialidzhikov ialidzhikov removed the reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies label Jun 21, 2021
pkg/controller/worker/machines_test.go Outdated Show resolved Hide resolved
pkg/controller/worker/machines.go Outdated Show resolved Hide resolved
Copy link

@prashanth26 prashanth26 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @himanshu-kun . Some suggested changes.

pkg/controller/worker/machines.go Outdated Show resolved Hide resolved
Copy link

@prashanth26 prashanth26 left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Just minor comments. /lgtm otherwise.

pkg/controller/worker/machines_test.go Outdated Show resolved Hide resolved
pkg/controller/worker/helper.go Outdated Show resolved Hide resolved
pkg/controller/worker/helper.go Outdated Show resolved Hide resolved
pkg/controller/worker/helper.go Outdated Show resolved Hide resolved
@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Jun 23, 2021
pkg/controller/worker/helper.go Outdated Show resolved Hide resolved
pkg/controller/worker/helper.go Outdated Show resolved Hide resolved
himanshu-kun and others added 3 commits June 24, 2021 00:36
Co-authored-by: Prashanth <[email protected]>

Co-authored-by: Prashanth <[email protected]>

Co-authored-by: Prashanth <[email protected]>
not exporting csi driver key constant

Co-authored-by: Vladimir Nachev <[email protected]>
removed unit tests, updated constant name to `awsCSIDriverTopologyKey`
@gardener-robot gardener-robot added size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) and removed size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Jun 23, 2021
Copy link
Contributor Author

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

I have removed the unit tests which I had added earlier in machines_test.go but have tested the changes on local AWS shoot.
For AWS cluster , CSI is enable from k8s>=1.18, so I have tested with local shoot of k8s=1.17.17 and k8s =1.20.2 and both gave the expected result of not adding and adding the csi label respectively.
Hope thats ok @vpnachev @rfranzke

pkg/controller/worker/machines.go Show resolved Hide resolved
pkg/controller/worker/machines.go Outdated Show resolved Hide resolved
himanshu-kun and others added 2 commits June 24, 2021 19:17
moved comments

Co-authored-by: Vladimir Nachev <[email protected]>
Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

Looks great now, just a unit test is missing as requested by @vpnachev

@gardener-robot
Copy link

@himanshu-kun You have pull request review with status CHANGES_REQUESTED, please check

1 similar comment
@gardener-robot
Copy link

@himanshu-kun You have pull request review with status CHANGES_REQUESTED, please check

@gardener-robot gardener-robot added size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) and removed size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Jun 28, 2021
@prashanth26
Copy link

/title Setting CSI AWS topology label on machine deployment creation to allow scale-up

@gardener-robot gardener-robot changed the title added csi driver label to machineDeployment, if not present and added tests Setting CSI AWS topology label on machine deployment creation to allow scale-up Jun 28, 2021
Copy link

@prashanth26 prashanth26 left a comment

Choose a reason for hiding this comment

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

Thanks for the changes and tests @himanshu-kun .
/lgtm
/squash

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging merge/squash Should be merged via 'Squash and merge' and removed needs/changes Needs (more) changes needs/review Needs review labels Jun 28, 2021
@vpnachev vpnachev added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 28, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 28, 2021
Copy link
Member

@rfranzke rfranzke left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

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

/lgtm

@rfranzke rfranzke merged commit e5ac1c5 into gardener:master Jun 28, 2021
@vpnachev
Copy link
Member

/needs cherry-pick

@gardener-robot gardener-robot added the needs/cherry-pick Needs to be cherry-picked to older version label Jun 28, 2021
@vpnachev
Copy link
Member

@prashanth26 @himanshu-kun please open a cherry-pick PR to version 1.25 with this change.

You can see more details in https://github.com/gardener/gardener/blob/master/docs/development/process.md#cherry-picks and get some inspirations how to open the PR.

@prashanth26
Copy link

prashanth26 commented Jun 28, 2021

@prashanth26 @himanshu-kun please open a cherry-pick PR to version 1.25 with this change.

You can see more details in https://github.com/gardener/gardener/blob/master/docs/development/process.md#cherry-picks and get some inspirations how to open the PR.

@himanshu-kun will get this done. Thanks.

rfranzke pushed a commit that referenced this pull request Jun 29, 2021
…gy label on machine deployment creation to allow scale-up (#368)

* added csi driver label if not present and tests

Co-authored-by: Prashanth <[email protected]>

Co-authored-by: Prashanth <[email protected]>

Co-authored-by: Prashanth <[email protected]>

* Update pkg/controller/worker/helper.go

not exporting csi driver key constant

Co-authored-by: Vladimir Nachev <[email protected]>

* checking if CSI enabled before adding csi label removed unit tests, updated constant name to `awsCSIDriverTopologyKey`

* used lambda fn to add aws csi label

* Update pkg/controller/worker/machines.go

moved comments

Co-authored-by: Vladimir Nachev <[email protected]>

* Update pkg/controller/worker/machines.go

Co-authored-by: Vladimir Nachev <[email protected]>

* added test case

Co-authored-by: Prashanth <[email protected]>
Co-authored-by: Vladimir Nachev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/auto-scaling Auto-scaling (CA/HPA/VPA/HVPA, predominantly control plane, but also otherwise) related kind/enhancement Enhancement, improvement, extension merge/squash Should be merged via 'Squash and merge' needs/cherry-pick Needs to be cherry-picked to older version needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) platform/aws Amazon web services platform/infrastructure reviewed/lgtm Has approval for merging size/m Size of pull request is medium (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scale from zero fails to work on k8s >= 1.18 AWS
8 participants