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

Example CSI configuration for AWS EBS and EFS #9366

Closed
wants to merge 1 commit into from

Conversation

tsarna
Copy link

@tsarna tsarna commented Nov 15, 2020

I am contributing these additional CSI example files for AWS EBS and CSI in the hope that it will help others.

The online documentation does have some EBS content, but this example includes some more details, like getting AWS credentials from Vault, and using Terraform to create a disk and automatically create the volume registration file.

There are no EFS examples out there as far as I know.

Thanks!

@hashicorp-cla
Copy link

hashicorp-cla commented Nov 15, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Hi @tsarna! Thanks for submitting this PR!

]
}

output "mytestefsvol" {
Copy link
Member

Choose a reason for hiding this comment

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

Another option here that could make this a little more streamlined is to register the volume via Terraform directly, similar to how it's done in the DO example: https://github.com/hashicorp/nomad/blob/master/demo/csi/digitalocean/main.tf#L18-L28

Copy link
Author

Choose a reason for hiding this comment

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

I'll provide examples of both (and make it clear it's either/or).

demo/csi/aws/efs/example.tf Show resolved Hide resolved
@@ -0,0 +1,30 @@
data "aws_kms_alias" "ebs" {
name = "alias/aws/ebs"
Copy link
Member

Choose a reason for hiding this comment

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

There's no other reference to setting up a KMS key in the documentation. Can we either add something giving folks a pointer here or remove this?

Copy link
Author

Choose a reason for hiding this comment

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

AWS automatically provides a master key for EBS to use to decrypt the per-volume keys, which is what is being used here. There is nothing extra to set up in this case. You can also use KMS to create other master keys, which requires more setup. I have added a comment to this effect.

@@ -0,0 +1,10 @@
# terraform output mytestebsvol >example-volume.hcl
Copy link
Member

Choose a reason for hiding this comment

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

If we intend for these example.hcl files to be generated by Terraform, we shouldn't also commit them to the repo. (I'd even drop a .gitignore file in this directory to be sure folks don't commit the volume)

Copy link
Author

Choose a reason for hiding this comment

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

I think it's useful to have a simple example file that someone can try to understand without trying to understand Terraform at the same time. I'll change the comments so it's clear that this is a separate example from the Terraform examples.

demo/csi/aws/ebs/vault-example-setup.sh Show resolved Hide resolved
demo/csi/aws/README.md Show resolved Hide resolved
@tgross
Copy link
Member

tgross commented Feb 19, 2021

Hi @tsarna! Do you think you're going to get a chance to wrap up the comments on this PR? Otherwise I can pick it up from here and carry it to get merged.

@tsarna
Copy link
Author

tsarna commented Feb 19, 2021

Hi @tgross yes, I'll try to find some time this weekend

Base automatically changed from master to main March 8, 2021 19:25
@tgross tgross closed this Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

3 participants