cloud

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MachineUpdater added in v0.7.14

type MachineUpdater func(string, string, func(*clusterv1alpha1.Machine)) (*clusterv1alpha1.Machine, error)

MachineUpdater defines a function to persist an update to a machine

type Provider

type Provider interface {
	AddDefaults(spec clusterv1alpha1.MachineSpec) (clusterv1alpha1.MachineSpec, bool, error)

	// Validate validates the given machine's specification.
	//
	// In case of any error a "terminal" error should be set,
	// See v1alpha1.MachineStatus for more info
	Validate(machinespec clusterv1alpha1.MachineSpec) error

	// Get gets a node that is associated with the given machine.
	//
	// Note that this method can return what we call a "terminal" error,
	// which indicates that a manual interaction is required to recover from this state.
	// See v1alpha1.MachineStatus for more info and TerminalError type
	Get(machine *clusterv1alpha1.Machine) (instance.Instance, error)

	GetCloudConfig(spec clusterv1alpha1.MachineSpec) (config string, name string, err error)

	// Create creates a cloud instance according to the given machine
	Create(machine *clusterv1alpha1.Machine, update MachineUpdater, userdata string) (instance.Instance, error)

	// Delete deletes the instance and all associated ressources
	// This will always be called on machine deletion, the implemention must check if there is actually
	// something to delete and just do nothing if there isn't
	Delete(machine *clusterv1alpha1.Machine, update MachineUpdater) error

	// MachineMetricsLabels returns labels used for the Prometheus metrics
	// about created machines, e.g. instance type, instance size, region
	// or whatever the provider deems interesting. Should always return
	// a "size" label.
	MachineMetricsLabels(machine *clusterv1alpha1.Machine) (map[string]string, error)
}

Provider exposed all required functions to interact with a cloud provider

Jump to

Keyboard shortcuts

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