Documentation ¶
Overview ¶
Package ipam contains utility functions to deal with resources of the IPAM API.
Index ¶
- func CreateNetwork(ctx context.Context, cl client.Client, name, namespace, cidr string, ...) error
- func GetExternalCIDR(ctx context.Context, cl client.Client) (string, error)
- func GetInternalCIDR(ctx context.Context, cl client.Client) (string, error)
- func GetPodCIDR(ctx context.Context, cl client.Client) (string, error)
- func GetRemappedIP(ip *ipamv1alpha1.IP) networkingv1beta1.IP
- func GetReservedSubnets(ctx context.Context, cl client.Client) ([]string, error)
- func GetServiceCIDR(ctx context.Context, cl client.Client) (string, error)
- func IsAPIServerIP(ip *ipamv1alpha1.IP) bool
- func IsAPIServerProxyIP(ip *ipamv1alpha1.IP) bool
- func IsExternalCIDR(nw *ipamv1alpha1.Network) bool
- func IsInternalCIDR(nw *ipamv1alpha1.Network) bool
- func IsPodCIDR(nw *ipamv1alpha1.Network) bool
- func IsReservedNetwork(nw *ipamv1alpha1.Network) bool
- func IsServiceCIDR(nw *ipamv1alpha1.Network) bool
- func NetworkNotRemapped(nw *ipamv1alpha1.Network) bool
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 ¶
GetExternalCIDR retrieves the externalCIDR of the local cluster.
func GetInternalCIDR ¶
GetInternalCIDR retrieves the internalCIDR of the local cluster.
func GetPodCIDR ¶
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 ¶
GetReservedSubnets retrieves the reserved subnets of the local cluster.
func GetServiceCIDR ¶
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.