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
AWS EBS volume support #5138
Conversation
AWS code is mostly here: bd9021e |
// kubelet's host machine and then exposed to the pod. | ||
GCEPersistentDisk *GCEPersistentDiskVolumeSource `json:"persistentDisk"` | ||
CloudPersistentDisk *CloudPersistentDiskVolumeSource `json:"persistentDisk"` |
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.
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.
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.
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.
@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
cc @swagiaal |
30c81c4
to
18a1d11
Compare
Is this PR active? If not please close it according to https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/devel/pull-requests.md |
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. |
@justinsb I can work on this if you are too busy with other PRs. It was on my radar before you posted this. |
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. |
@justinsb Sounds good :) |
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"` |
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.
Would AWSElasticBlockStore be more accurately named?
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.
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...
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.
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.
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.
OK, I'll change it. Avoiding another rebase is more important to me than nomenclature :-)
Also see fuzzer.go for testing the new volume: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/api/testing/fuzzer.go#L176 |
Added fuzzer, rebased to avoid conflicts with iSCSI |
0557a5b
to
60dfbc6
Compare
Now with passing e2e tests also! In particular:
|
if context.Provider == "aws" { | ||
awsConfig := "[Global]\n" | ||
if cloudConfig.Zone == "" { | ||
glog.Error("gce_zone must be specified for AWS") |
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.
is "gce_zone" correct here?
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 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)
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.
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.
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.
As long as the concepts fundamentally match up, I'm in favor of generification.
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.
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.
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"` |
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.
@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.
Per comments from @markturansky - thanks!
Opened issue #6699 to track renaming the e2e cmd arguments. |
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
|
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. |
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. |
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? |
I would love to see some documentation as well. |
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.