network

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNodeIPForNetwork

func GetNodeIPForNetwork(node *apiv1.Node, network string) string

GetNodeIPForNetwork retrieves the IP of the interface of the node connected to the network. The addresses come from the 'networking.gke.io/north-interfaces' annotation.

Types

type NetworkInfo

type NetworkInfo struct {
	// IsDefault indicates if the network is the default one.
	IsDefault bool
	// K8sNetwork is the network name of the Network resource in the cluster.
	// This name should be used when referring to k8s API network.
	K8sNetwork string
	// NetworkURL is the GCE VPC URL (to be used in GCE LB resources).
	NetworkURL string
	// SubnetworkURL is the GCE subnetwork URL (to be used in GCE LB resources).
	SubnetworkURL string
}

NetworkInfo contains the information about the network the LB resources should be created in.

func DefaultNetwork

func DefaultNetwork(cloudProvider cloudNetworkProvider) *NetworkInfo

func ServiceNetwork

func ServiceNetwork(service *apiv1.Service, networkLister, gkeNetworkParamSetLister cache.Indexer, cloudProvider cloudNetworkProvider, logger klog.Logger) (*NetworkInfo, error)

ServiceNetwork determines the network data to be used for the LB resources. This function currently returns only the default network but will provide secondary networks information for multi-networked services in the future.

func (*NetworkInfo) IsNodeConnected

func (ni *NetworkInfo) IsNodeConnected(node *apiv1.Node) bool

IsNodeConnected checks if the node is connected to the given network. All nodes are connected to the default network. For non default networks the result is based on the data from the 'networking.gke.io/north-interfaces' node annotation.

Jump to

Keyboard shortcuts

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