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

AWS EBS volume support #5138

Merged
merged 40 commits into from Apr 10, 2015
Merged

AWS EBS volume support #5138

merged 40 commits into from Apr 10, 2015

Conversation

justinsb
Copy link
Member

@justinsb justinsb commented Mar 6, 2015

Code definitely doesn't work yet, and an open discussion in #5129 on whether we should write server & client code once (with a provider approach) or N times (with a type-per-cloud approach).

But would greatly appreciate any comments particularly on the pkg/cloudprovider/aws/aws.go code. The extra code is non-trivial because AWS volume mounting is pretty painful: you have to specify an unused mount device.

@justinsb
Copy link
Member Author

justinsb commented Mar 6, 2015

AWS code is mostly here: bd9021e

// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk"`
CloudPersistentDisk *CloudPersistentDiskVolumeSource `json:"persistentDisk"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is going to work. You'll overload this struct for every type of cloud provider, which means you have to type it somehow. Some properties would be relevant to some but not all of the providers.

Better, I think, to have an explicit struct per type.

We agree there will be commonalities between them. Good code structure can promote reuse for the common pieces.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'd started this before I saw that there were different viewpoints on #5129. Really looking for feedback on the AWS stuff specifically; once we figure out #5129 then I'll rebase the AWS work on to whatever we choose.

Copy link

Choose a reason for hiding this comment

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

@justinsb could you modify this so it implements AWS persistent volumes as sibling to GCE PD. Similar to other proposed persistent volume plugins: #4612, and #4601.
I think there is general consensus on doing that for now, then improving the abstraction to promote code sharing after a couple of them are merged. See the discussion here on https://github.com/GoogleCloudPlatform/kubernetes/pull/4601/files#r25993686

@markturansky
Copy link
Contributor

cc @swagiaal

@justinsb justinsb force-pushed the cloud_pd branch 3 times, most recently from 30c81c4 to 18a1d11 Compare March 27, 2015 16:01
@piosz
Copy link
Member

piosz commented Mar 31, 2015

Is this PR active? If not please close it according to https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/devel/pull-requests.md

@justinsb
Copy link
Member Author

I should be ready with the updated code this week. I'm currently working on load balancer support, and maintaining two big feature branches simultaneously is too hard, so I'm till that merges before working on EBS.

@ghost
Copy link

ghost commented Mar 31, 2015

@justinsb I can work on this if you are too busy with other PRs. It was on my radar before you posted this.

@justinsb
Copy link
Member Author

I think it's really close, and not sure if it makes any sense to attempt a hand-off.

Let me try to get some of my smaller PRs merged, so I only have to deal with this one and the ELB one... That should be manageable.

@ghost
Copy link

ghost commented Mar 31, 2015

@justinsb Sounds good :)

@justinsb justinsb changed the title WIP: AWS EBS volume support AWS EBS volume support Apr 3, 2015
@justinsb
Copy link
Member Author

justinsb commented Apr 3, 2015

This now "works for me", but I need to run the e2e tests (which I have extended to cover AWS).

Should I squash? I don't know if anyone really cares to see my thought process here :-) And there hasn't been that much review activity yet...

@@ -189,6 +189,9 @@ type VolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk"`
// AWSPersistentDisk represents a AWS EBS disk that is attached to a
// kubelet's host machine and then exposed to the pod.
AWSPersistentDisk *AWSPersistentDiskVolumeSource `json:"awsPersistentDisk"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Would AWSElasticBlockStore be more accurately named?

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps. EBS is just a marketing term though, right? I'd rather think about the API in terms of what the user is trying to achieve - they want a persistent volume. Maybe it should be AWSPersistentVolume.

I guess the question is when Amazon announces ElasticNvram, which is still a block device, would we create a second entry in the API? (Or, if they had chosen to launch SSD under a different name). I'd argue we shouldn't, and as such we shouldn't mirror Amazon's trademark-du-jour...

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe @bgrant0607's intention is to remove all these types of disk from VolumeSource and from the end user (pod authors and the like). The user will make a request for a persistent volume (via PVClaim) and get something. They won't know what and they shouldn't care.

The cluster admin, OTOH, deals with specific infrastructure. He needs to create a specific kind of disk. AWSElasticBlockStore maps cleanly to the AWS API type EbsBlockDevice.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I'll change it. Avoiding another rebase is more important to me than nomenclature :-)

@markturansky
Copy link
Contributor

Also see fuzzer.go for testing the new volume: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/testing/fuzzer.go#L176

@justinsb
Copy link
Member Author

justinsb commented Apr 7, 2015

Added fuzzer, rebased to avoid conflicts with iSCSI

@justinsb justinsb force-pushed the cloud_pd branch 3 times, most recently from 0557a5b to 60dfbc6 Compare April 8, 2015 23:37
@justinsb
Copy link
Member Author

justinsb commented Apr 9, 2015

Now with passing e2e tests also!

http://public-kubernetes-meteor.s3-website-us-east-1.amazonaws.com/builds/kubernetes-e2e-aws/6/_1.xml

In particular:

<testcase name="PD should schedule a pod w/ a RW PD, remove it, then schedule it on another host" classname="Kubernetes e2e Suite run 1 of 1" time="60.902563537"/>

if context.Provider == "aws" {
awsConfig := "[Global]\n"
if cloudConfig.Zone == "" {
glog.Error("gce_zone must be specified for AWS")
Copy link
Contributor

Choose a reason for hiding this comment

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

is "gce_zone" correct here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is tricky. I'm not sure whether we want flags for each provider (i.e. potentially duplicate kube_master, gce_project, gce_zone -> aws_kube_master, aws_gce_project, aws_gce_zone) or whether we should treat these as "cloud_project" & "cloud_zone". If the latter, a secondary question is whether we should rename the flags.

Edit: I don't much care either way. I'm guessing we'll end up with duplicating (i.e. aws_zone)

Copy link
Contributor

Choose a reason for hiding this comment

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

You can only have one cloud provider at a time, right? Perhaps this is a good place for generic cloud patterns, so long as it's not planned to allow a cluster span infrastructure providers... If that's the case, that's probably an easy small PR instead of adding more to this one.

Copy link
Member

Choose a reason for hiding this comment

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

As long as the concepts fundamentally match up, I'm in favor of generification.

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with not renaming in this PR, but please file a bug on this. We just need to figure out the ripple of renaming them.

@markturansky
Copy link
Contributor

LGTM for what I can review. You'll need @thockin for the rest.

@@ -189,6 +189,9 @@ type VolumeSource struct {
// GCEPersistentDisk represents a GCE Disk resource that is attached to a
// kubelet's host machine and then exposed to the pod.
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"gcePersistentDisk"`
// AWSElasticBlockStore represents an AWS EBS disk that is attached to a
// kubelet's host machine and then exposed to the pod.
AWSElasticBlockStore *AWSElasticBlockStoreVolumeSource `json:"awsElasticBlockStore"`
Copy link
Member

Choose a reason for hiding this comment

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

@bgrant0607 Are you OK with AWS support here to parallel GCE? It seems appropriate. We can EOL them both when persistent volumes are up to snuff.

@justinsb
Copy link
Member Author

Opened issue #6699 to track renaming the e2e cmd arguments.

thockin added a commit that referenced this pull request Apr 10, 2015
@thockin thockin merged commit 4a7b0ee into kubernetes:master Apr 10, 2015
@lavalamp
Copy link
Member

@thockin, @justinsb -- this definitely could have used a squash

@thockin
Copy link
Member

thockin commented Apr 10, 2015

Yeah, I messed up - meant to ask for it, forgot.

I wonder if there are tools that could help here?

On Fri, Apr 10, 2015 at 3:48 PM, Daniel Smith notifications@github.com
wrote:

@thockin https://github.com/thockin, @justinsb
https://github.com/justinsb -- this definitely could have used a squash


Reply to this email directly or view it on GitHub
#5138 (comment)
.

@justinsb
Copy link
Member Author

Sorry, I should definitely have squashed it once we were getting closer. But squashing also obliterates history. I have looked, and haven't found any great solution. Even with squashing, I still don't love the merge-commits that the button produces.

I hear code.google.com will soon be available. Let's build v2 (on gerrit this time!)

Or we could probably figure out a script that squashes the commits, changes the author and does a push.

@bgrant0607
Copy link
Member

Sorry for the late response. Github notifications are useless, since I get hundreds per day.

Fortunately, I'm ok with this. Next time, please ask someone to ping me not through github for an API change.

@delianides
Copy link

Is there going to be any documentation for this? How exactly does this work with availability zones? Should the volume exists in the same AZ as the master?

@tslater
Copy link

tslater commented Jun 4, 2015

I would love to see some documentation as well.

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

Successfully merging this pull request may close these issues.

None yet

10 participants