pool_manager

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RangeStartEnv              = "RANGE_START"
	RangeEndEnv                = "RANGE_END"
	RuntimeObjectFinalizerName = "k8s.v1.cni.cncf.io/kubeMacPool"
)

Variables

This section is empty.

Functions

func GetMacPoolSize added in v0.15.0

func GetMacPoolSize(rangeStart, rangeEnd net.HardwareAddr) (int64, error)

Types

type AllocationStatus

type AllocationStatus string
const (
	AllocationStatusAllocated     AllocationStatus = "Allocated"
	AllocationStatusWaitingForPod AllocationStatus = "WaitingForPod"
)

type PoolManager

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

func NewPoolManager

func NewPoolManager(kubeClient kubernetes.Interface, rangeStart, rangeEnd net.HardwareAddr, managerNamespace string, kubevirtExist bool, waitTime int) (*PoolManager, error)

func (*PoolManager) AddMacToWaitingConfig added in v0.5.0

func (p *PoolManager) AddMacToWaitingConfig(allocations map[string]string) error

Add all the allocated mac addresses to the waiting config map with the current time.

func (*PoolManager) AllocatePodMac

func (p *PoolManager) AllocatePodMac(pod *corev1.Pod) error

func (*PoolManager) AllocateVirtualMachineMac

func (p *PoolManager) AllocateVirtualMachineMac(virtualMachine *kubevirt.VirtualMachine) error

func (*PoolManager) InitMaps

func (p *PoolManager) InitMaps() error

func (*PoolManager) IsKubevirtEnabled

func (p *PoolManager) IsKubevirtEnabled() bool

func (*PoolManager) IsPodInstanceOptedIn added in v0.8.4

func (p *PoolManager) IsPodInstanceOptedIn(namespaceName string) (bool, error)

Checks if the namespace of a pod instance is opted in for kubemacpool

func (*PoolManager) IsVmInstanceOptedIn added in v0.8.4

func (p *PoolManager) IsVmInstanceOptedIn(namespaceName string) (bool, error)

Checks if the namespace of a vm instance is opted in for kubemacpool

func (*PoolManager) MarkVMAsReady added in v0.5.0

func (p *PoolManager) MarkVMAsReady(vm *kubevirt.VirtualMachine, parentLogger logr.Logger) error

Remove all the mac addresses from the waiting configmap this mean the vm was saved in the etcd and pass validations

func (*PoolManager) ReleasePodMac

func (p *PoolManager) ReleasePodMac(podName string) error

func (*PoolManager) ReleaseVirtualMachineMac

func (p *PoolManager) ReleaseVirtualMachineMac(vm *kubevirt.VirtualMachine, parentLogger logr.Logger) error

func (*PoolManager) Start added in v0.14.3

func (p *PoolManager) Start() error

func (*PoolManager) UpdateMacAddressesForVirtualMachine added in v0.5.0

func (p *PoolManager) UpdateMacAddressesForVirtualMachine(previousVirtualMachine, virtualMachine *kubevirt.VirtualMachine) error

Jump to

Keyboard shortcuts

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