networking

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 33 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExternalNetworksOnly added in v0.10.0

func ExternalNetworksOnly(opts networks.ListOptsBuilder) networks.ListOptsBuilder

Types

type GetNetworkOpts added in v0.10.0

type GetNetworkOpts func(networks.ListOptsBuilder) networks.ListOptsBuilder

type PortListOpts added in v0.10.0

type PortListOpts struct {
	DeviceOwner []string `q:"device_owner"`
	NetworkID   string   `q:"network_id"`
}

func (*PortListOpts) ToPortListQuery added in v0.10.0

func (p *PortListOpts) ToPortListQuery() (string, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service interfaces with the OpenStack Networking API. It will create a network related infrastructure for the cluster, like network, subnet, router, security groups.

func NewService

func NewService(scope *scope.WithLogger) (*Service, error)

NewService returns an instance of the networking service.

func (*Service) AdoptPortsServer added in v0.11.0

func (s *Service) AdoptPortsServer(scope *scope.WithLogger, desiredPorts []infrav1.ResolvedPortSpec, resources *infrav1alpha1.ServerResources) error

AdoptPortsServer looks for ports in desiredPorts which were previously created, and adds them to resources.Ports. A port matches if it has the same name and network ID as the desired port. TODO(emilien): remove this function: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/2071

func (*Service) AssociateFloatingIP added in v0.3.4

func (s *Service) AssociateFloatingIP(eventObject runtime.Object, fp *floatingips.FloatingIP, portID string) error

func (*Service) ConstructPorts added in v0.10.0

func (s *Service) ConstructPorts(instancePorts []infrav1.PortOpts, instanceSecurityGroups []infrav1.SecurityGroupParam, instanceTrunk bool, clusterResourceName, baseName string, defaultNetwork *infrav1.NetworkStatusWithSubnets, managedSecurityGroup *string, baseTags []string) ([]infrav1.ResolvedPortSpec, error)

ConstructPorts builds an array of ports from given parameters. If no ports are provided, returns a single port for a network connection to the default cluster network. We'll want to remove this default port in the future to call this function without dependency on the default network.

func (*Service) CreateFloatingIPForPool added in v0.10.0

func (s *Service) CreateFloatingIPForPool(pool *infrav1alpha1.OpenStackFloatingIPPool) (*floatingips.FloatingIP, error)

func (*Service) CreatePort added in v0.10.0

func (s *Service) CreatePort(eventObject runtime.Object, portSpec *infrav1.ResolvedPortSpec) (*ports.Port, error)

func (*Service) CreatePorts added in v0.10.0

func (s *Service) CreatePorts(eventObject runtime.Object, desiredPorts []infrav1.ResolvedPortSpec, resources *infrav1alpha1.ServerResources) error

func (*Service) DeleteClusterPorts added in v0.10.0

func (s *Service) DeleteClusterPorts(openStackCluster *infrav1.OpenStackCluster) error

DeleteClusterPorts deletes all ports created for the cluster.

func (*Service) DeleteFloatingIP added in v0.3.3

func (s *Service) DeleteFloatingIP(eventObject runtime.Object, ip string) error

func (*Service) DeleteInstanceTrunkAndPort added in v0.10.0

func (s *Service) DeleteInstanceTrunkAndPort(eventObject runtime.Object, port infrav1.PortStatus, trunkSupported bool) error

DeleteTrunk deletes the Neutron trunk and port with the given ID.

func (*Service) DeleteNetwork added in v0.3.1

func (s *Service) DeleteNetwork(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error

func (*Service) DeletePort added in v0.5.0

func (s *Service) DeletePort(eventObject runtime.Object, portID string) error

DeletePort deletes the Neutron port with the given ID.

func (*Service) DeleteRouter added in v0.3.1

func (s *Service) DeleteRouter(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error

func (*Service) DeleteSecurityGroups

func (s *Service) DeleteSecurityGroups(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error

func (*Service) DeleteTrunk added in v0.5.0

func (s *Service) DeleteTrunk(eventObject runtime.Object, portID string) error

func (*Service) DisassociateFloatingIP added in v0.3.5

func (s *Service) DisassociateFloatingIP(eventObject runtime.Object, ip string) error

func (*Service) GetFloatingIP added in v0.6.0

func (s *Service) GetFloatingIP(ip string) (*floatingips.FloatingIP, error)

func (*Service) GetFloatingIPByPortID added in v0.3.5

func (s *Service) GetFloatingIPByPortID(portID string) (*floatingips.FloatingIP, error)

func (*Service) GetFloatingIPsByTag added in v0.10.0

func (s *Service) GetFloatingIPsByTag(tag string) ([]floatingips.FloatingIP, error)

func (*Service) GetNetworkByID added in v0.10.0

func (s *Service) GetNetworkByID(networkID string) (*networks.Network, error)

GetNetworkByID retrieves network by the ID.

func (*Service) GetNetworkByParam added in v0.10.0

func (s *Service) GetNetworkByParam(param *infrav1.NetworkParam, opts ...GetNetworkOpts) (*networks.Network, error)

GetNetworkByParam gets the network specified by the given NetworkParam.

func (*Service) GetNetworkIDByParam added in v0.10.0

func (s *Service) GetNetworkIDByParam(param *infrav1.NetworkParam, opts ...GetNetworkOpts) (string, error)

GetNetworkIDByParam returns the ID of the network specified by the given NetworkParam. It does not make an OpenStack call if the network is specified by ID.

func (*Service) GetNetworkSubnetByParam added in v0.10.0

func (s *Service) GetNetworkSubnetByParam(networkID string, param *infrav1.SubnetParam) (*subnets.Subnet, error)

GetNetworkSubnetByParam gets a single subnet of the given network, specified by the given SubnetParam. It returns an ErrFilterMatch if no or multiple subnets are found.

func (*Service) GetOrCreateFloatingIP added in v0.3.2

func (s *Service) GetOrCreateFloatingIP(eventObject runtime.Object, openStackCluster *infrav1.OpenStackCluster, clusterResourceName string, ip *string) (*floatingips.FloatingIP, error)

func (*Service) GetPortForExternalNetwork added in v0.10.0

func (s *Service) GetPortForExternalNetwork(instanceID string, externalNetworkID string) (*ports.Port, error)

func (*Service) GetPortFromInstanceIP added in v0.5.0

func (s *Service) GetPortFromInstanceIP(instanceID string, ip string) ([]ports.Port, error)

GetPortFromInstanceIP returns at most one port attached to the instance with given ID and with the IP address provided.

func (*Service) GetSecurityGroups added in v0.5.0

func (s *Service) GetSecurityGroups(securityGroupParams []infrav1.SecurityGroupParam) ([]string, error)

func (*Service) GetSubnetByParam added in v0.10.0

func (s *Service) GetSubnetByParam(param *infrav1.SubnetParam) (*subnets.Subnet, error)

GetSubnetByParam gets a single subnet specified by the given SubnetParam It returns an ErrFilterMatch if no or multiple subnets are found.

func (*Service) GetSubnetIDByParam added in v0.10.0

func (s *Service) GetSubnetIDByParam(param *infrav1.SubnetParam) (string, error)

GetSubnetIDByParam gets the id of a subnet from the given SubnetParam. It does not make any OpenStack API calls if the subnet is specified by ID.

func (*Service) GetSubnetsByFilter

func (s *Service) GetSubnetsByFilter(opts subnets.ListOptsBuilder) ([]subnets.Subnet, error)

GetSubnetsByFilter gets the id of a subnet by querying openstack with filters.

func (*Service) GetTrunkSupport added in v0.5.0

func (s *Service) GetTrunkSupport() (bool, error)

func (*Service) IsTrunkExtSupported added in v0.10.0

func (s *Service) IsTrunkExtSupported() (trunknSupported bool, err error)

IsTrunkExtSupported verifies trunk setup on the OpenStack deployment.

func (*Service) ReconcileExternalNetwork added in v0.3.2

func (s *Service) ReconcileExternalNetwork(openStackCluster *infrav1.OpenStackCluster) error

ReconcileExternalNetwork will try to find an external network and set it in the cluster status. The external network can be specified in the cluster spec or will be searched for if not specified. OpenStackCluster.Status.ExternalNetwork will be set to nil if one of these conditions are met: - no external network was given in the cluster spec and no external network was found - the user has set OpenStackCluster.Spec.DisableExternalNetwork to true.

func (*Service) ReconcileNetwork

func (s *Service) ReconcileNetwork(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error

func (*Service) ReconcileRouter

func (s *Service) ReconcileRouter(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error

func (*Service) ReconcileSecurityGroups

func (s *Service) ReconcileSecurityGroups(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error

ReconcileSecurityGroups reconcile the security groups.

func (*Service) ReconcileSubnet

func (s *Service) ReconcileSubnet(openStackCluster *infrav1.OpenStackCluster, clusterResourceName string) error

func (*Service) RemoveTrunkSubports added in v0.9.2

func (s *Service) RemoveTrunkSubports(trunkID string) error

func (*Service) TagFloatingIP added in v0.10.0

func (s *Service) TagFloatingIP(ip string, tag string) error

Jump to

Keyboard shortcuts

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