compute

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashInstanceSpec

func HashInstanceSpec(computeInstance *InstanceSpec) (string, error)

Types

type InstanceIdentifier

type InstanceIdentifier struct {
	ID   string
	Name string
}

InstanceIdentifier describes an instance which has not necessarily been fetched.

type InstanceNetworkStatus

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

InstanceNetworkStatus represents the network status of an OpenStack instance as used by CAPO. Therefore it may use more context than just data which was returned by OpenStack.

func (*InstanceNetworkStatus) Addresses

func (ns *InstanceNetworkStatus) Addresses() []corev1.NodeAddress

Addresses returns a list of NodeAddresses containing all addresses which will be reported on the OpenStackMachine object.

func (*InstanceNetworkStatus) FloatingIP

func (ns *InstanceNetworkStatus) FloatingIP(networkName string) string

FloatingIP returns the first listed floating ip of an instance for the given network name.

func (*InstanceNetworkStatus) IP

func (ns *InstanceNetworkStatus) IP(networkName string) string

IP returns the first listed ip of an instance for the given network name.

type InstanceSpec

type InstanceSpec struct {
	Name                   string
	Image                  string
	ImageUUID              string
	Flavor                 string
	SSHKeyName             string
	UserData               string
	Metadata               map[string]string
	ConfigDrive            bool
	FailureDomain          string
	RootVolume             *infrav1.RootVolume
	AdditionalBlockDevices []infrav1.AdditionalBlockDevice
	ServerGroupID          string
	Trunk                  bool
	Tags                   []string
	SecurityGroups         []infrav1.SecurityGroupFilter
	Ports                  []infrav1.PortOpts
}

InstanceSpec defines the fields which can be set on a new OpenStack instance.

InstanceSpec does not contain all of the fields of infrav1.Instance, as not all of them can be set on a new instance.

type InstanceStatus

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

InstanceStatus represents instance data which has been returned by OpenStack.

func NewInstanceStatusFromServer

func NewInstanceStatusFromServer(server *clients.ServerExt, logger logr.Logger) *InstanceStatus

func (*InstanceStatus) AvailabilityZone

func (is *InstanceStatus) AvailabilityZone() string

func (*InstanceStatus) BastionStatus

func (is *InstanceStatus) BastionStatus(openStackCluster *infrav1.OpenStackCluster) (*infrav1.BastionStatus, error)

BastionStatus returns an infrav1.BastionStatus for use in the cluster status.

func (*InstanceStatus) ID

func (is *InstanceStatus) ID() string

func (*InstanceStatus) InstanceIdentifier

func (is *InstanceStatus) InstanceIdentifier() *InstanceIdentifier

InstanceIdentifier returns an InstanceIdentifier object for an InstanceStatus.

func (*InstanceStatus) Name

func (is *InstanceStatus) Name() string

func (*InstanceStatus) NetworkStatus

func (is *InstanceStatus) NetworkStatus() (*InstanceNetworkStatus, error)

NetworkStatus returns an InstanceNetworkStatus object for an InstanceStatus.

func (*InstanceStatus) SSHKeyName

func (is *InstanceStatus) SSHKeyName() string

func (*InstanceStatus) State

func (is *InstanceStatus) State() infrav1.InstanceState

type Service

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

func NewService

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

NewService returns an instance of the compute service.

func (*Service) CreateInstance

func (s *Service) CreateInstance(eventObject runtime.Object, openStackCluster *infrav1.OpenStackCluster, instanceSpec *InstanceSpec, clusterName string) (*InstanceStatus, error)

func (*Service) DeleteInstance

func (s *Service) DeleteInstance(openStackCluster *infrav1.OpenStackCluster, eventObject runtime.Object, instanceStatus *InstanceStatus, instanceSpec *InstanceSpec) error

func (*Service) GetAvailabilityZones

func (s *Service) GetAvailabilityZones() ([]availabilityzones.AvailabilityZone, error)

func (*Service) GetInstanceStatus

func (s *Service) GetInstanceStatus(resourceID string) (instance *InstanceStatus, err error)

func (*Service) GetInstanceStatusByName

func (s *Service) GetInstanceStatusByName(eventObject runtime.Object, name string) (instance *InstanceStatus, err error)

func (*Service) GetManagementPort

func (s *Service) GetManagementPort(openStackCluster *infrav1.OpenStackCluster, instanceStatus *InstanceStatus) (*ports.Port, error)

GetManagementPort returns the port which is used for management and external traffic. Cluster floating IPs must be associated with this port.

Jump to

Keyboard shortcuts

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