Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

module: Add EBS extra volume support #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

module: Add EBS extra volume support #1

wants to merge 1 commit into from

Conversation

jieyu
Copy link
Owner

@jieyu jieyu commented Jan 29, 2019

Allow extra EBS volumes to be created for each AWS instance.

Created a new module under modules/aws/ebs/. This will become dcos-terraform/terraform-aws-ebs eventually, and linked to this repo as a submodule similar to others.

dcos-terraform/terraform-aws-instance#6
dcos-terraform/terraform-aws-infrastructure#20
dcos-terraform/terraform-aws-private-agents#8
dcos-terraform/terraform-aws-dcos#45

description = "Number of instances"
}

variable "num" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see you have sizes and types variable, it seems like you may be able to determine the num based on these two variables. We just need to confirm that you will not run into this hashicorp/terraform#17421

Copy link
Owner Author

Choose a reason for hiding this comment

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

@bernadinm i hit exactly this limitation. Will add a comment about this limitation.

* num = "3"
* sizes = ["500", "100", "1000"]
* types = ["", "", "gp2"]
* iopses = ["0", "300", "3000"]
Copy link

Choose a reason for hiding this comment

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

My first impression is that three independent arrays are not good idea. I would prefer a list of maps. Any reason why you have chosen such a design?

Copy link
Owner Author

Choose a reason for hiding this comment

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

@fatz thanks for the review! Can we do that as a input variable?

Copy link

Choose a reason for hiding this comment

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

yes. an example are additional_listeners here https://github.com/dcos-terraform/terraform-aws-lb

However this also requires handling unset keys and defaults. But in general this is possible

Copy link
Owner Author

Choose a reason for hiding this comment

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

ah! very nice! i like that! I'll see what I can do.

* module "instance-volume" {
* source = "dcos-terraform/ebs/aws"
*
* instances = ["id-ablsldhfa123", "id-aidrkdkek131"]
Copy link

Choose a reason for hiding this comment

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

in generally do not like the idea of inter module resource changes. Volume management should be part of the instance module not an external one.

All modules are currently design to keep this approach and don't do intermodule changes. We should prefer buiding a similar solution in the instance module. I would only agree on such a solution if there is no useful way doing it with the instance module

Copy link
Owner Author

Choose a reason for hiding this comment

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

@fatz are you suggesting moving the code into terraform-aws-instance?

Copy link

Choose a reason for hiding this comment

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

if this should be a feature of the universal installer yes.

Copy link
Owner Author

Choose a reason for hiding this comment

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

OK, sgtm!

@fatz
Copy link

fatz commented Feb 4, 2019

But as long as this is not part of the universal installer it could IMO be used beside the universal installer as this is only about attaching volumes. So you could take the output of the infrastructure module to attach these volumes without being implemented as a universal installer feature

@jieyu
Copy link
Owner Author

jieyu commented Feb 4, 2019

@fatz thanks for the review.

I was also debating if this should be part of universal installer or not. I think the goal of UI is to make it easy for users to setup DC/OS clusters as well as the relevant infrastructure (e.g., DNS, load balancer, security groups, etc.).

Given that, I am still leaning toward making this part of UI. This feature is optional anyway.

@jieyu jieyu force-pushed the jie/ebs branch 6 times, most recently from 4944c59 to 51e6237 Compare February 5, 2019 05:54
@jieyu jieyu closed this Feb 5, 2019
@jieyu jieyu reopened this Feb 5, 2019
Allow extra EBS volumes to be created for each AWS instance.
@jieyu
Copy link
Owner Author

jieyu commented Feb 5, 2019

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants