ipamd

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// aws error codes for insufficient IP address scenario
	INSUFFICIENT_CIDR_BLOCKS    = "InsufficientCidrBlocks"
	INSUFFICIENT_FREE_IP_SUBNET = "InsufficientFreeAddressesInSubnet"
)

Variables

This section is empty.

Functions

func GetConfigForDebug

func GetConfigForDebug() map[string]interface{}

GetConfigForDebug returns the active values of the configuration env vars (for debugging purposes).

func ManageENIsOnNonSchedulableNode added in v1.12.6

func ManageENIsOnNonSchedulableNode() bool

ManageENIsOnNonSchedulableNode returns whether IPAMd should manage ENIs on the node or not.

func UseCustomNetworkCfg

func UseCustomNetworkCfg() bool

UseCustomNetworkCfg returns whether Pods needs to use pod specific configuration or not.

func UseSubnetDiscovery added in v1.18.0

func UseSubnetDiscovery() bool

UseSubnetDiscovery returns whether we should use enhanced subnet selection or not when creating ENIs.

Types

type IPAMContext

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

IPAMContext contains node level control information

func New

func New(k8sClient client.Client) (*IPAMContext, error)

New retrieves IP address usage information from Instance MetaData service and Kubelet then initializes IP address pool data store

func (*IPAMContext) AddFeatureToCNINode added in v1.15.0

func (c *IPAMContext) AddFeatureToCNINode(ctx context.Context, featureName rcv1alpha1.FeatureName, featureValue string) error

func (*IPAMContext) AnnotatePod added in v1.9.3

func (c *IPAMContext) AnnotatePod(podName string, podNamespace string, key string, newVal string, releasedIP string) error

AnnotatePod annotates the pod with the provided key and value

func (*IPAMContext) DeallocCidrs added in v1.9.0

func (c *IPAMContext) DeallocCidrs(eniID string, deletableCidrs []datastore.CidrInfo)

DeallocCidrs frees IPs and Prefixes from EC2

func (*IPAMContext) GetENIResourcesToAllocate added in v1.9.0

func (c *IPAMContext) GetENIResourcesToAllocate() int

func (*IPAMContext) GetIPv4Limit added in v1.9.0

func (c *IPAMContext) GetIPv4Limit() (int, int, error)

func (*IPAMContext) GetPod added in v1.6.4

func (c *IPAMContext) GetPod(podName, namespace string) (*corev1.Pod, error)

GetPod returns the pod matching the name and namespace

func (*IPAMContext) RunRPCHandler

func (c *IPAMContext) RunRPCHandler(version string) error

RunRPCHandler handles request from gRPC

func (*IPAMContext) ServeIntrospection

func (c *IPAMContext) ServeIntrospection()

ServeIntrospection sets up ipamd introspection endpoints

func (*IPAMContext) StartNodeIPPoolManager

func (c *IPAMContext) StartNodeIPPoolManager()

StartNodeIPPoolManager monitors the IP pool, add or del them when it is required.

type LoggingHandler

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

LoggingHandler is a object for handling http request

func (LoggingHandler) ServeHTTP

func (lh LoggingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PodENIData added in v1.6.4

type PodENIData struct {
	ENIID        string `json:"eniId"`
	IfAddress    string `json:"ifAddress"`
	PrivateIP    string `json:"privateIp"`
	IPV6Addr     string `json:"ipv6Addr"`
	VlanID       int    `json:"vlanID"`
	SubnetCIDR   string `json:"subnetCidr"`
	SubnetV6CIDR string `json:"subnetV6Cidr"`
}

PodENIData is used to parse the list of ENIs in the branch ENI pod annotation

type ReconcileCooldownCache

type ReconcileCooldownCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ReconcileCooldownCache keep track of recently freed CIDRs to avoid reading stale EC2 metadata

func (*ReconcileCooldownCache) Add

func (r *ReconcileCooldownCache) Add(cidr string)

Add sets a timestamp for the CIDR added that says how long they are not to be put back in the data store.

func (*ReconcileCooldownCache) RecentlyFreed

func (r *ReconcileCooldownCache) RecentlyFreed(cidr string) (found, recentlyFreed bool)

RecentlyFreed checks if this CIDR was recently freed.

func (*ReconcileCooldownCache) Remove

func (r *ReconcileCooldownCache) Remove(cidr string)

Remove removes a CIDR from the cooldown cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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