-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add --vpc-cidr
flag
#286
Add --vpc-cidr
flag
#286
Conversation
36a239e
to
2253e41
Compare
2253e41
to
97e03eb
Compare
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.
LGTM! some small typos to fix.
pkg/eks/api/vpc.go
Outdated
Network // global CIRD and VPC ID | ||
SecurityGroup string // cluster SG | ||
// subnets are either public or private for use with separate nodegroups | ||
// these are keyed by AZ for conveninece |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/api/vpc.go
Outdated
) | ||
|
||
const ( | ||
// SubnetTopologyPrivate repesents privately-routed subnets |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/api/vpc.go
Outdated
const ( | ||
// SubnetTopologyPrivate repesents privately-routed subnets | ||
SubnetTopologyPrivate SubnetTopology = "Private" | ||
// SubnetTopologyPublic repesents publicly-routed subnets |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/api/vpc.go
Outdated
} | ||
} | ||
|
||
// HasSufficientPublicSubnets validates if there is a suffiecent |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/api/vpc.go
Outdated
return len(c.SubnetIDs(SubnetTopologyPublic)) >= 3 | ||
} | ||
|
||
// HasSufficientPrivateSubnets validates if there is a suffiecent |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/vpc.go
Outdated
|
||
zonesTotal := len(c.Spec.AvailabilityZones) | ||
if 2*zonesTotal > len(zoneCIDRs) { | ||
return fmt.Errorf("insuffience number of subnets (have %d, but need %d) for %d availability zones", len(zoneCIDRs), 2*zonesTotal, zonesTotal) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
97e03eb
to
5590886
Compare
I'm running a manual test and an integration test at the moment, will merge if all goes well. |
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.
Looks much more clean compared to before, just found some typos in the comments
pkg/eks/api/vpc.go
Outdated
type ( | ||
// ClusterVPC holds global subnet and all child public/private subnet | ||
ClusterVPC struct { | ||
Network // global CIRD and VPC ID |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/api/vpc.go
Outdated
// subnets are either public or private for use with separate nodegroups | ||
// these are keyed by AZ for convenience | ||
Subnets map[SubnetTopology]map[string]Network | ||
// for additional CIRD associations, e.g. to use with separate CIDR for |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/api/vpc.go
Outdated
} | ||
|
||
// HasSufficientPublicSubnets validates if there is a sufficient | ||
// number of subnets available to create a cluster |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
pkg/eks/api/vpc.go
Outdated
} | ||
|
||
// HasSufficientPrivateSubnets validates if there is a sufficient | ||
// number of subnets available to create a cluster |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
5590886
to
0b5c3d1
Compare
@stefanprodan @gruebel thanks for looking over this! I've added some basic validation of prefix length, as it turned you cannot used anything you like, AWS VPC only allows |
3fe1471
to
de0e82c
Compare
- validate given CIDR prefix for VPC requirement - automate splitting of subnets - create private subnets as well as public - ensure DNS IP gets set correctly when any 10.0.0.0/8 subnet is used
de0e82c
to
9a9ccfc
Compare
Implementing ListSnapshots
Description
User-visible feature:
--vpc-cidr
flag.In terms of code, this follows up on #283, and it does two main things:
And a little more refactoring, as most of #283 was theoretical - so here come few practical tweaks.
Fork of kops is temporary, until kubernetes/kops#6004 lands.
Checklist
make build
)make test
)Added/modified documentation as required (such as the README)(will update separately along with other doc updates)