ipam

package
v1.0.0-rc.2 Latest Latest
Warning

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

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

Documentation

Overview

Package ipam contains utility functions to deal with resources of the IPAM API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNetwork

func CreateNetwork(ctx context.Context, cl client.Client, name, namespace, cidr string, needRemapping bool, networkType *consts.NetworkType) error

CreateNetwork creates a Network resource with the given name and CIDR. NeedRemapping indicates whether the Network needs CIDR remapping from IPAM. NetworkType indicates the type of the Network (leave empty to not set the type).

func GetExternalCIDR

func GetExternalCIDR(ctx context.Context, cl client.Client) (string, error)

GetExternalCIDR retrieves the externalCIDR of the local cluster.

func GetInternalCIDR

func GetInternalCIDR(ctx context.Context, cl client.Client) (string, error)

GetInternalCIDR retrieves the internalCIDR of the local cluster.

func GetPodCIDR

func GetPodCIDR(ctx context.Context, cl client.Client) (string, error)

GetPodCIDR retrieves the podCIDR of the local cluster.

func GetRemappedIP

func GetRemappedIP(ip *ipamv1alpha1.IP) networkingv1beta1.IP

GetRemappedIP returns the remapped IP of the given IP resource.

func GetReservedSubnets

func GetReservedSubnets(ctx context.Context, cl client.Client) ([]string, error)

GetReservedSubnets retrieves the reserved subnets of the local cluster.

func GetServiceCIDR

func GetServiceCIDR(ctx context.Context, cl client.Client) (string, error)

GetServiceCIDR retrieves the serviceCIDR of the local cluster.

func IsAPIServerIP

func IsAPIServerIP(ip *ipamv1alpha1.IP) bool

IsAPIServerIP checks if the resource is an IP of type API server.

func IsAPIServerProxyIP

func IsAPIServerProxyIP(ip *ipamv1alpha1.IP) bool

IsAPIServerProxyIP checks if the resource is an IP of type API server proxy.

func IsExternalCIDR

func IsExternalCIDR(nw *ipamv1alpha1.Network) bool

IsExternalCIDR returns whether the given Network is of type ExternalCIDR.

func IsInternalCIDR

func IsInternalCIDR(nw *ipamv1alpha1.Network) bool

IsInternalCIDR returns whether the given Network is of type InternalCIDR.

func IsPodCIDR

func IsPodCIDR(nw *ipamv1alpha1.Network) bool

IsPodCIDR returns whether the given Network is of type PodCIDR.

func IsReservedNetwork

func IsReservedNetwork(nw *ipamv1alpha1.Network) bool

IsReservedNetwork returns whether the given Network is of type Reserved.

func IsServiceCIDR

func IsServiceCIDR(nw *ipamv1alpha1.Network) bool

IsServiceCIDR returns whether the given Network is of type ServiceCIDR.

func NetworkNotRemapped

func NetworkNotRemapped(nw *ipamv1alpha1.Network) bool

NetworkNotRemapped returns whether the given Network does not need CIDR remapping.

Types

This section is empty.

Directories

Path Synopsis
Package mapping contains utility functions to deal with the mapping of IPs.
Package mapping contains utility functions to deal with the mapping of IPs.

Jump to

Keyboard shortcuts

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