Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

[6.1.x] Add pod-subnet-size flag #788

Merged
merged 2 commits into from
Nov 5, 2020

Conversation

bernardjkim
Copy link
Contributor

Description

This PR adds a --pod-subnet-size flag to determine the size of the subnet allocated to each host. The default size is /24, the max value is /28, and it cannot be larger than the pod CIDR range itself. The pod subnet size can also be specified and read from the PLANET_POD_SUBNET_SIZE environment variable.

Linked tickets and PRs

tool/planet/cfg.go Outdated Show resolved Hide resolved
@@ -79,6 +79,8 @@ type Config struct {
ServiceCIDR kv.CIDR
// PodCIDR defines the kubernetes Pod subnet CIDR
PodCIDR kv.CIDR
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Somewhat unrelated but I faced the same issue with kv.CIDR and introduced a local flag that would expose the net.IPNet so you don't need to reparse it: https://github.com/gravitational/planet/blob/bernard/6.1.x/subnet-size/tool/planet/args.go#L28. This could save a couple of lines in verifyPodSubnetSize.

@bernardjkim bernardjkim merged commit 5407bb2 into version/6.1.x Nov 5, 2020
@bernardjkim bernardjkim deleted the bernard/6.1.x/subnet-size branch November 5, 2020 18:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants