pod

package
v0.0.0-...-bdf4f4e Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PodAnnotationAllocator

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

PodAnnotationAllocator is a utility to handle allocation of the PodAnnotation to Pods.

func NewPodAnnotationAllocator

func NewPodAnnotationAllocator(
	netInfo util.NetInfo,
	podLister listers.PodLister,
	kube kube.InterfaceOVN,
	claimsReconciler persistentips.PersistentAllocations,
) *PodAnnotationAllocator

func (*PodAnnotationAllocator) AllocatePodAnnotation

func (allocator *PodAnnotationAllocator) AllocatePodAnnotation(
	ipAllocator subnet.NamedAllocator,
	pod *v1.Pod,
	network *nadapi.NetworkSelectionElement,
	reallocateIP bool,
	networkRole string) (
	*v1.Pod,
	*util.PodAnnotation,
	error)

AllocatePodAnnotation allocates the PodAnnotation which includes IPs, a mac address, routes and gateways. Returns the allocated pod annotation and the updated pod. Returns a nil pod and the existing PodAnnotation if no updates are warranted to the pod.

The allocation can be requested through the network selection element or derived from the allocator provided IPs. If the requested IPs cannot be honored, a new set of IPs will be allocated unless reallocateIP is set to false.

func (*PodAnnotationAllocator) AllocatePodAnnotationWithTunnelID

func (allocator *PodAnnotationAllocator) AllocatePodAnnotationWithTunnelID(
	ipAllocator subnet.NamedAllocator,
	idAllocator id.NamedAllocator,
	pod *v1.Pod,
	network *nadapi.NetworkSelectionElement,
	reallocateIP bool,
	networkRole string) (
	*v1.Pod,
	*util.PodAnnotation,
	error)

AllocatePodAnnotationWithTunnelID allocates the PodAnnotation which includes IPs, a mac address, routes, gateways and a tunnel ID. Returns the allocated pod annotation and the updated pod. Returns a nil pod and the existing PodAnnotation if no updates are warranted to the pod.

The allocation can be requested through the network selection element or derived from the allocator provided IPs. If the requested IPs cannot be honored, a new set of IPs will be allocated unless reallocateIP is set to false.

Jump to

Keyboard shortcuts

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