Help us shape the future of Go! Take the 2026 Go Developer Survey

virtualmachine

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VMStateOK is a constant for an OK state of an Azure virtual machine.
	VMStateOK float64 = 0
	// VMStateFailedWillReapply is a constant for a Failed state of an Azure virtual machine that will be reapplied.
	VMStateFailedWillReapply float64 = 1
	// VMStateFailed is a constant for a Failed state of an Azure virtual machine.
	VMStateFailed float64 = 2
)
View Source
const (
	// ControllerName is the name of the Azure virtualmachine controller.
	ControllerName = "azurevirtualmachine-controller"
	// ActuatorName is the name of the Azure virtualmachine actuator.
	ActuatorName = "azurevirtualmachine-actuator"
	// FinalizerName is the finalizer to put on virtualmachine resources.
	FinalizerName = "azure.remedy.gardener.cloud/virtualmachine"
)

Variables

View Source
var (
	// DefaultAddOptions are the default AddOptions for AddToManager.
	DefaultAddOptions = AddOptions{
		Config: config.AzureFailedVMRemedyConfiguration{
			RequeueInterval:    metav1.Duration{Duration: 1 * time.Minute},
			SyncPeriod:         metav1.Duration{Duration: 2 * time.Hour},
			MaxGetAttempts:     5,
			MaxReapplyAttempts: 5,
		},
	}

	// ReappliedVMsCounter is a global counter for reapplied Azure virtual machines.
	ReappliedVMsCounter = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: "reapplied_azure_virtual_machines_total",
			Help: "Number of reapplied Azure virtual machines",
		},
	)

	// VMStatesGaugeVec is a global gauge vector for the provisioning states of Azure virtual machines.
	// It could be used to raise an alert if the provisioning state of a VM is Failed and the controller has given
	// up trying to reapply it.
	VMStatesGaugeVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name: "azure_virtual_machine_states",
		Help: "Provisioning states of Azure virtual machines",
	}, []string{"name"})
)

Functions

func AddToManager

func AddToManager(_ context.Context, mgr manager.Manager) error

AddToManager adds a controller with the default AddOptions to the given manager.

func AddToManagerWithOptions

func AddToManagerWithOptions(mgr manager.Manager, options AddOptions) error

AddToManagerWithOptions adds a controller with the given AddOptions to the given manager.

func NewActuator

func NewActuator(
	client client.Client,
	vmUtils azure.VirtualMachineUtils,
	config config.AzureFailedVMRemedyConfiguration,
	timestamper utils.Timestamper,
	logger logr.Logger,
	reappliedVMsCounter prometheus.Counter,
	vmStatesGaugeVec utilsprometheus.GaugeVec,
) controller.Actuator

NewActuator creates a new Actuator.

Types

type AddOptions

type AddOptions struct {
	// Controller are the controller.Options.
	Controller controller.Options
	// InfraConfigPath is the path to the infrastructure configuration file.
	InfraConfigPath string
	// Config is the configuration for the Azure failed virtual machine remedy.
	Config config.AzureFailedVMRemedyConfiguration
}

AddOptions are options to apply when adding a controller to a manager.

Jump to

Keyboard shortcuts

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