mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
phase 2: ipam filter secondary service cidr
This commit is contained in:
@@ -53,10 +53,11 @@ const (
|
||||
type Controller struct {
|
||||
allocatorType ipam.CIDRAllocatorType
|
||||
|
||||
cloud cloudprovider.Interface
|
||||
clusterCIDRs []*net.IPNet
|
||||
serviceCIDR *net.IPNet
|
||||
kubeClient clientset.Interface
|
||||
cloud cloudprovider.Interface
|
||||
clusterCIDRs []*net.IPNet
|
||||
serviceCIDR *net.IPNet
|
||||
secondaryServiceCIDR *net.IPNet
|
||||
kubeClient clientset.Interface
|
||||
// Method for easy mocking in unittest.
|
||||
lookupIP func(host string) ([]net.IP, error)
|
||||
|
||||
@@ -79,6 +80,7 @@ func NewNodeIpamController(
|
||||
kubeClient clientset.Interface,
|
||||
clusterCIDRs []*net.IPNet,
|
||||
serviceCIDR *net.IPNet,
|
||||
secondaryServiceCIDR *net.IPNet,
|
||||
nodeCIDRMaskSize int,
|
||||
allocatorType ipam.CIDRAllocatorType) (*Controller, error) {
|
||||
|
||||
@@ -119,12 +121,13 @@ func NewNodeIpamController(
|
||||
}
|
||||
|
||||
ic := &Controller{
|
||||
cloud: cloud,
|
||||
kubeClient: kubeClient,
|
||||
lookupIP: net.LookupIP,
|
||||
clusterCIDRs: clusterCIDRs,
|
||||
serviceCIDR: serviceCIDR,
|
||||
allocatorType: allocatorType,
|
||||
cloud: cloud,
|
||||
kubeClient: kubeClient,
|
||||
lookupIP: net.LookupIP,
|
||||
clusterCIDRs: clusterCIDRs,
|
||||
serviceCIDR: serviceCIDR,
|
||||
secondaryServiceCIDR: secondaryServiceCIDR,
|
||||
allocatorType: allocatorType,
|
||||
}
|
||||
|
||||
// TODO: Abstract this check into a generic controller manager should run method.
|
||||
@@ -132,7 +135,7 @@ func NewNodeIpamController(
|
||||
startLegacyIPAM(ic, nodeInformer, cloud, kubeClient, clusterCIDRs, serviceCIDR, nodeCIDRMaskSize)
|
||||
} else {
|
||||
var err error
|
||||
ic.cidrAllocator, err = ipam.New(kubeClient, cloud, nodeInformer, ic.allocatorType, clusterCIDRs, ic.serviceCIDR, nodeCIDRMaskSize)
|
||||
ic.cidrAllocator, err = ipam.New(kubeClient, cloud, nodeInformer, ic.allocatorType, clusterCIDRs, ic.serviceCIDR, ic.secondaryServiceCIDR, nodeCIDRMaskSize)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user