Documentation ¶
Index ¶
- func GetNetworkSelfLink(cloudProvider CloudNetworkProvider) (string, error)
- func GetNodeIPForNetwork(node *apiv1.Node, network string) string
- type CloudNetworkProvider
- type CloudNetworkProviderAdapterWithSelfLink
- func (a *CloudNetworkProviderAdapterWithSelfLink) GetNetwork(networkName string) (*compute.Network, error)
- func (adapter *CloudNetworkProviderAdapterWithSelfLink) NetworkProjectID() string
- func (adapter *CloudNetworkProviderAdapterWithSelfLink) NetworkURL() string
- func (adapter *CloudNetworkProviderAdapterWithSelfLink) Region() string
- func (adapter *CloudNetworkProviderAdapterWithSelfLink) SubnetworkURL() string
- type FakeNetworkResolver
- type NetworkInfo
- type NetworksResolver
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNetworkSelfLink ¶ added in v1.32.0
func GetNetworkSelfLink(cloudProvider CloudNetworkProvider) (string, error)
Types ¶
type CloudNetworkProvider ¶ added in v1.32.0
type CloudNetworkProvider interface { NetworkURL() string SubnetworkURL() string NetworkProjectID() string Region() string GetNetwork(networkName string) (*compute.Network, error) }
func NewAdapterNetworkSelfLink ¶ added in v1.32.0
func NewAdapterNetworkSelfLink(cloudProvider CloudNetworkProvider) (CloudNetworkProvider, error)
CloudNetworkProviderAdapterWithSelfLink uses the network selfLink as networkUrl.
type CloudNetworkProviderAdapterWithSelfLink ¶ added in v1.32.0
type CloudNetworkProviderAdapterWithSelfLink struct {
// contains filtered or unexported fields
}
func (*CloudNetworkProviderAdapterWithSelfLink) GetNetwork ¶ added in v1.32.0
func (a *CloudNetworkProviderAdapterWithSelfLink) GetNetwork(networkName string) (*compute.Network, error)
func (*CloudNetworkProviderAdapterWithSelfLink) NetworkProjectID ¶ added in v1.32.0
func (adapter *CloudNetworkProviderAdapterWithSelfLink) NetworkProjectID() string
func (*CloudNetworkProviderAdapterWithSelfLink) NetworkURL ¶ added in v1.32.0
func (adapter *CloudNetworkProviderAdapterWithSelfLink) NetworkURL() string
func (*CloudNetworkProviderAdapterWithSelfLink) Region ¶ added in v1.32.0
func (adapter *CloudNetworkProviderAdapterWithSelfLink) Region() string
func (*CloudNetworkProviderAdapterWithSelfLink) SubnetworkURL ¶ added in v1.32.0
func (adapter *CloudNetworkProviderAdapterWithSelfLink) SubnetworkURL() string
type FakeNetworkResolver ¶ added in v1.25.0
type FakeNetworkResolver struct {
// contains filtered or unexported fields
}
FakeNetworkResolver is an implementation of a Resolver that just returns a previously set NetworkInfo. To be used only in tests.
func NewFakeResolver ¶ added in v1.25.0
func NewFakeResolver(networkInfo *NetworkInfo) *FakeNetworkResolver
func NewFakeResolverWithError ¶ added in v1.25.0
func NewFakeResolverWithError(err error) *FakeNetworkResolver
func (*FakeNetworkResolver) IsMultinetService ¶ added in v1.25.0
func (fake *FakeNetworkResolver) IsMultinetService(service *apiv1.Service) bool
func (*FakeNetworkResolver) ServiceNetwork ¶ added in v1.25.0
func (fake *FakeNetworkResolver) ServiceNetwork(service *apiv1.Service) (*NetworkInfo, error)
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
DefaultNetwork creates network information struct of the default network. Default network is the main cluster network.
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.
type NetworksResolver ¶ added in v1.25.0
type NetworksResolver struct {
// contains filtered or unexported fields
}
NetworksResolver is responsible for resolving networks that the LB resources should be created in.
func NewNetworksResolver ¶ added in v1.25.0
func NewNetworksResolver(networkLister, gkeNetworkParamSetLister cache.Indexer, cloudProvider CloudNetworkProvider, enableMultinetworking bool, logger klog.Logger) *NetworksResolver
NewNetworksResolver creates a new instance of the NetworksResolver.
func (*NetworksResolver) IsMultinetService ¶ added in v1.25.0
func (nr *NetworksResolver) IsMultinetService(service *apiv1.Service) bool
IsMultinetService checks if the service is a multinet service. It can only be true if multinetworking is enabled and the service has the multinet selector with a non-default network name.
func (*NetworksResolver) ServiceNetwork ¶ added in v1.25.0
func (nr *NetworksResolver) ServiceNetwork(service *apiv1.Service) (*NetworkInfo, error)
ServiceNetwork determines the network data to be used for the L4 LB resources.