pool

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPBlocksAnnotation = "ipam.nvidia.com/ip-blocks"
)

Variables

This section is empty.

Functions

func IPBlockAnnotationExists

func IPBlockAnnotationExists(node *v1.Node) bool

IPBlockAnnotationExists returns true if ip-block annotation exist

func RemoveIPBlockAnnotation

func RemoveIPBlockAnnotation(node *v1.Node)

RemoveIPBlockAnnotation removes annotation with ip-block from the node object

func SetIPBlockAnnotation

func SetIPBlockAnnotation(node *v1.Node, pools map[string]*Pool) error

SetIPBlockAnnotation serialize IP pools settings for the node and add this info as annotation

Types

type ConfigReader added in v0.1.0

type ConfigReader interface {
	// GetPoolByKey returns IPPool for the provided pool name or nil if pool doesn't exist
	GetPoolByKey(key string) *Pool
	// GetPools returns map with information about all pools
	GetPools() map[string]*Pool
}

ConfigReader is an interface to which provides access to the pool configuration

func NewConfigReader added in v0.1.0

func NewConfigReader(node *v1.Node) (ConfigReader, error)

type ExclusionRange added in v0.2.0

type ExclusionRange struct {
	StartIP string `json:"startIP"`
	EndIP   string `json:"endIP"`
}

ExclusionRange contains range of IP to exclude from the allocation

type Manager

type Manager interface {
	ConfigReader
	// Update Pool's config from IPPool CR
	UpdatePool(key string, pool *Pool)
	// Remove Pool's config by key
	RemovePool(key string)
}

Manager provide access to pools configuration

func NewManager added in v0.1.0

func NewManager() Manager

NewManager create and initialize new manager instance

type Pool added in v0.2.0

type Pool struct {
	Name           string           `json:"-"`
	Subnet         string           `json:"subnet"`
	StartIP        string           `json:"startIP"`
	EndIP          string           `json:"endIP"`
	Gateway        string           `json:"gateway"`
	Exclusions     []ExclusionRange `json:"exclusions"`
	Routes         []Route          `json:"routes"`
	DefaultGateway bool             `json:"defaultGateway"`
}

Pool represents generic pool configuration

func (*Pool) String added in v0.2.0

func (p *Pool) String() string

String return string representation of the IPPool config

type Route added in v0.3.0

type Route struct {
	Dst string `json:"dst"`
}

Route contains a destination CIDR to be added as static route via gateway

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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