services

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package services contains tools for handling VSphere services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlPlaneEndpointService added in v1.1.0

type ControlPlaneEndpointService interface {
	// ReconcileControlPlaneEndpointService manages the lifecycle of a
	// control plane endpoint managed by a vmoperator VirtualMachineService
	ReconcileControlPlaneEndpointService(ctx context.Context, clusterCtx *vmware.ClusterContext, netProvider NetworkProvider) (*clusterv1.APIEndpoint, error)
}

ControlPlaneEndpointService is a service for reconciling load balanced control plane endpoints.

type NetworkProvider added in v1.1.0

type NetworkProvider interface {
	// HasLoadBalancer indicates whether this provider has a load balancer for Services.
	HasLoadBalancer() bool

	// SupportsVMReadinessProbe indicates whether this provider support vm readiness probe.
	SupportsVMReadinessProbe() bool

	// ProvisionClusterNetwork creates network resource for a given cluster
	// This operation should be idempotent
	ProvisionClusterNetwork(ctx context.Context, clusterCtx *vmware.ClusterContext) error

	// GetClusterNetworkName returns the name of a valid cluster network if one exists
	// Returns an empty string if the operation is not supported
	GetClusterNetworkName(ctx context.Context, clusterCtx *vmware.ClusterContext) (string, error)

	// GetVMServiceAnnotations returns the annotations, if any, to place on a VM Service.
	GetVMServiceAnnotations(ctx context.Context, clusterCtx *vmware.ClusterContext) (map[string]string, error)

	// ConfigureVirtualMachine configures a VM for the particular network
	ConfigureVirtualMachine(ctx context.Context, clusterCtx *vmware.ClusterContext, vm *vmoprv1.VirtualMachine) error

	// VerifyNetworkStatus verifies the status of the network after vnet creation
	VerifyNetworkStatus(ctx context.Context, clusterCtx *vmware.ClusterContext, obj runtime.Object) error
}

NetworkProvider provision network resources and configures VM based on network type.

type ResourcePolicyService added in v1.1.0

type ResourcePolicyService interface {
	// ReconcileResourcePolicy ensures that a VirtualMachineSetResourcePolicy exists for the cluster
	// Returns the name of a policy if it exists, otherwise returns an error
	ReconcileResourcePolicy(ctx context.Context, clusterCtx *vmware.ClusterContext) (string, error)
}

ResourcePolicyService is a service for reconciling a VirtualMachineSetResourcePolicy for a cluster.

type VSphereMachineService added in v1.1.0

type VSphereMachineService interface {
	GetMachinesInCluster(ctx context.Context, namespace, clusterName string) ([]client.Object, error)
	FetchVSphereMachine(ctx context.Context, name types.NamespacedName) (capvcontext.MachineContext, error)
	FetchVSphereCluster(ctx context.Context, cluster *clusterv1.Cluster, machineContext capvcontext.MachineContext) (capvcontext.MachineContext, error)
	ReconcileDelete(ctx context.Context, machineCtx capvcontext.MachineContext) error
	SyncFailureReason(ctx context.Context, machineCtx capvcontext.MachineContext) (bool, error)
	ReconcileNormal(ctx context.Context, machineCtx capvcontext.MachineContext) (bool, error)
	GetHostInfo(ctx context.Context, machineCtx capvcontext.MachineContext) (string, error)
}

VSphereMachineService is used for vsphere VM lifecycle and syncing with VSphereMachine types.

type VimMachineService added in v1.1.0

type VimMachineService struct {
	Client client.Client
}

VimMachineService reconciles VSphere VMs.

func (*VimMachineService) FetchVSphereCluster added in v1.1.0

func (v *VimMachineService) FetchVSphereCluster(ctx context.Context, cluster *clusterv1.Cluster, machineContext capvcontext.MachineContext) (capvcontext.MachineContext, error)

FetchVSphereCluster adds the VSphereCluster associated with the passed cluster to the machineContext.

func (*VimMachineService) FetchVSphereMachine added in v1.1.0

FetchVSphereMachine returns a new MachineContext containing the vsphereMachine.

func (*VimMachineService) GetHostInfo added in v1.3.2

func (v *VimMachineService) GetHostInfo(ctx context.Context, machineCtx capvcontext.MachineContext) (string, error)

GetHostInfo returns the hostname or IP address of the infrastructure host for the VSphere VM.

func (*VimMachineService) GetMachinesInCluster added in v1.9.0

func (v *VimMachineService) GetMachinesInCluster(
	ctx context.Context,
	namespace, clusterName string) ([]client.Object, error)

GetMachinesInCluster returns a list of VSphereMachine objects belonging to the cluster.

func (*VimMachineService) ReconcileDelete added in v1.1.0

func (v *VimMachineService) ReconcileDelete(ctx context.Context, machineCtx capvcontext.MachineContext) error

ReconcileDelete reconciles delete events for the VSphere VM.

func (*VimMachineService) ReconcileNormal added in v1.1.0

func (v *VimMachineService) ReconcileNormal(ctx context.Context, machineCtx capvcontext.MachineContext) (bool, error)

ReconcileNormal reconciles create and update events for the VSphere VM.

func (*VimMachineService) SyncFailureReason added in v1.1.0

func (v *VimMachineService) SyncFailureReason(ctx context.Context, machineCtx capvcontext.MachineContext) (bool, error)

SyncFailureReason returns true if the VSphere Machine has failed.

type VirtualMachineService

type VirtualMachineService interface {
	// ReconcileVM reconciles a VM with the intended state.
	ReconcileVM(ctx context.Context, vmCtx *capvcontext.VMContext) (infrav1.VirtualMachine, error)

	// DestroyVM powers off and removes a VM from the inventory.
	DestroyVM(ctx context.Context, vmCtx *capvcontext.VMContext) (reconcile.Result, infrav1.VirtualMachine, error)
}

VirtualMachineService is a service for creating/updating/deleting virtual machines on vSphere.

Directories

Path Synopsis
Package fake implements a fake VMService for testing.
Package fake implements a fake VMService for testing.
Package govmomi contains tools for interacting with vSphere APIs.
Package govmomi contains tools for interacting with vSphere APIs.
cluster
Package cluster contains tools for managing ComputeClusters.
Package cluster contains tools for managing ComputeClusters.
clustermodules
Package clustermodules contains tools for handling Cluster Modules.
Package clustermodules contains tools for handling Cluster Modules.
extra
Package extra contains config with a VM's guestInfo RPC interface.
Package extra contains config with a VM's guestInfo RPC interface.
find
Package find is used to find VCenter objects based for failure domain handling.
Package find is used to find VCenter objects based for failure domain handling.
ipam
Package ipam contains tools for to deal with CAPI IPAddress and related types.
Package ipam contains tools for to deal with CAPI IPAddress and related types.
metadata
Package metadata contains tools to manage metadata tags on VCenter objects.
Package metadata contains tools to manage metadata tags on VCenter objects.
net
Package net contains tools for handling VM networks.
Package net contains tools for handling VM networks.
pci
Package pci contains tools for PCI devices.
Package pci contains tools for PCI devices.
template
Package template has tools for finding VM templates.
Package template has tools for finding VM templates.
vcenter
Package vcenter has tools for cloning virtual machines in vcenter.
Package vcenter has tools for cloning virtual machines in vcenter.
Package network contains code for configuring network services.
Package network contains code for configuring network services.
Package vmoperator contains reconcilers and related functions for VM Operator based VSphereMachines.
Package vmoperator contains reconcilers and related functions for VM Operator based VSphereMachines.

Jump to

Keyboard shortcuts

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