instance

package
v0.0.0-...-e0df0e5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultProvider

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

DefaultProvider implements the Instance Provider

func NewDefaultProvider

func NewDefaultProvider(
	csClient csapi.CloudStackAPI,
	networkProvider network.Provider,
	templateProvider template.Provider,
	cache *cache.Cache,
	clusterName string,
) *DefaultProvider

NewDefaultProvider creates a new instance provider

func (*DefaultProvider) Create

func (p *DefaultProvider) Create(ctx context.Context, nodeClass *v1.CloudStackNodeClass, nodeClaim *karpv1.NodeClaim, instanceTypes []*cloudprovider.InstanceType) (*Instance, error)

Create creates a new virtual machine

func (*DefaultProvider) Delete

func (p *DefaultProvider) Delete(ctx context.Context, id string) error

Delete deletes an instance

func (*DefaultProvider) Get

func (p *DefaultProvider) Get(ctx context.Context, id string) (*Instance, error)

Get retrieves an instance by ID

func (*DefaultProvider) List

func (p *DefaultProvider) List(ctx context.Context) ([]*Instance, error)

List lists all instances managed by Karpenter

type Instance

type Instance struct {
	ID                string
	Name              string
	State             string
	Zone              string
	ZoneID            string
	ServiceOffering   string
	ServiceOfferingID string
	Template          string
	TemplateID        string
	NetworkID         string
	IPAddress         string
	CreatedTime       time.Time
	Tags              map[string]string
}

Instance represents a CloudStack virtual machine

type Provider

type Provider interface {
	Create(ctx context.Context, nodeClass *v1.CloudStackNodeClass, nodeClaim *karpv1.NodeClaim, instanceTypes []*cloudprovider.InstanceType) (*Instance, error)
	Get(ctx context.Context, id string) (*Instance, error)
	List(ctx context.Context) ([]*Instance, error)
	Delete(ctx context.Context, id string) error
}

Provider provides instance management

Jump to

Keyboard shortcuts

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