Documentation ¶
Index ¶
- Constants
- func ElectENIIPv6PrimaryIP(newObj *ccev2.ENI)
- func EnsureSubnet(vpcID, sbnID string) (*ccev1.Subnet, error)
- func GlobalBSM() *bsm
- func InitBSM() error
- func SearchSubnetID(vpcID, defaultSbnID, privateIPStr string) string
- type BorrowedSubnet
- type IPBorrowTask
- type SyncManager
- type VPCENISyncerRouter
- func (es *VPCENISyncerRouter) Create(resource *ccev2.ENI) error
- func (es *VPCENISyncerRouter) Delete(name string) error
- func (es *VPCENISyncerRouter) Init(ctx context.Context) error
- func (es *VPCENISyncerRouter) ResyncENI(ctx context.Context) time.Duration
- func (es *VPCENISyncerRouter) StartENISyncer(ctx context.Context, updater syncer.ENIUpdater) syncer.ENIEventHandler
- func (es *VPCENISyncerRouter) Update(resource *ccev2.ENI) error
- type VPCSubnetSyncher
- func (ss VPCSubnetSyncher) Create(resource *ccev1.Subnet) error
- func (ss VPCSubnetSyncher) Delete(name string) error
- func (ss *VPCSubnetSyncher) Init(ctx context.Context) error
- func (ss VPCSubnetSyncher) ResyncSubnet(context.Context) time.Duration
- func (ss VPCSubnetSyncher) StartSubnetSyncher(ctx context.Context, updater syncer.SubnetUpdater) syncer.SubnetEventHandler
- func (ss VPCSubnetSyncher) Update(resource *ccev1.Subnet) error
Constants ¶
View Source
const ( IPKindAvailable = "available" IPKindBorrowed = "borrowed" IPKindBorrowedAvail = "borrowed_avail" IPKindCount = "count" IPKindUsed = "used" EniTypeSubnet = "subnet" )
View Source
const ( ENIReadyTimeToAttach = 1 * time.Second ENIMaxCreateDuration = 5 * time.Minute FinalizerENI = "eni-syncer" )
Variables ¶
This section is empty.
Functions ¶
func ElectENIIPv6PrimaryIP ¶
ElectENIIPv6PrimaryIP elect a ipv6 primary ip for eni set primary ip for IPv6 if not set by default, all IPv6 IPs are secondary IPs
func SearchSubnetID ¶
Search the subnet ID of the IP address
Types ¶
type BorrowedSubnet ¶
type BorrowedSubnet struct { *ccev1.Subnet SubnetId string `json:"subnet_id"` BorrowedIPsCount int `json:"borrowed_ips_count"` BorrowedAvailableIPsCount int `json:"borrowed_available_ips_count"` // contains filtered or unexported fields }
func NewBorrowedSubnet ¶
func NewBorrowedSubnet(subnet *ccev1.Subnet) *BorrowedSubnet
func (*BorrowedSubnet) Borrow ¶
func (bs *BorrowedSubnet) Borrow(eniID string, ipNum int) (borrowedIPNum int)
func (*BorrowedSubnet) CanBorrow ¶
func (bs *BorrowedSubnet) CanBorrow(ipNum int) bool
func (*BorrowedSubnet) Cancel ¶
func (bs *BorrowedSubnet) Cancel(eniID string)
func (*BorrowedSubnet) Done ¶
func (bs *BorrowedSubnet) Done(eniID string, ipNum int)
func (*BorrowedSubnet) GetBorrowedIPNum ¶
func (bs *BorrowedSubnet) GetBorrowedIPNum(eniID string) int
type IPBorrowTask ¶
type SyncManager ¶
type SyncManager[T eni.Eni | vpc.RouteRule | vpc.Subnet | ccev2alpha1.SecurityGroupSpec] struct { sync.Mutex Name string // contains filtered or unexported fields }
SyncManager synchronize data between k8s and VPC, run in operator
func NewSyncManager ¶
func NewSyncManager[T eni.Eni | vpc.RouteRule | vpc.Subnet | ccev2alpha1.SecurityGroupSpec](name string, resyncPeriod time.Duration, resync func(ctx context.Context) ([]T, error)) *SyncManager[T]
func (*SyncManager[T]) AddItems ¶
func (s *SyncManager[T]) AddItems(dataList []T)
func (*SyncManager[T]) Get ¶
func (s *SyncManager[T]) Get(key string) *T
func (*SyncManager[T]) Run ¶
func (s *SyncManager[T]) Run()
func (*SyncManager[T]) RunImmediately ¶
func (s *SyncManager[T]) RunImmediately()
type VPCENISyncerRouter ¶
type VPCENISyncerRouter struct {
// contains filtered or unexported fields
}
VPCENISyncerRouter only work with single vpc cluster
func (*VPCENISyncerRouter) Create ¶
func (es *VPCENISyncerRouter) Create(resource *ccev2.ENI) error
Create implements syncer.ENIEventHandler
func (*VPCENISyncerRouter) Delete ¶
func (es *VPCENISyncerRouter) Delete(name string) error
Delete implements syncer.ENIEventHandler
func (*VPCENISyncerRouter) Init ¶
func (es *VPCENISyncerRouter) Init(ctx context.Context) error
NewVPCENISyncer create a new VPCENISyncer
func (*VPCENISyncerRouter) ResyncENI ¶
func (es *VPCENISyncerRouter) ResyncENI(ctx context.Context) time.Duration
ResyncENI implements syncer.ENIEventHandler
func (*VPCENISyncerRouter) StartENISyncer ¶
func (es *VPCENISyncerRouter) StartENISyncer(ctx context.Context, updater syncer.ENIUpdater) syncer.ENIEventHandler
StartENISyncer implements syncer.ENISyncher
type VPCSubnetSyncher ¶
type VPCSubnetSyncher struct {
// contains filtered or unexported fields
}
func (VPCSubnetSyncher) Create ¶
Create Process synchronization of new subnets For a new subnet, we should generally query the details of the subnet directly and synchronously
func (VPCSubnetSyncher) ResyncSubnet ¶
func (VPCSubnetSyncher) StartSubnetSyncher ¶
func (ss VPCSubnetSyncher) StartSubnetSyncher(ctx context.Context, updater syncer.SubnetUpdater) syncer.SubnetEventHandler
Source Files ¶
Click to show internal directories.
Click to hide internal directories.