ipam

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AntreaIPAMAnnotationKey       = "ipam.antrea.io/ippools"
	AntreaIPAMAnnotationDelimiter = ","
)
View Source
const (
	AntreaIPAMType = "antrea-ipam"
)

Variables

This section is empty.

Functions

func ExecIPAMAdd

func ExecIPAMAdd(cniArgs *cnipb.CniCmdArgs, k8sArgs *argtypes.K8sArgs, ipamType string, resultKey string) (*current.Result, error)

func ExecIPAMCheck

func ExecIPAMCheck(cniArgs *cnipb.CniCmdArgs, k8sArgs *argtypes.K8sArgs, ipamType string) error

func ExecIPAMDelete

func ExecIPAMDelete(cniArgs *cnipb.CniCmdArgs, k8sArgs *argtypes.K8sArgs, ipamType string, resultKey string) error

func GetIPFromCache

func GetIPFromCache(resultKey string) (*current.Result, bool)

func IsIPAMTypeValid

func IsIPAMTypeValid(ipamType string) bool

func RegisterIPAMDriver

func RegisterIPAMDriver(ipamType string, ipamDriver IPAMDriver) error

Types

type AntreaIPAM added in v1.4.0

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

Antrea IPAM driver would allocate IP addresses according to object IPAM annotation, if present. If annotation is not present, the driver will delegate functionality to traditional IPAM driver.

func (*AntreaIPAM) Add added in v1.4.0

func (d *AntreaIPAM) Add(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, *current.Result, error)

Add allocates next available IP address from associated IP Pool Allocated IP and associated resource are stored in IP Pool status

func (*AntreaIPAM) Check added in v1.4.0

func (d *AntreaIPAM) Check(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, error)

Check verifues IP associated with resource is tracked in IP Pool status

func (*AntreaIPAM) Del added in v1.4.0

func (d *AntreaIPAM) Del(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, error)

Del deletes IP associated with resource from IP Pool status

type AntreaIPAMController added in v1.4.0

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

Antrea IPAM Controller maintains map of namespace annotations using namespace informer. In future, which Antrea IPAM support expands, this controller can be used to store annotations for other objects, such as Statefulsets.

func InitializeAntreaIPAMController added in v1.4.0

func InitializeAntreaIPAMController(kubeClient clientset.Interface, crdClient clientsetversioned.Interface, informerFactory informers.SharedInformerFactory) (*AntreaIPAMController, error)

func NewAntreaIPAMController added in v1.4.0

func NewAntreaIPAMController(kubeClient clientset.Interface,
	crdClient clientsetversioned.Interface,
	informerFactory informers.SharedInformerFactory) *AntreaIPAMController

func (*AntreaIPAMController) Run added in v1.4.0

func (c *AntreaIPAMController) Run(stopCh <-chan struct{})

Run starts to watch and process Namespace updates for the Node where Antrea Agent is running, and maintain a mapping between Namespace name and IPAM annotations.

type IPAMConfig

type IPAMConfig struct {
	Type   string     `json:"type,omitempty"`
	Ranges []RangeSet `json:"ranges,omitempty"`
}

type IPAMDelegator

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

func (*IPAMDelegator) Add

func (d *IPAMDelegator) Add(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, *current.Result, error)

func (*IPAMDelegator) Check

func (d *IPAMDelegator) Check(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, error)

func (*IPAMDelegator) Del

func (d *IPAMDelegator) Del(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, error)

type IPAMDriver

type IPAMDriver interface {
	Add(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, *current.Result, error)
	Del(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, error)
	Check(args *invoke.Args, k8sArgs *argtypes.K8sArgs, networkConfig []byte) (bool, error)
}

type Range

type Range struct {
	Subnet  string `json:"subnet"`
	Gateway string `json:"gateway,omitempty"`
}

type RangeSet

type RangeSet []Range

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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