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

Subnet division enhacement #4784

Closed
MaxFedotov opened this issue Feb 9, 2024 · 5 comments · Fixed by #4971
Closed

Subnet division enhacement #4784

MaxFedotov opened this issue Feb 9, 2024 · 5 comments · Fixed by #4971
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-priority triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@MaxFedotov
Copy link
Contributor

/kind feature

Describe the solution you'd like
By default, Cluster API AWS organizes subnets so that most of the VPC address space goes to private subnets. While this is true for most classic Kubernetes deployments, that may not work in some specific cases.

We in Wargaming use Kuberentes to schedule arenas with gameservers using google agones. These arenas requires to be run on a node with a public IP address using hostPort. As pods with arenas are the main cluster workload, we need to dedicate most of VPC address space to the public subnets, instead of private.

In order to support this requirement, I would like to propose an additional configuration parameter in AWSCluster.spec.network.vpc - SubnetSchema with the following enum values:

  • PreferPrivate - will be the default value and will implement the current logic
  • PreferPublic - will have the reverse logic, where most of the VPC address space will be dedicated to public subnets
  • Equal - will divide VPC address space equally between public and private subnets
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 9, 2024
@richardcase
Copy link
Member

This seems reasonable to me. I'd favor the simplest solution to meet this (i.e. the same percentages but flipped).

I think anything more complex (like changing percentages) should be left for the network re-work (i.e. networking v2) in #1484.

@MaxFedotov
Copy link
Contributor Author

I love the idea of percentages, but the exact realization seems very complicated to me due to the following conditions:

  • The number of subnets primarily depends on the amount of AZ, which the user can specify
  • The address space for each subnet depends on the VPC CIDR block.
  • All subnets in public\private address space should have the same size

So if a user specifies something like "I want 37% of my address space to be allocated to public subnets and I also want to have them spread in 3 AZ", it will be impossible to split them correctly using the provided percentage without performing some round-up or other approximations.

@richardcase
Copy link
Member

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 20, 2024
@dlipovetsky
Copy link
Contributor

Subnets are divided into public and private here.

I'm ok with a simple API that supports two choices (mostly public, or mostly private), but I think we need to clearly document that, for any other choices, users must define their own subnets (although #1484 could change that).

@MaxFedotov
Copy link
Contributor Author

MaxFedotov commented Feb 21, 2024

Ok, let's then start with two options: PreferPrivate (the current one and which will be selected by default if nothing is specified) and PreferPublic

krasoffski added a commit to krasoffski/cluster-api-provider-aws that referenced this issue May 7, 2024
krasoffski added a commit to krasoffski/cluster-api-provider-aws that referenced this issue May 7, 2024
krasoffski added a commit to krasoffski/cluster-api-provider-aws that referenced this issue May 7, 2024
krasoffski added a commit to krasoffski/cluster-api-provider-aws that referenced this issue Jun 20, 2024
krasoffski added a commit to krasoffski/cluster-api-provider-aws that referenced this issue Jul 17, 2024
krasoffski added a commit to krasoffski/cluster-api-provider-aws that referenced this issue Jul 18, 2024
fad3t pushed a commit to fad3t/cluster-api-provider-aws that referenced this issue Jul 25, 2024
nrb pushed a commit to nrb/cluster-api-provider-aws that referenced this issue Sep 20, 2024
fad3t pushed a commit to fad3t/cluster-api-provider-aws that referenced this issue Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-priority triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants