ipam

package
v0.0.0-...-21cfbab Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0, Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(args []string, version string) error

IPAM takes keyword with an IP address then calls the subcommands.

func Configure

func Configure(args []string) error

Configure IPAM.

func Release

func Release(args []string, version string) error

Release implements the "calicoctl ipam release" command, which supports releasing single IPs and releasing batches of leaked IPs and handles from an IPAM report.

func Show

func Show(args []string) error

IPAM takes keyword with an IP address then calls the subcommands.

func Split

func Split(args []string) error

Types

type Allocation

type Allocation struct {
	// The actual address.
	IP string `json:"ip"`

	// Access to the block.
	Block   *model.AllocationBlock `json:"-"`
	Ordinal int                    `json:"-"`

	Handle         string  `json:"handle,omitempty"`
	SequenceNumber *uint64 `json:"sequenceNumber,omitempty"`

	// Metadata for the Allocation.
	Pod               string `json:"pod,omitempty"`
	Namespace         string `json:"namespace,omitempty"`
	Node              string `json:"node,omitempty"`
	Type              string `json:"type,omitempty"`
	CreationTimestamp string `json:"creationTimestamp,omitempty"`

	// InUse is true when this Allocation is currently being used by a running
	// workload / node / etc. It is false if this address is not active and should be cleaned up.
	InUse bool `json:"inUse"`

	// Borrowed is true if this IP is from a block that is not affine to the node.
	Borrowed bool `json:"borrowed,omitempty"`

	// List of objects which are using this IP.
	Owners []string `json:"owners"`
}

Allocation represents an IP that is allocated in Calico IPAM, augmented with data from cross referencing with WorkloadEndpoints, etc.

func (*Allocation) GetAttrString

func (a *Allocation) GetAttrString() string

type HandleInfo

type HandleInfo struct {
	ID       string
	UID      *types.UID
	Revision string
}

type IPAMChecker

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

func NewIPAMChecker

func NewIPAMChecker(k8sClient kubernetes.Interface,
	v3Client clientv3.Interface,
	backendClient bapi.Client,
	showAllIPs bool,
	showProblemIPs bool,
	outFile string,
	version string) *IPAMChecker

type Report

type Report struct {
	// Version of the code that produced the report.
	Version string `json:"version"`

	// Important metadata.
	ClusterGUID         string `json:"clusterGUID"`
	DatastoreLocked     bool   `json:"datastoreLocked"`
	ClusterInfoRevision string `json:"clusterInformationRevision"`
	ClusterType         string `json:"clusterType"`

	// Allocations is a map of IP address to list of allocation data.
	Allocations   map[string][]*Allocation `json:"allocations"`
	LeakedHandles []HandleInfo             `json:"leakedHandles,omitempty"`
}

Jump to

Keyboard shortcuts

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