provisioners

package
v0.1.63 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrYield is raised when a provision/deprovision optation could
	// block for a long time, in particular the bits that wait for apllication
	// available status.  This will trigger a controller to requeue the request.
	// The key things are that workers are unblocked, allowing other reconciles
	// to be triggered, and we can pick up an modifications (e.g. the cluster is
	// gubbed - thanks CAPO - and we can delete it without waiting for 10m as the
	// case used to be in the old world.
	ErrYield = errors.New("controller timeout yield")

	// ErrNotFound is when a resource is not found.
	ErrNotFound = errors.New("resource not found")
)

Functions

This section is empty.

Types

type ManagerProvisioner

type ManagerProvisioner interface {
	Provisioner

	// Object returns a reference to the generic object type, internally
	// the provisioner will have a type specific version.
	Object() unikornv1.ManagableResourceInterface
}

ManagerProvisioner top-level manager provisioners hook directly into the controller runtime layer, and are a little special in that they abstract away type specific things.

type Metadata

type Metadata struct {
	// Name is the name of the provisioner.
	Name string

	// Remote is the remote cluster a resource or group of resources
	// belongs to.
	Remote RemoteCluster

	// BackgroundDelete means we don't care about whether it's deprovisioned
	// successfully or not, especially useful for apps living in a
	// remote cluster that going to get terminated anyway.
	BackgroundDelete bool
}

Metadata is a container for geneirc provisioner metadata.

func (*Metadata) BackgroundDeletion

func (p *Metadata) BackgroundDeletion()

func (*Metadata) OnRemote

func (p *Metadata) OnRemote(remote RemoteCluster)

func (*Metadata) PropagateOptions

func (p *Metadata) PropagateOptions(provisioner Provisioner)

PropagateOptions allows provisioners to push options down to all their children.

func (*Metadata) ProvisionerName

func (p *Metadata) ProvisionerName() string

ProvisionerName implements the Provisioner interface.

type Provisioner

type Provisioner interface {
	// ProvisionerName returns the provisioner name.
	ProvisionerName() string

	// OnRemote defines this provisioner should be run on the
	// provided remote cluster.  All composite provisioners must
	// propagate this.
	OnRemote(remote RemoteCluster)

	// BackgroundDeletion means we don't care about whether it's deprovisioned
	// successfully or not, especially useful for apps living in a
	// remote cluster that going to get terminated anyway.
	BackgroundDeletion()

	// Provision deploys the requested package.
	// Implementations should ensure this receiver is idempotent.
	Provision(ctx context.Context) error

	// Deprovision does any special handling of resource/component
	// removal.  In the general case, you should rely on cascading
	// deletion i.e. kill the namespace, use owner references.
	// Deprovisioners should be gating, waiting for their resources
	// to be removed before indicating success.
	Deprovision(ctx context.Context) error
}

Provisioner is an abstract type that allows provisioning of Kubernetes packages in a technology agnostic way. For example some things may be installed as a raw set of resources, a YAML manifest, Helm etc.

type RemoteCluster

type RemoteCluster interface {
	// ID is the unique resource identifier for this remote cluster.
	ID() *cd.ResourceIdentifier

	// Config returns the client configuration (aka parsed Kubeconfig.)
	Config(ctx context.Context) (*clientcmdapi.Config, error)
}

Generator is an abstraction around the sources of remote clusters e.g. a cluster API or vcluster Kubernetes instance.

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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