You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnipv4Mask, ipv6Mask, errors.New("usage of --node-cidr-mask-size-ipv4 and --node-cidr-mask-size-ipv6 are not allowed with non dual-stack clusters")
597
+
}
598
+
ifcfg.NodeCIDRMaskSize!=0 {
599
+
ipv4Mask=int(cfg.NodeCIDRMaskSize)
600
+
ipv6Mask=int(cfg.NodeCIDRMaskSize)
601
+
}
602
+
returnipv4Mask, ipv6Mask, nil
603
+
}
604
+
605
+
// setNodeCIDRMaskSizesDualStack returns the IPv4 and IPv6 node cidr mask sizes to the value provided
606
+
// for --node-cidr-mask-size-ipv4 and --node-cidr-mask-size-ipv6 respectively. If value not provided,
607
+
// then it will return default IPv4 and IPv6 cidr mask sizes.
Copy file name to clipboardExpand all lines: cmd/kube-controller-manager/app/options/nodeipamcontroller.go
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,9 @@ func (o *NodeIPAMControllerOptions) AddFlags(fs *pflag.FlagSet) {
36
36
return
37
37
}
38
38
fs.StringVar(&o.ServiceCIDR, "service-cluster-ip-range", o.ServiceCIDR, "CIDR Range for Services in cluster. Requires --allocate-node-cidrs to be true")
39
-
fs.Int32Var(&o.NodeCIDRMaskSize, "node-cidr-mask-size", o.NodeCIDRMaskSize, "Mask size for node cidr in cluster.")
39
+
fs.Int32Var(&o.NodeCIDRMaskSize, "node-cidr-mask-size", o.NodeCIDRMaskSize, "Mask size for node cidr in cluster. Default is 24 for IPv4 and 64 for IPv6.")
40
+
fs.Int32Var(&o.NodeCIDRMaskSizeIPv4, "node-cidr-mask-size-ipv4", o.NodeCIDRMaskSizeIPv4, "Mask size for IPv4 node cidr in dual-stack cluster. Default is 24.")
41
+
fs.Int32Var(&o.NodeCIDRMaskSizeIPv6, "node-cidr-mask-size-ipv6", o.NodeCIDRMaskSizeIPv6, "Mask size for IPv6 node cidr in dual-stack cluster. Default is 64.")
40
42
}
41
43
42
44
// ApplyTo fills up NodeIpamController config with options.
Copy file name to clipboardExpand all lines: pkg/controller/nodeipam/config/types.go
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,10 @@ type NodeIPAMControllerConfiguration struct {
22
22
ServiceCIDRstring
23
23
// secondaryServiceCIDR is CIDR Range for Services in cluster. This is used in dual stack clusters. SecondaryServiceCIDR must be of different IP family than ServiceCIDR
24
24
SecondaryServiceCIDRstring
25
-
// NodeCIDRMaskSize is the mask size for node cidr in cluster.
25
+
// NodeCIDRMaskSize is the mask size for node cidr in single-stack cluster.
26
26
NodeCIDRMaskSizeint32
27
+
// NodeCIDRMaskSizeIPv4 is the mask size for node cidr in dual-stack cluster.
28
+
NodeCIDRMaskSizeIPv4int32
29
+
// NodeCIDRMaskSizeIPv6 is the mask size for node cidr in dual-stack cluster.
0 commit comments