-
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
EBS Root Volume Termination #7865
Conversation
Hi @tioxy. 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 Once the patch is verified, the new status will be reflected by the 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. |
/assign @geojaz |
/ok-to-test Can you add a test for this? Perhaps just adding the field in this manifest and updating the terraform and cloudformation files in the same directory to match. |
@tioxy have you tried building an instance group with and without this setting? I had some difficulty with an existing group and the |
Hi @joshbranham 😀 One of the changes that probably affected your attempt was around
I made a step-by-step below running kops updates against different instance group volume settings as you suggested 👍
These are the manifests that I used to create a cluster with different volume settings: kind: InstanceGroup
metadata:
name: master-us-east-1a
spec:
role: Master
rootVolumeRetainOnTermination: true # retain root
volumes:
- device: /dev/xvdd
encrypted: true
size: 20
type: gp2 kind: InstanceGroup
metadata:
name: nodes
spec:
role: Node
volumes:
- device: /dev/xvdd
encrypted: true
retainOnTermination: true # retain xvdd
size: 20
type: gp2 Then I ran LaunchConfiguration/master-us-east-1a.masters.kops.tioxy.com
BlockDeviceMappings [{"DeviceName":"/dev/xvdd","EbsDeleteOnTermination":true,"EbsEncrypted":true,"EbsVolumeIops":null,"EbsVolumeSize":20,"EbsVolumeType":"gp2","VirtualName":null}]
RootVolumeSize 64
// retain root
RootVolumeTermination false
RootVolumeType gp2
LaunchConfiguration/nodes.kops.tioxy.com
// retain xvdd
BlockDeviceMappings [{"DeviceName":"/dev/xvdd","EbsDeleteOnTermination":false,"EbsEncrypted":true,"EbsVolumeIops":null,"EbsVolumeSize":20,"EbsVolumeType":"gp2","VirtualName":null}]
RootVolumeSize 128
RootVolumeTermination true
RootVolumeType gp2 I edited the kind: InstanceGroup
metadata:
name: nodes
spec:
role: Node
rootVolumeRetainOnTermination: true # retaining root now
volumes:
- device: /dev/xvdd
encrypted: true
retainOnTermination: true
size: 20
type: gp2 And this the result after Will modify resources:
LaunchConfiguration/nodes.kops.tioxy.com
// retaining root now
RootVolumeTermination true -> false
Must specify --yes to apply changes |
@rifelpet Even after Should we be worried about these dangling volumes during e2e tests (costs and unused resources)? |
7dda94e
to
5154c49
Compare
Fixed tests 👍 |
/test pull-kops-e2e-kubernetes-aws |
/assign @rifelpet |
5154c49
to
8339457
Compare
@tioxy I think this looks good, and I'm trying to give it a test over here for you, but I noticed that I'm getting a failure on verify-goimports (which |
8339457
to
a7085a0
Compare
db532b8
to
a7085a0
Compare
I would agree that using the following nomenclature makes the most sense: |
Support RootVolumeDeleteOnTermination and DeleteOnTermination fields to enable a deeper customization
Change BDM behavior when finding Launch Configuration and generating Cloudformation/Terraform
Implement separated logics for root volume and additional volumes
a7085a0
to
4630d80
Compare
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 all looks good to me, thanks @tioxy !
/lgtm
I agree it looks good! Can we mention the default value of And I noticed this will only apply to LaunchConfigurations and not LaunchTemplates: kops/upup/pkg/fi/cloudup/awstasks/launchtemplate.go Lines 103 to 108 in e1f7d31
I think we can address that in a followup PR but it might be worth mentioning in the API field comments that it currently only applies to LaunchConfigurations. |
Add rootVolumeDeleteOnTermination and deleteOnTermination to test if volumes are being retained properly in direct, terraform and cloudformation
4630d80
to
fa27fe9
Compare
@rifelpet Pushed the default/launch configuration api docs with new codegen. Thank you all for such great reviews 👍 |
One last concern came to mind: if volumes are not deleted by the ASG, does a |
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.
@tioxy this looks great. thanks taking our feedback and running with it. also, you probably have some of the best github change comments I've seen! 🙌
I had some suggestions on the wording that i think make this more digestable for we humans. I didn't note every single change because it's basically all the same :)
State default value for both deleteOnTermination and rootVolumeDeleteOnTermination equals to true
Codegen for deleteOnTermination and rootVolumeDeleteOnTermination (crds and apis)
fa27fe9
to
0e7aca0
Compare
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.
/lgtm
/approve
nice work @tioxy !
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: geojaz, tioxy 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 |
…origin-release-1.17 Automated cherry pick of #7865: feat(api): DeleteOnTermination fields for volumes
…origin-release-1.16 Automated cherry pick of #7865: feat(api): DeleteOnTermination fields for volumes
What type of PR is this?
/kind feature
What this PR does / why we need it:
Enables to change EBS DeleteOnTermination by specifiying separated flags for Root Volume and Additional Volumes inside
InstanceGroupSpec
.Which issue(s) this PR fixes:
Fixes #6373
Special notes for your reviewer:
We found better to split
deleteOnTermination
into different fields, as it enabled a deeper customization of InstanceGroups (originally was suggested only a single field in the structure).Now we can finally close the 1.15 Milestone 😄
Also, a huge thanks to @joshbranham's work
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: