kubernetes

package
v0.6.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const UnnamedNetwork string = ""

Variables

This section is empty.

Functions

func IPManagement

func IPManagement(ctx context.Context, mode int, ipamConf whereaboutstypes.IPAMConfig, client *KubernetesIPAM) ([]net.IPNet, error)

IPManagement manages ip allocation and deallocation from a storage perspective

func IPManagementKubernetesUpdate

func IPManagementKubernetesUpdate(ctx context.Context, mode int, ipam *KubernetesIPAM, ipamConf whereaboutstypes.IPAMConfig,
	containerID string, podRef string) ([]net.IPNet, error)

IPManagementKubernetesUpdate manages k8s updates

func IPPoolName added in v0.6.2

func IPPoolName(poolIdentifier PoolIdentifier) string

Types

type Client

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

Client has info on how to connect to the kubernetes cluster

func NewClient

func NewClient(timeout time.Duration) (*Client, error)

func NewClientViaKubeconfig

func NewClientViaKubeconfig(kubeconfigPath string, timeout time.Duration) (*Client, error)

func NewKubernetesClient added in v0.6.1

func NewKubernetesClient(k8sClient wbclient.Interface, k8sClientSet kubernetes.Interface, timeout time.Duration) *Client

func (*Client) DeleteOverlappingIP

func (i *Client) DeleteOverlappingIP(ctx context.Context, clusterWideIP *whereaboutsv1alpha1.OverlappingRangeIPReservation) error

func (*Client) GetPod added in v0.6.3

func (i *Client) GetPod(namespace, name string) (*v1.Pod, error)

func (*Client) ListIPPools

func (i *Client) ListIPPools(ctx context.Context) ([]storage.IPPool, error)

func (*Client) ListOverlappingIPs

func (*Client) ListPods

func (i *Client) ListPods(ctx context.Context) ([]v1.Pod, error)

type KubernetesIPAM

type KubernetesIPAM struct {
	Client
	Config whereaboutstypes.IPAMConfig
	// contains filtered or unexported fields
}

KubernetesIPAM manages ip blocks in an kubernetes CRD backend

func NewKubernetesIPAM

func NewKubernetesIPAM(containerID string, ipamConf whereaboutstypes.IPAMConfig) (*KubernetesIPAM, error)

NewKubernetesIPAM returns a new KubernetesIPAM Client configured to a kubernetes CRD backend

func NewKubernetesIPAMWithNamespace added in v0.5.3

func NewKubernetesIPAMWithNamespace(containerID string, ipamConf whereaboutstypes.IPAMConfig, namespace string) (*KubernetesIPAM, error)

NewKubernetesIPAMWithNamespace returns a new KubernetesIPAM Client configured to a kubernetes CRD backend

func (*KubernetesIPAM) Close

func (i *KubernetesIPAM) Close() error

Close partially implements the Store interface

func (*KubernetesIPAM) GetIPPool

func (i *KubernetesIPAM) GetIPPool(ctx context.Context, poolIdentifier PoolIdentifier) (storage.IPPool, error)

GetIPPool returns a storage.IPPool for the given range

func (*KubernetesIPAM) GetOverlappingRangeStore

func (i *KubernetesIPAM) GetOverlappingRangeStore() (storage.OverlappingRangeStore, error)

GetOverlappingRangeStore returns a clusterstore interface

func (*KubernetesIPAM) Status

func (i *KubernetesIPAM) Status(ctx context.Context) error

Status tests connectivity to the kubernetes backend

type KubernetesIPPool

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

KubernetesIPPool represents an IPPool resource and its parsed set of allocations

func (*KubernetesIPPool) Allocations

func (p *KubernetesIPPool) Allocations() []whereaboutstypes.IPReservation

Allocations returns the initially retrieved set of allocations for this pool

func (*KubernetesIPPool) Update

func (p *KubernetesIPPool) Update(ctx context.Context, reservations []whereaboutstypes.IPReservation) error

Update sets the pool allocated IP list to the given IP reservations

type KubernetesOverlappingRangeStore

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

KubernetesOverlappingRangeStore represents a OverlappingRangeStore interface

func (*KubernetesOverlappingRangeStore) IsAllocatedInOverlappingRange

func (c *KubernetesOverlappingRangeStore) IsAllocatedInOverlappingRange(ctx context.Context, ip net.IP,
	networkName string) (bool, error)

IsAllocatedInOverlappingRange checks for IP addresses to see if they're allocated cluster wide, for overlapping ranges.

func (*KubernetesOverlappingRangeStore) UpdateOverlappingRangeAllocation

func (c *KubernetesOverlappingRangeStore) UpdateOverlappingRangeAllocation(ctx context.Context, mode int, ip net.IP,
	containerID, podRef, networkName string) error

UpdateOverlappingRangeAllocation updates clusterwide allocation for overlapping ranges.

type PoolIdentifier added in v0.6.2

type PoolIdentifier struct {
	IpRange     string
	NetworkName string
}

Jump to

Keyboard shortcuts

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