allocator

package
v0.0.0-...-c4e93b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPAllocator

type IPAllocator struct {
	// contains filtered or unexported fields
}

IPAllocator allocates IP addresses from IPPools in etcd

func NewIPAllocator

func NewIPAllocator(etcdClient *clientv3.Client) *IPAllocator

NewIPAllocator returns a new IPAllocator from the given etcd client

func (*IPAllocator) AllocateIP

func (alloc *IPAllocator) AllocateIP(fixed bool, nameSpace, serviceIPPoolName, podName, stsName string) (*current.IPConfig, *types.NSIPPool, error)

AllocateIP returns an IP address and its nsIPPool if success.

func (*IPAllocator) Release

func (alloc *IPAllocator) Release(nameSpace, podName string, releaseFixed bool) error

Release remove an IP usage record from etcd if not fixed, for fixed IP, Release tags the IP with "delete" flag

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL