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

Refactor Routes, and dynamically configure minion CIDRs on AWS #9720

Merged
merged 3 commits into from Jun 19, 2015

Conversation

justinsb
Copy link
Member

WIP (edit: no longer, depended on 9728, now merged) but would greatly appreciate comments on the refactoring of the Routes interface (the first commit). We assumed that routes have settable names, but that isn't the case everywhere. I think the code is cleaner for the refactor.

@k8s-bot
Copy link

k8s-bot commented Jun 12, 2015

GCE e2e build/test failed for commit 86d492a3cc6bdb1994a583936f154db33c562203.

@roberthbailey
Copy link
Contributor

@cjcullen FYI

}
}(route.Name)
}(&routeCopy)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need the routeCopy here for the go func. You could pass route directly to the function because the value of the pointer is captured right then (even though the pointer is reused).

@ArtfulCoder ArtfulCoder added sig/network Categorizes an issue or PR as relevant to SIG Network. team/cluster labels Jun 12, 2015
@cjcullen
Copy link
Member

I like the general direction. I had to read up on how AWS does routes, but I think this is a reasonable way to make this work for both GCE and AWS.

@k8s-bot
Copy link

k8s-bot commented Jun 12, 2015

GCE e2e build/test failed for commit f45a5eea2c811da8027b3db68c9657e02ba5eee2.

@k8s-bot
Copy link

k8s-bot commented Jun 12, 2015

GCE e2e build/test passed for commit 37dc2e0e6f138c79ead261de8e34ac5f46b014de.

@k8s-bot
Copy link

k8s-bot commented Jun 12, 2015

GCE e2e build/test failed for commit ef2a78bc327b4eda914d8852d3e2dbbf3a93421c.

@justinsb
Copy link
Member Author

Thanks @cjcullen - I removed the unnecessary copy.

This is now working (slightly to my surprise - I expected a lot more issues!) I had to add the final commit which I also submitted separately as #9745 (should be a trivial rebase if it is even considered a conflict), and fix a few mistakes I made originally, but I'm removing the WIP designation.

@justinsb justinsb changed the title WIP: Dynamically configure minion CIDRs Refactor Routes, and dynamically configure minion CIDRs on AWS Jun 13, 2015
@justinsb
Copy link
Member Author

Oh - doh! This depends on #9728! Changing subject to reflect that.

@justinsb justinsb changed the title Refactor Routes, and dynamically configure minion CIDRs on AWS [Depends on #9728] Refactor Routes, and dynamically configure minion CIDRs on AWS Jun 13, 2015
@@ -30,8 +30,8 @@ function detect-minion-image (){

function generate-minion-user-data() {
i=$1
# TODO(bakins): Is this actually used?
Copy link
Member Author

Choose a reason for hiding this comment

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

@bakins I can't see anywhere MINION_PRIVATE_IP is used? Is there somewhere I'm missing?

Also, heads up on this patch. Shouldn't affect CoreOS, but you never know! My plan is to finish the stream on AWS/Ubuntu and then fix what I've broken on AWS/CoreOS!

What I'm working towards here is putting all the minions in an AWS auto-scaling group (like GCE does)

Copy link

Choose a reason for hiding this comment

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

I do not see it being used anywhere. I guess I didn't when I wrote it either, so not sure why I even have it there.

@k8s-bot
Copy link

k8s-bot commented Jun 17, 2015

GCE e2e build/test passed for commit e84a7d3.

@justinsb justinsb changed the title [Depends on #9728] Refactor Routes, and dynamically configure minion CIDRs on AWS Refactor Routes, and dynamically configure minion CIDRs on AWS Jun 18, 2015
We need to implement the Routes interface, and then enable the functionality in the cluster scripts.
@justinsb
Copy link
Member Author

Dependencies have now merged, so I rebased to so we can get a test of the latest code version.

@k8s-bot
Copy link

k8s-bot commented Jun 18, 2015

GCE e2e build/test passed for commit a4e15cd.

@cjcullen
Copy link
Member

Is this one and #9940 now the same thing?

@justinsb
Copy link
Member Author

@cjcullen - yes, I will close #9940 - thanks!

"github.com/aws/aws-sdk-go/service/ec2"
)

func (s *AWSCloud) findRouteTable(clusterName string) (*ec2.RouteTable, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Copying over my nit from the other PR:
You could avoid the empty declarations and just have:

filters := []*ec2.Filter{newEc2Filter("tag:"+TagNameKubernetesCluster, clusterName))}
request := &ec2.DescribeRouteTablesInput{ Filters: s.addFilters(filters) }

@cjcullen
Copy link
Member

LGTM. I like it conceptually. It appears to keep GCE functionality unchanged.

As we move more of this logic from individual controllers to inside the cloudprovider package we lose test coverage. But making our cloudproviders more testable is well beyond the scope of this PR :).

@cjcullen cjcullen added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 18, 2015
@satnam6502
Copy link
Contributor

Is this ready for merge or does it still depend on other changes?

@justinsb
Copy link
Member Author

@cjcullen: Applied the code cleanup - thanks!

@satnam6502: Ready for merge (no other dependencies) :-) (once 0ad16a1 passes testing)

satnam6502 added a commit that referenced this pull request Jun 19, 2015
Refactor Routes, and dynamically configure minion CIDRs on AWS
@satnam6502 satnam6502 merged commit 9f32599 into kubernetes:master Jun 19, 2015
@k8s-bot
Copy link

k8s-bot commented Jun 19, 2015

GCE e2e build/test passed for commit 0ad16a1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants