Skip to content

Commit

Permalink
Merge pull request kubernetes#85494 from yutedz/node-cidr-mask
Browse files Browse the repository at this point in the history
Fill in default node cidr mask size when dual stack is not enabled
  • Loading branch information
k8s-ci-robot committed Nov 21, 2019
2 parents 9767125 + 5be960c commit 3c5dad6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/kubeadm/app/phases/controlplane/manifests.go
Expand Up @@ -315,11 +315,8 @@ func getControllerManagerCommand(cfg *kubeadmapi.ClusterConfiguration) []string
// Let the controller-manager allocate Node CIDRs for the Pod network.
// Each node will get a subspace of the address CIDR provided with --pod-network-cidr.
if cfg.Networking.PodSubnet != "" {
// TODO(Arvinderpal): Needs to be fixed once PR #73977 lands. Should be a list of maskSizes.
maskSize := calcNodeCidrSize(cfg.Networking.PodSubnet)
defaultArguments["allocate-node-cidrs"] = "true"
defaultArguments["cluster-cidr"] = cfg.Networking.PodSubnet
defaultArguments["node-cidr-mask-size"] = maskSize
if cfg.Networking.ServiceSubnet != "" {
defaultArguments["service-cluster-ip-range"] = cfg.Networking.ServiceSubnet
}
Expand All @@ -329,6 +326,10 @@ func getControllerManagerCommand(cfg *kubeadmapi.ClusterConfiguration) []string
// Note: The user still retains the ability to explicitly set feature-gates and that value will overwrite this base value.
if enabled, present := cfg.FeatureGates[features.IPv6DualStack]; present {
defaultArguments["feature-gates"] = fmt.Sprintf("%s=%t", features.IPv6DualStack, enabled)
} else if cfg.Networking.PodSubnet != "" {
// TODO(Arvinderpal): Needs to be fixed once PR #73977 lands. Should be a list of maskSizes.
maskSize := calcNodeCidrSize(cfg.Networking.PodSubnet)
defaultArguments["node-cidr-mask-size"] = maskSize
}

command := []string{"kube-controller-manager"}
Expand Down

0 comments on commit 3c5dad6

Please sign in to comment.