network

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateMachineNetworkCIDR

func CalculateMachineNetworkCIDR(apiVip string, ingressVip string, hosts []*models.Host) (string, error)

* Calculate the machine network CIDR from the one of (ApiVip, IngressVip) and the ip addresses of the hosts. * The ip addresses of the host appear with CIDR notation. Therefore, the network can be calculated from it. * The goal of this function is to find the first network that one of the vips belongs to it. * This network is returned as a result.

func GenerateAPIVipMAC

func GenerateAPIVipMAC(clusterID string) string

func GenerateIngressVipMAC

func GenerateIngressVipMAC(clusterID string) string

func GetEncodedDhcpParamFileContents

func GetEncodedDhcpParamFileContents(cluster *common.Cluster) (string, error)

func GetMachineCIDRHosts

func GetMachineCIDRHosts(log logrus.FieldLogger, cluster *common.Cluster) ([]*models.Host, error)

func GetMachineCIDRInterface

func GetMachineCIDRInterface(host *models.Host, cluster *common.Cluster) (string, error)

func IpInCidr

func IpInCidr(ipAddr, cidr string) (bool, error)

func IpInFreeList

func IpInFreeList(hosts []*models.Host, vipIPStr, network string, log logrus.FieldLogger) bool

This is best effort validation. Therefore, validation will be done only if there are IPs in free list

func IsHostInMachineNetCidr

func IsHostInMachineNetCidr(log logrus.FieldLogger, cluster *common.Cluster, host *models.Host) bool

func VerifyCIDRsNotOverlap

func VerifyCIDRsNotOverlap(aCidrStr, bCidrStr string) error

func VerifyClusterCIDRsNotOverlap

func VerifyClusterCIDRsNotOverlap(machineNetworkCidr, clusterNetworkCidr, serviceNetworkCidr string) error

func VerifyMachineCIDR

func VerifyMachineCIDR(machineCidr string, hosts []*models.Host, log logrus.FieldLogger) error

func VerifyNetworkHostPrefix

func VerifyNetworkHostPrefix(prefix int64) error

func VerifySubnetCIDR

func VerifySubnetCIDR(cidrStr string) error

SubnetCIDR checks if the given IP net is a valid CIDR.

func VerifyVip

func VerifyVip(hosts []*models.Host, machineNetworkCidr string, vip string, vipName string, mustExist bool, log logrus.FieldLogger) error

func VerifyVips

func VerifyVips(hosts []*models.Host, machineNetworkCidr string, apiVip string, ingressVip string, mustExist bool, log logrus.FieldLogger) error

Types

type IPSet

type IPSet map[strfmt.IPv4]struct{}

func MakeFreeAddressesSet

func MakeFreeAddressesSet(hosts []*models.Host, network string, prefix *string, log logrus.FieldLogger) IPSet

func (IPSet) Add

func (s IPSet) Add(str strfmt.IPv4)

func (IPSet) Intersect

func (s IPSet) Intersect(other IPSet) IPSet

Jump to

Keyboard shortcuts

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