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

[WIP] Add feature for CNI Custom Networking #786

Closed
wants to merge 3 commits into from

Conversation

tiffanyfay
Copy link
Contributor

@tiffanyfay tiffanyfay commented May 9, 2019

Description

WIP
https://docs.aws.amazon.com/eks/latest/userguide/cni-custom-network.html

Checklist

  • Code compiles correctly (i.e make build)
  • Added tests that cover your change (if possible)
  • All unit tests passing (i.e. make test)
  • All integration tests passing (i.e. make integration-test)
  • Added/modified documentation as required (such as the README.md, and examples directory)
  • Added yourself to the humans.txt file

@@ -10,9 +11,9 @@ import (
"github.com/weaveworks/eksctl/pkg/vpc"
)

func (c *ClusterResourceSet) addSubnets(refRT *gfn.Value, topology api.SubnetTopology, subnets map[string]api.Network) {
func (c *ClusterResourceSet) addSubnets(refRT *gfn.Value, topology api.SubnetTopology, subnets map[string]api.Network, kind string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function changed a bit (see #776), please rebase :)

for az, subnet := range subnets {
alias := string(topology) + strings.ToUpper(strings.Join(strings.Split(az, "-"), ""))
alias := string(kind) + string(topology) + strings.ToUpper(strings.Join(strings.Split(az, "-"), ""))
Copy link
Contributor

@errordeveloper errordeveloper May 13, 2019

Choose a reason for hiding this comment

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

We will have to maintain names of existing keys as they are, so please only add prefix for new subnets... That is because logical names inside the stack need to remain the same for our append-only stack update code to function as expected, but also in general that is essential in CloudFormation.

@@ -21,6 +23,8 @@ type (
// for additional CIDR associations, e.g. to use with separate CIDR for
// private subnets or any ad-hoc subnets
// +optional
PodSubnets map[string]*CustomSubnets `json:"podSubnets,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we could just add this as a new topology under ClusterSubnets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@errordeveloper As in PodSubnets under ClusterSubnets?

@@ -21,6 +23,8 @@ type (
// for additional CIDR associations, e.g. to use with separate CIDR for
Copy link
Contributor

Choose a reason for hiding this comment

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

this comment belongs to ExtraCIDRs... please replace it with a comment to say that it need to be deprecated.

@@ -114,3 +116,29 @@ func MustParseCIDR(s string) *IPNet {
}
return cidr
}

// SplitIntoN splits the parent IPNet into n subnets
func SplitIntoN(parent *net.IPNet, n int) ([]*net.IPNet, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to migrate to this and copy the unit tests from kops? (I think they had a few there).

Copy link
Contributor

Choose a reason for hiding this comment

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

But I'm not sure if needs to be SplitIntoN, SplitInto8 and SplitInto4 is all we really need. As it must be N^2 , and SplitInto2 would be of very little use, and I'm not sure of when SplitInto16 would be applicable...

Mask: net.CIDRMask(networkLength, 32),
})
} else {
return nil, fmt.Errorf("Unexpected IP address type: %s", parent)
Copy link
Contributor

Choose a reason for hiding this comment

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

the convention is that error string always begin with lower-case...

@errordeveloper
Copy link
Contributor

@tiffanyfay ping :)

@tiffanyfay
Copy link
Contributor Author

@errordeveloper Hey, have a big deadline for next Fri so going to be heads down on that and then will be back on this! I kept thinking I needed to message, but kept forgetting.

@lilley2412
Copy link

@tiffanyfay @errordeveloper is anyone still working on this? I have a need for it soon, if it's not being actively developed I'd like to work on a PR for it. I also think it would be good to have a feature issue outlining exactly how it will work, I don't mind writing that up as well.

@tiffanyfay
Copy link
Contributor Author

@lilley2412 Yeah, I'm going to be working on it next week. We can definitely discuss it!

@lilley2412
Copy link

@errordeveloper @tiffanyfay FYI, opened an issue to propose how the feature might work for discussion #1096

@martina-if
Copy link
Contributor

@tiffanyfay I am closing this due to lack of activity and because we don't have this in our short-term backlog but please feel free to reopen it if/when you'd like to keep working on it!

@martina-if martina-if closed this Jan 9, 2020
torredil pushed a commit to torredil/eksctl that referenced this pull request May 20, 2022
Prep for Windows support: Copy pkg/mounter and refactor to use k8s.io/mount-utils
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.

4 participants