mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Fill in default node cidr mask size when dual stack is not enabled
This commit is contained in:
parent
c97baa339b
commit
5be960c34d
@ -315,11 +315,8 @@ func getControllerManagerCommand(cfg *kubeadmapi.ClusterConfiguration) []string
|
|||||||
// Let the controller-manager allocate Node CIDRs for the Pod network.
|
// 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.
|
// Each node will get a subspace of the address CIDR provided with --pod-network-cidr.
|
||||||
if cfg.Networking.PodSubnet != "" {
|
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["allocate-node-cidrs"] = "true"
|
||||||
defaultArguments["cluster-cidr"] = cfg.Networking.PodSubnet
|
defaultArguments["cluster-cidr"] = cfg.Networking.PodSubnet
|
||||||
defaultArguments["node-cidr-mask-size"] = maskSize
|
|
||||||
if cfg.Networking.ServiceSubnet != "" {
|
if cfg.Networking.ServiceSubnet != "" {
|
||||||
defaultArguments["service-cluster-ip-range"] = cfg.Networking.ServiceSubnet
|
defaultArguments["service-cluster-ip-range"] = cfg.Networking.ServiceSubnet
|
||||||
}
|
}
|
||||||
@ -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.
|
// 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 {
|
if enabled, present := cfg.FeatureGates[features.IPv6DualStack]; present {
|
||||||
defaultArguments["feature-gates"] = fmt.Sprintf("%s=%t", features.IPv6DualStack, enabled)
|
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"}
|
command := []string{"kube-controller-manager"}
|
||||||
|
Loading…
Reference in New Issue
Block a user